Lec 10
Lec 10
I/O Systems
The Input/Output Subsystem
Input and output (I/O) devices allow us to communicate with the
computer system.
I/O is the transfer of data between primary memory and various I/O
peripherals.
Input devices: keyboards, mice, scanners, voice, and touch screens (data
in)
Output devices: monitors, printers, and speakers (data out)
These devices are not connected directly to the CPU. Instead, there is an
interface that handles the data transfers. This interface converts the
system bus signals to and from a format that is acceptable to the given
device.
This exchange of data is performed in two ways:
memory-mapped I/O: the registers in the interface
appear in the computer’s memory map and there is no real
difference between accessing memory and accessing an I/O
device. Clearly, this is advantageous from the perspective of
speed, but it uses up memory space in the system.
Instruction-based I/O: the CPU has specialized
instructions that perform the input and output. Although this
does not use memory space, it requires specific I/O
instructions, which implies it can be used only by CPUs that
can execute these specific instructions.
Interrupts play a very important part in I/O, because they
are an efficient way to notify the CPU that input or output is
available for us.
Interrupts
Important question:
How these components interact with the processor???
I/O requests.
Arithmetic errors (e.g., division by zero).
Arithmetic overflow.
Hardware malfunction (e.g., memory parity error).
Interrupts (continued)
Page faults.
Invalid instructions (usually resulting from pointer
issues).
The actions performed for each of these types of
interrupts (called interrupt handling) are very
different. Because telling the CPU that an I/O
request has finished is much different from
terminating a program because of division by zero.
Interrupts (continued)
2- Control lines
These lines indicate which device has permission to use the
bus and for what purpose (reading or writing from memory or
from an I/O device, for example).
They also transfer acknowledgments for bus requests,
interrupts.
3- Address lines
They indicate the location (in memory, for example) that the
data should be either read from or written to.
The power lines:
They provide the electrical power necessary.
Typical bus transactions include:
A) sending an address (for a read or write),
B) Sending the operation in control lines,
C) transferring data from memory to a register (a
memory read),
D) transferring data to the memory from a register (a
memory write).
19
Using three state buffers.
A bus system can be constructed with three-state
gates instead of multiplexers.
A three-state gate:
Is a digital circuit that exhibits three states. Two of
the states are signals equivalent to logic 1 and 0 as in
a conventional gate. The third state is a high-
impedance state.
The high-impedance state behaves like an open circuit,
which means that the output is disconnected and does
not have logic significance.
When the control input of the buffer is equal to 1,
the output is enabled and the gate behaves like any
conventional buffer, with the output equal to the
normal input.
When the control input is 0, the output is disabled
and the gate goes to a high-impedance state (Hi-Z),
regardless of the value in the normal input.
4 registers of 2 bits
Common bus using Tri-state buffer or (three state buffers)
22
23