CA_lecture_6
CA_lecture_6
Lecture 6.
. Input/Output.
Instructors
3
Input/Output Module
5
I/O Module Function
6
Device Communication
7
Error Detection and Reporting
8
Typical I/O Control Steps
9
I/O Module Decisions
10
Terminology
11
Input Output Techniques
• Programmed I/O.
o CPU controls the entire
process.
o Can waste CPU time.
• Interrupt driven.
o Processor issues command.
o Device proceeds and leaves
processor free.
• Direct Memory Access (DMA).
o Device exchanges data
directly with memory.
12
Programmed I/O
• CPU has direct control over I/O: • CPU requests I/O operation.
– Sensing status. • I/O module performs operation.
– Read/write commands. • I/O module sets status bits.
• CPU checks status bits periodically.
– Transferring data. • I/O module does not inform CPU
• CPU waits for I/O module to complete directly.
operation. • I/O module does not interrupt CPU.
• Wastes CPU time. • CPU may wait or come back later.
13
Types of I/O Commands
14
Addressing I/O Devices
15
I/O Mapping
16
I/O Mapping
17
Interrupt Driven I/O
Basic Operation
• Overcomes CPU waiting and preventing
that to happen.
• No repeated CPU checking of device.
• I/O module interrupts when ready.
18
CPU Viewpoint
19
Identifying Interrupting Module
20
Multiple Interrupts
21
Direct Memory Access
• Interrupt driven and programmed I/O require active CPU
intervention.
– Transfer rate is limited.
– CPU is tied up.
• DMA is the answer.
22
DMA Operation
23
DMA Transfer Cycle Stealing
• DMA controller takes over bus for a cycle.
• Transfer of one word of data.
• Not an interrupt.
– CPU does not switch context.
• CPU suspended just before it accesses bus.
– i.e. before an operand or data fetch or a data write.
• Slows down CPU but not as much as CPU doing transfer.
24
DMA Configurations
26
I/O Channels
27
Evolution of the I/O Function
1.The CPU directly controls a peripheral 4.The I/O module is given direct access to memory
device. via DMA. It can now move a block of data to or
2.A controller or I/O module is added. from memory without involving the CPU, except
The CPU uses programmed I/O at the beginning and end of the transfer.
without interrupts. 5.The I/O module is enhanced to become a
3.Same configuration as in step 2 is processor in its own right, with a specialized
used, but now interrupts are
instruction set tailored for I/O
employed. The CPU need not spend
time waiting for an I/O operation to 6.The I/O module has a local memory of its own
be performed, thus increasing and is, in fact, a computer in its own right. With
efficiency. this architecture a large set of I/O devices can be
controlled with minimal CPU involvement.
28
Conclusion
29