Professional Documents
Culture Documents
William Stallings
Computer Organization
and Architecture
10th Edition
© 2016 Pearson Education, Inc., Hoboken,
NJ. All rights reserved.
+ Chapter 7
Input/Output
System
Data Lines Bus
Control Lines
I/O Module
Links to
peripheral
devices
Three
◼ Provide a means of
exchanging data between the categories:
external environment and the
computer ◼ Human readable
◼ Suitable for communicating with
the computer user
◼ Attach to the computer by a ◼ Video display terminals (VDTs),
link to an I/O module printers
◼ The link is used to exchange
control, status, and data
◼ Machine readable
between the I/O module and ◼ Suitable for communicating with
equipment
the external device
◼ Magnetic disk and tape systems,
sensors and actuators
◼ Peripheral device
◼ An external device connected ◼ Communication
to an I/O module ◼ Suitable for communicating with
remote devices such as a terminal,
a machine readable device, or
another computer
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Control Status Data bits
signals from signals to to and from
I/O module I/O module I/O module
Control Buffer
Logic
Transducer
Data (device-unique)
to and from
environment
Processor communication
• Involves command decoding, data, status reporting, address recognition
Device communication
• Involves commands, status information, and data
Data buffering
• Performs the needed buffering operation to balance device and memory speeds
Error detection
• Detects and reports transmission errors
Data
Data Registers External
Device
Data Status
Interface
Lines
Logic
Status/Control Registers Control
Address
Lines Data
External
I/O Device
Logic Status
Interface
Control Logic
Lines Control
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
No No
Done? Done?
Yes Yes
Next instruction Next instruction
(a) Programmed I/O (b) Interrupt-driven I/O
Figure 7.4 Three Techniques for Input of a Block of Data
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
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
Thus each I/O module There is a single address space for A single read line and a single write
must interpret the memory locations and I/O devices line are needed on the bus
address lines to
determine if the
command is for itself
◼ Isolated I/O
◼ Separate address spaces
◼ Need I/O or memory select lines
◼ Special commands for I/O
◼ Limited set
7 6 5 4 3 2 1 0
Keyboard input status
517
and control register
1 = ready Set to 1 to
0 = busy start read
Device controller or
other system hardware
issues an interrupt
Save remainder of
process state
information
Processor finishes
execution of current
instruction
Process interrupt
Processor signals
acknowledgment
of interrupt
Restore process state
information
Processor pushes PSW
and PC onto control
stack
Restore old PSW
and PC
Processor loads new
PC value based on
interrupt
Y Start Y Start
Interrupt General Interrupt General
Service Registers Service Registers
Y + L Return Routine T Y + L Return Routine T–M
Stack Stack
Pointer Pointer
Processor Processor
T–M T
N User's N User's
N+1 N+1
Program Program
Main Main
Memory Memory
◼ 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
Slave Master
82C59A 82C59A
interrupt interrupt 80386
controller controller processor
External device 08 IR0 IR0
External device 09 IR1 INT IR1 INT INTR
IR2 IR2
IR3 IR3
IR4 IR4
IR5 IR5
IR6 IR6
External device 15 IR7 IR7
Slave
82C59A
interrupt
controller
External device 56 IR0
External device 57 IR1 INT
IR2
IR3
IR4
IR5
IR6
External device 63 IR7
C4 Data ready
C5 Acknowledge
82C55A
B0 S0
B1 S1
B2 S2
B3 S3
OUTPUT DISPLAY
B4 S4
PORT
B5 S5
B6 Backspace
B7 Clear
C1 Data ready
C2 Acknowledge
C6 Blanking
C0 C7 Clear line
Interrupt
request
+
◼ When large volumes of data are to be moved a more
efficient technique is direct memory access (DMA)
Address
Address lines register
Request to DMA
Acknowledge from DMA
Control
Interrupt
logic
Read
Write
Instruction Cycle
DMA Interrupt
Breakpoints Breakpoint
I/O
I/O I/O
System bus
I/O bus
Data bus
DREQ
HRQ
8237 DMA Main Disk
chip memory controller
HLDA DACK
Address bus
◼ Network Wi-Fi devices that handle 3.2 Gbps and 6.76 Gbps
are becoming widely available and producing demand on
enterprise systems
The lowest, or link, level protocol is typically Ethernet, so that each arriving and departing block of
data consists of an Ethernet packet containing as payload the higher-level protocol packet
The higher-level protocols are usually the Internet Protocol (IP), operating on top of Ethernet and
the Transmission Control Protocol (TCP), operating on top of IP
The Ethernet payload consists of a block of data with a TCP header and an IP header
For outgoing data, Ethernet packets are formed in a peripheral component, such as in I/O controller
or network interface controller (NIC)
For incoming traffic, the I/O controller strips off the Ethernet information and delivers the TCP/IP packet to
the host CPU
Incoming
Outgoing
◼ Packet arrives
◼ Packet transfer requested
◼ DMA
◼ Packet created
◼ NIC interrupts host
◼ Output operation invoked
◼ Retrieve descriptors and
headers ◼ DMA transfer
◼ Cache miss occurs ◼ NIC signals completion
◼ Header is processed
◼ Driver frees buffer
◼ Payload transferred
(a) Selector
Data and
address channel
to main memory
Multi-
plexor
channel
Control signal
path to CPU I/O
Controller
I/O
Controller
I/O
Controller
I/O
Controller
(b) Multiplexor
◼ Objective was to meet the increasing demands for high I/O rates while
avoiding the bulky and expensive I/O channel technologies developed
for mainframe and supercomputer systems
PU PU PU PU PU PU PU PU PU PU PU PU
Channels Ports