• Highest: 100
• Lowest: 45
• Average: 83
1
Chapter 7
Input/Output
Input/Output Problems
• Wide variety of peripherals
– Delivering different amounts of data
– At different speeds
– In different formats
• Slower than CPU and RAM
• Need I/O modules
Input/Output Module
Input/Output Module
• Interface to CPU and Memory
• Interface to one or more peripherals Generic Model of I/O Module
I/O Module Function
•
•
•
•
•
Control & Timing
CPU Communication
Device Communication
Data Buffering
Error Detection
I/O Module Diagram
I/O Steps
• CPU checks I/O module device status • I/O module returns status
• If ready, CPU requests data transfer • I/O module gets data from device
• I/O module transfers data to CPU
Input/Output Techniques
Input Output
Techniques
• Programmed
• Interrupt driven
• Direct Memory Access (DMA)
Programmed
Input/Output
Programmed I/O
• CPU has direct control over I/O
– Sensing status
– Read/write commands
– Transferring data
• CPU waits for I/O module to complete operation
• Wastes CPU time
Programmed I/O - detail
•
•
•
•
•
CPU requests I/O operation
I/O module performs operation
I/O module sets status bits
CPU checks status bits periodically
I/O module does not inform CPU directly • I/O module does not interrupt CPU
• CPU may wait or come back later
Example
• To increase efficiency for programmed I/O, the software could be written so that the processor periodically checks the status of the device. If the device is not ready, the processor can jump to other tasks. After some timed interval, the processor comes back to check status again. • Consider the above scheme for outputting data one character at a time to a printer that operates at 10 characters per second. What will happen if its status is scanned every
200ms?
15
I/O Commands
• CPU issues address
– Identifies module (if #device >1 per
module)