Chapter 5: I/O Organization
5
I/O ORGANIZATION
Unit Structure
5.0 Objective
5.1 Introduction
5.1.1 Requirements of I/O System
5.1.2 I/O Interfacing Techniques
5.2 Programmed I/O
5.3 Interrupt Driven I/O
5.3.1 Interrupt Hardware
5.3.2 Enabling and Disabling Interrupts
5.3.3 Handling Multiple Devices
5.3.3.1 Vectored Interrupts
5.3.3.2 Interrupt Nesting
5.3.3.3 Interrupt Priority
5.4 Comparison between Programmed I/O and Interrupt Driven I/O
5.5 Direct Memory Access (DMA)
5.5.1 Hardware Controlled Data Transfer
5.5.2 DMA Idle Cycle
5.5.3 DMA Active Cycle
5.5.4 DMA Channels
5.5.5 Data Transfer Modes
5.6 Summary
65
,COMPUTER ORGANIZATION AND ARCHITECTURE
5.0 Objective
Describe input / output interface and devices
Explain the significance of I/O channels and processors
5.1 Introduction
The important components of any computer system are processor, memory, and
I/O devices (peripherals). The processor fetches instructions (opcodes and
operands/data) from memory, processes them and stores results in memory. The
other components of the computer system (I/O devices) may be loosely called the
Input/ Output system. The main function of I/O system is to transfer information
between processor or memory and the outside world.
The important point to be noted here is, I/O devices (peripherals) cannot be
connected directly to the system bus. The reasons are discussed here.
A variety of peripherals with different methods of operation are available. So
it would be impractical to incorporate the necessary logic within the
processor to control a range of devices.
The data transfer rate of peripherals is often much slower than that of the
memory or processor. So it is impractical to use the high speed system bus to
communicate directly with the peripherals.
Generally, the peripherals used in a computer system have different data
formats and word lengths than that of processor used in it.
So to overcome all these difficulties, it is necessary to use a module in between
system bus and peripherals, called I/O module or I/O system.
The Input /Output system has two major functions:
Interface to the processor and memory via the system bus,
Interface to one or more I/O devices by tailored data links
For clear understanding refer Figure 5.1, Links to peripheral devices are used to
exchange control, status and data between the I/O system and the external devices.
66
, Chapter 5: I/O Organization
An important point that is to be noted here is, an I/O system is not simply
mechanical connectors for connecting different devices required in the system to
the system bus.
Figure 5.1 Generic Model of computer system
It contains some logic for performing function of communication between the
peripheral (I/O device) and the bus. The I/O system must have an interface internal
to the computer (To the processor and memory) and an interface external to the
computer (to the external I/O devices).
5.1.1 Requirements of I/O System
The I/O system if nothing but the hardware required to connect an I/O device to the
bus. It is also called I/O interface. The major requirements of an I/O interface are:
1. Control and timing
2. Processor communication
3. Device communication
4. Data buffering
5. Error detection
All these requirements are explained here. The I/O interface includes a control and
timing requirements to co-ordinate the flow of traffic between internal resources
(memory system bus) and external devices. Processor communication involves
different types of signal transfers such as
67
, COMPUTER ORGANIZATION AND ARCHITECTURE
Processor sends commands to the I/O system which are generally the control
signals on the bus.
Exchange of data between the processor and the I/O interface over the data
bus.
The data transfer rate of peripherals is often much slower than that of the
processor. So it is necessary to check whether peripheral is ready or not for
data transfer. If not, processor must wait. So it is important to know the status
of I/O interface. The status signals such as BUSY, READY can be used for
this purpose.
A number of peripheral devices may be connected to the I/O interface. The
I/O interface controls the communication of each peripheral with processor.
So it must recognize one unique address for each peripheral connected to it.
The I/O interface must able to perform device communication which involves
commands,status information and data.
Data buffering is also an essential task of an I/O interface. Data transfer rates of
peripheral devices are quite high than that of processor and memory. The data
coming from memory or processor are sent to an I/O interface, buffered and then
sent to the peripheral device at its data rate. Also, data are buffered in I/O interface
so as not to tie up the memory in a slow transfer operation. Thus the I/O interface
must be able to operate at both peripheral and memory speeds.
I/O interface is also responsible for error detection and for reporting error detection
and for reporting errors to the processor. The different types of errors are
mechanical, electrical malfunctions reported by the device such as bad disk track,
unintentional changes to the bit pattern, transmission errors etc. To fulfill all these
requirements the important blocks necessary in any I/O interface are shown in
Figure 5.2.
68
5
I/O ORGANIZATION
Unit Structure
5.0 Objective
5.1 Introduction
5.1.1 Requirements of I/O System
5.1.2 I/O Interfacing Techniques
5.2 Programmed I/O
5.3 Interrupt Driven I/O
5.3.1 Interrupt Hardware
5.3.2 Enabling and Disabling Interrupts
5.3.3 Handling Multiple Devices
5.3.3.1 Vectored Interrupts
5.3.3.2 Interrupt Nesting
5.3.3.3 Interrupt Priority
5.4 Comparison between Programmed I/O and Interrupt Driven I/O
5.5 Direct Memory Access (DMA)
5.5.1 Hardware Controlled Data Transfer
5.5.2 DMA Idle Cycle
5.5.3 DMA Active Cycle
5.5.4 DMA Channels
5.5.5 Data Transfer Modes
5.6 Summary
65
,COMPUTER ORGANIZATION AND ARCHITECTURE
5.0 Objective
Describe input / output interface and devices
Explain the significance of I/O channels and processors
5.1 Introduction
The important components of any computer system are processor, memory, and
I/O devices (peripherals). The processor fetches instructions (opcodes and
operands/data) from memory, processes them and stores results in memory. The
other components of the computer system (I/O devices) may be loosely called the
Input/ Output system. The main function of I/O system is to transfer information
between processor or memory and the outside world.
The important point to be noted here is, I/O devices (peripherals) cannot be
connected directly to the system bus. The reasons are discussed here.
A variety of peripherals with different methods of operation are available. So
it would be impractical to incorporate the necessary logic within the
processor to control a range of devices.
The data transfer rate of peripherals is often much slower than that of the
memory or processor. So it is impractical to use the high speed system bus to
communicate directly with the peripherals.
Generally, the peripherals used in a computer system have different data
formats and word lengths than that of processor used in it.
So to overcome all these difficulties, it is necessary to use a module in between
system bus and peripherals, called I/O module or I/O system.
The Input /Output system has two major functions:
Interface to the processor and memory via the system bus,
Interface to one or more I/O devices by tailored data links
For clear understanding refer Figure 5.1, Links to peripheral devices are used to
exchange control, status and data between the I/O system and the external devices.
66
, Chapter 5: I/O Organization
An important point that is to be noted here is, an I/O system is not simply
mechanical connectors for connecting different devices required in the system to
the system bus.
Figure 5.1 Generic Model of computer system
It contains some logic for performing function of communication between the
peripheral (I/O device) and the bus. The I/O system must have an interface internal
to the computer (To the processor and memory) and an interface external to the
computer (to the external I/O devices).
5.1.1 Requirements of I/O System
The I/O system if nothing but the hardware required to connect an I/O device to the
bus. It is also called I/O interface. The major requirements of an I/O interface are:
1. Control and timing
2. Processor communication
3. Device communication
4. Data buffering
5. Error detection
All these requirements are explained here. The I/O interface includes a control and
timing requirements to co-ordinate the flow of traffic between internal resources
(memory system bus) and external devices. Processor communication involves
different types of signal transfers such as
67
, COMPUTER ORGANIZATION AND ARCHITECTURE
Processor sends commands to the I/O system which are generally the control
signals on the bus.
Exchange of data between the processor and the I/O interface over the data
bus.
The data transfer rate of peripherals is often much slower than that of the
processor. So it is necessary to check whether peripheral is ready or not for
data transfer. If not, processor must wait. So it is important to know the status
of I/O interface. The status signals such as BUSY, READY can be used for
this purpose.
A number of peripheral devices may be connected to the I/O interface. The
I/O interface controls the communication of each peripheral with processor.
So it must recognize one unique address for each peripheral connected to it.
The I/O interface must able to perform device communication which involves
commands,status information and data.
Data buffering is also an essential task of an I/O interface. Data transfer rates of
peripheral devices are quite high than that of processor and memory. The data
coming from memory or processor are sent to an I/O interface, buffered and then
sent to the peripheral device at its data rate. Also, data are buffered in I/O interface
so as not to tie up the memory in a slow transfer operation. Thus the I/O interface
must be able to operate at both peripheral and memory speeds.
I/O interface is also responsible for error detection and for reporting error detection
and for reporting errors to the processor. The different types of errors are
mechanical, electrical malfunctions reported by the device such as bad disk track,
unintentional changes to the bit pattern, transmission errors etc. To fulfill all these
requirements the important blocks necessary in any I/O interface are shown in
Figure 5.2.
68