Page 255 -
P. 255
222 CHAPTER 7 / INPUT/OUTPUT
7.2 I/O MODULES
Module Function
The major functions or requirements for an I/O module fall into the following
categories:
• Control and timing
• Processor communication
• Device communication
• Data buffering
• Error detection
During any period of time, the processor may communicate with one or more
external devices in unpredictable patterns, depending on the program’s need for I/O.
The internal resources, such as main memory and the system bus, must be shared
among a number of activities, including data I/O. Thus, the I/O function includes a
control and timing requirement, to coordinate the flow of traffic between internal re-
sources and external devices. For example, the control of the transfer of data from an
external device to the processor might involve the following sequence of steps:
1. The processor interrogates the I/O module to check the status of the attached
device.
2. The I/O module returns the device status.
3. If the device is operational and ready to transmit, the processor requests the
transfer of data, by means of a command to the I/O module.
4. The I/O module obtains a unit of data (e.g.,8 or 16 bits) from the external device.
5. The data are transferred from the I/O module to the processor.
If the system employs a bus, then each of the interactions between the proces-
sor and the I/O module involves one or more bus arbitrations.
The preceding simplified scenario also illustrates that the I/O module must
communicate with the processor and with the external device. Processor communi-
cation involves the following:
• Command decoding: The I/O module accepts commands from the processor,
typically sent as signals on the control bus. For example, an I/O module for a
disk drive might accept the following commands: READ SECTOR, WRITE
SECTOR, SEEK track number, and SCAN record ID. The latter two com-
mands each include a parameter that is sent on the data bus.
• Data: Data are exchanged between the processor and the I/O module over the
data bus.
• Status reporting: Because peripherals are so slow, it is important to know the
status of the I/O module. For example, if an I/O module is asked to send data
to the processor (read), it may not be ready to do so because it is still working
on the previous I/O command. This fact can be reported with a status signal.

