CH07-COA9e
CH07-COA9e
William Stallings
Computer Organization
and Architecture
9th Edition
+
Chapter 7
Input/Output
+
Generic
Model
of an I/O
Module
+
External Devices
Provide a means of
Three categories:
exchanging data between Human readable
the external environment Suitable for communicating with
and the computer the computer user
Video display terminals (VDTs),
Attach to the computer by a printers
link to an I/O module
Machine readable
The link is used to exchange
control, status, and data
Suitable for communicating with
between the I/O module and equipment
the external device Magnetic disk and tape systems,
sensors and actuators
peripheral device Communication
An external device Suitable for communicating with
connected to an I/O module remote devices such as a
terminal, a machine readable
device, or another computer
+
External
Device
Block
Diagram
+ Most common means of
computer/user interaction
Keyboard/Monitor User provides input through
the keyboard
Module Function
flow of traffic
between internal
resources and
external devices
Processor
communicatio
Error detection n
• Detects and • Involves
reports command
transmission The major decoding, data,
errors status reporting,
functions for
address
an I/O recognition
module fall
into the
following
categories:
Device
Data buffering communicatio
• Performs the n
needed buffering
operation to • Involves
balance device commands,
and memory status
speeds information, and
data
I/O Module Structure
+
Programmed I/O
Three techniques are possible for I/O operations:
Programmed I/O
Data are exchanged between the processor and the I/O module
Processor executes a program that gives it direct control of the
I/O operation
When the processor issues a command it must wait until the I/O
operation is complete
If the processor is faster than the I/O module this is wasteful of
processor time
Interrupt-driven I/O
Processor issues an I/O command, continues to execute other
instructions, and is interrupted by the I/O module when the
latter has completed its work
Direct memory access (DMA)
The I/O module and main memory exchange data directly
without processor involvement
Table 7.1
I/O Techniques
+
+
I/O Commands
There are four types of I/O commands that an I/O module may
receive when it is addressed by a processor:
1) Control
- used to activate a peripheral and tell it what to do
2) Test
- used to test various status conditions associated with an I/O
module and its peripherals
3) Read
- causes the I/O module to obtain an item of data from the
peripheral and place it in an internal buffer
4) Write
- causes the I/O module to take an item of data from the data
bus and subsequently transmit that data item to the
peripheral
Three
Techniques
for Input of
a
Block of
Data
I/O Instructions
With programmed I/O there is a close correspondence between the I/O-
related instructions that the processor fetches from memory and the I/O
commands that the processor issues to an I/O module to execute the
instructions
Isolated I/O
Separate address spaces
Need I/O or memory select lines
Special commands for I/O
Limited set
Memory
Mapped
I/O
Isolated
I/O
+
Interrupt-Driven I/O
The problem with programmed I/O is that the
processor has to wait a long time for the I/O
module to be ready for either reception or
transmission of data
Simple Interrupt
Processing
+
Changes
in Memory
and Registers
for an
Interrupt
Design Issues
• Because there
will be multiple
I/O modules how
does the
Two design processor
determine which
issues arise device issued
in the interrupt?
implementin • If multiple
g interrupt interrupts have
I/O: occurred how
does the
processor decide
which one to
process?
+
Device Identification
Four general categories of techniques are in
common use:
Multiple interrupt lines
Between the processor and the I/O modules
Most straightforward approach to the problem
Consequently even if multiple lines are used, it is likely that each line will have
multiple I/O modules attached to it
Software poll
When processor detects an interrupt it branches to an interrupt-service routine whose
job is to poll each I/O module to determine which module caused the interrupt
Time consuming
Intel
82C59A
Interrupt
Controller
+ Intel 82C55A
Programmable Peripheral Interface
+
Keyboard/
Display
Interfaces to
82C55A
Drawbacks of Programmed and
Interrupt-Driven I/O
+
When large volumes of data are to be moved a
more efficient technique is direct memory access
(DMA)
+
Typical DMA
Module Diagram
DMA
DMA
+
DMA Operation
+
Alternative
DMA
Configurations
8237 DMA Usage of System Bus
+
Fly-By DMA Controller
E/D =
enable/disable
+
Evolution of the I/O Function
On small systems
(PCs, workstations)
typical point-to-point Are in effect external
point-to-point
links include those to buses
the keyboard, printer,
and external modem
Example is EIA-232
multiport
specification
+
Thunderbolt