Unit 5 Input Output Organization
Unit 5 Input Output Organization
Unit 5 Input Output Organization
I/O Organization
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
+
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
(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