Professional Documents
Culture Documents
INPUT/OUTPUT UNIT
1
OUTLINE
Introduction
Input/output Modules
I/O Module Function
I/O Module Structure
Input/output Techniques
Programmed I/O
Interrupt Driven I/O
Direct Memory Access (DMA)
2
INTRODUCTION
I/O modules
Third key element of a computer system, next to processor
and memory
Interfaces to a system bus and controls one or more peripheral
devices.
Contains logic/intelligence
To perform communication function b/n the peripherals and the bus
3
INTRODUCTION…
5
INTRODUCTION…
External devices
Used to accomplish I/O operations
Provides a means of exchanging data between
External environment
Computer
Communication devices
Allow the computer to exchange data with a remote device
E.g., Modem, Network Interface Card (NIC)
7
I/O MODULE FUNCTION
8
I/O MODULE STRUCTURE
A block diagram of an I/O module
9
I/O MODULE STRUCTURE…
Module connects to the rest of the computer through a set of signal lines –
system bus
Data transferred to and from the module are buffered in one or more data registers
Status information provided through status registers
Status registers may also function as control registers, to accept detailed control information
from the processor
Module logic interacts with processor via a set of control signal lines
Processor uses control signal lines to issue commands to the I/O module
Some of the control lines may be used by the I/O module, for arbitration and status signals
Module must recognize and generate addresses for devices it controls
The I/O module contains logic specific to the interface with each device that it 10
controls
INPUT OUTPUT TECHNIQUES
Three techniques exist for I/O operations:
Programmed I/O
The processor issues an I/O command to the I/O module and
waits until the I/O operation is complete
If the processor is faster than the I/O module, it wastes processor time
12
INTERRUPT DRIVEN I/O…
Overview of Interrupt Driven I/O
The CPU issues an I/O command to the I/O module, and then
continue to do some other useful work
The I/O module will interrupt the processor to request service
when it is ready to exchange data with the processor
The processor executes the data transfer and then resumes its
former processing
14
INTERRUPT DRIVEN I/O…
CPU Viewpoint (for input)
Issue read command
Do other work
Check for interrupt at end of each instruction cycle
If interrupted:
Save context (registers) of the current program
Process the interrupt
Read a data from the I/O module and store it in memory
16
DIRECT MEMORY ACCESS…
The need for Direct Memory Access
Interrupt driven I/O efficient than programmed I/O
But both, interrupt driven and programmed I/O,
require active CPU intervention
Any data transfer traverses a path through the processor
Both forms of I/O suffer from two inherent drawbacks
I/O transfer rate is limited by speed of the processor to test and
service a device
CPU is tied up in managing an I/O transfer
A no of instructions must be executed for each I/O
transfer
17
DMA is the solution
More efficient technique to move large blocks of data
DIRECT MEMORY ACCESS…
DMA Function
DMA involves an additional module on the
system bus
DMA module/controller
19
DIRECT MEMORY ACCESS…
DMA Operation
When the processor wants to read/write a block of data. It tells the
DMA controller the following information:
Whether Read/Write is requested
Using the read/write control line b/n the processor and the DMA
module
The address of the I/O device involved
Communicated over data bus
Starting location in memory to read from or write to
Communicated over data lines and stored by the DMA in its data
register
Amount of data to be transferred
Communicated via data lines and stored in the data count register
DIRECT MEMORY ACCESS…
DMA Operation…
CPU carries on with other work
DMA controller deals with transfer
DMA controller sends interrupt when finished
The processor is involved only
At the beginning
At end of the transfer
DIRECT MEMORY ACCESS…
DMA Transfer Cycle Stealing
DMA controller takes over bus for a cycle
Transfer one word of data
Not an interrupt
CPU does not switch context
of
e
r
En Co
d u
of rs
Se e
m
es
te
r
22