Chapter - 4 Input Output Systems: Click To Edit Master Subtitle Style
Chapter - 4 Input Output Systems: Click To Edit Master Subtitle Style
6/6/12
Wide variety of peripherals Delivering different data formats At different speeds either slow or fast Interface to processor and Memory Interface to one or more peripherals
6/6/12
22
6/6/12
33
External Devices
Screen, printer, keyboard magnetic disk, tape, sensors and actuators Modem Network Interface Card (NIC)
6/6/12
44
6/6/12
55
Control & Timing CPU Communication Device Communication Data Buffering Error Detection
6/6/12
66
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
6/6/12
77
Processor Communication
I/O module has to communicate with processor also Command decoding Data Status reporting Address recognition Must communicate with device also Commands Status information Data
88
Device communication:
6/6/12
Data buffering
Buffered in I/O module and then sent to peripheral devices In opposite direction also same Report errors to the processor. Mechanical and electrical malfunctions (paper jam, bad disk number) Changes in bit pattern Parity bits
Error detection
6/6/12
99
6/6/12
1010
Hide device properties to CPU Support multiple or single device Control device functions or leave for CPU
6/6/12
1111
6/6/12
1212
Programmed I/O
CPU waits for I/O module to complete operation Wastes CPU time
6/6/12
1313
Working
CPU issues command to I/O module I/O module performs operation I/O module sets status bits CPU checks status bits periodically I/O module does not inform CPU directly or interrupt it
6/6/12
1414
I/O Commands
Address of the I/O module External device An I/O command. Control - activate or telling module what to do Test - check status
Commands
6/6/12
6/6/12
1616
Each device given unique identifier CPU commands contain identifier (address)
6/6/12
1717
I/O Mapping
Devices and memory share an address space Treats data and status registers as memory locations No special commands for I/O
Isolated I/O
Separate address spaces Need I/O or memory select lines Special commands for I/O Limited set
6/6/12
1818
6/6/12
1919
Isolated I/O
6/6/12
2020
Overcomes CPU waiting No repeated CPU checking of device I/O module interrupts when ready
6/6/12
2121
Basic Operation
CPU issues read command I/O module gets data from peripheral while CPU does other work I/O module interrupts CPU CPU requests data I/O module transfers data
6/6/12
2222
6/6/12
2323
6/6/12
2424
6/6/12
2525
Design Issues
How the processor identifies that which module issued the interrupt? How does the processor deals with multiple interrupts?
6/6/12
2626
Limits number of devices CPU asks each module in turn Slow Interrupt Acknowledge sent down a chain Requested module responds by placing a word on data bus containing an identifier - vector Vectored interrupt
2727
Software poll
6/6/12
Bus arbitration
Uses vectored interrupt Module must claim the bus before it can raise interrupt One module can do Processor detects interrupt and acknowledges, the module places its vector
6/6/12
2828
Multiple Interrupts
Each line has its priority Polling determines priority Order of modules only current master can interrupt
Software polling
Daisy chain
Bus arbitration
6/6/12
2929
80x86 has one interrupt line only 80x86 based systems use 82C59A interrupt controller 82C59A has 8 interrupt lines
6/6/12
3030
Accepts interrupts from attached modules Determines priority Signals processor (raises INTR line) CPU Acknowledges (INTA line) Puts correct vector on data bus CPU processes interrupt
6/6/12
3131
6/6/12
3232
Interrupt modes
Fully nested
Ordered in priority from 0(IR0) to 7(IR7) Equal priority, then serviced one after other Take interrupts from certain devices only
Rotating
Special mask
6/6/12
3333
6/6/12
3434
6/6/12
3535
Transfer rate is limited Number of instructions must be executed for single I/O transfer Large volumes of data can be moved easily
DMA
6/6/12
3636
6/6/12
3737
DMA Operation
Read/Write Device address Starting address of memory block for data Amount of data to be transferred
CPU carries on with other work DMA controller deals with transfer
DMA controller sends interrupt when finished Processor is involved only at the starting and at end of transfer 6/6/12 3838
DMA controller takes over bus for a cycle Transfer of one word of data and returns control to the processor Not an interrupt
6/6/12
3939
6/6/12
4040
Single Bus, Detached DMA controller Each transfer uses bus twice
6/6/12
4141
Single Bus, Integrated DMA controller DMA may support more than one device Each transfer uses bus once
6/6/12
DMA to memory
4242
DMA to memory
6/6/12
Interfaces to 80x86 family and DRAM DMA module needs buses it sends HOLD signal to processor Processor responds HLDA then DMA can use buses Ex. transfer data from memory to disk
Device requests by pulling DREQ (DMA request) high DMA puts high on HRQ (hold request), CPU finishes present bus cycle and puts high on HDLA (hold acknowledge). HOLD remains active for duration of DMA 4444 6/6/12 DMA activates DACK (DMA acknowledge),
6/6/12
4545
DMA starts transfer DMA deactivates HRQ, giving bus back to CPU
While DMA using buses processor idle and while Processor using bus, DMA idle
Known as fly-by DMA controller Data does not pass through and is not stored in DMA chip
DMA only between I/O port and memory Not between two I/O ports or two memory locations
6/6/12 4646
CPU directly controls the peripherals I/O module programmed I/o I/O module interrupt DMA Processor on its own CPU initiates I/O module with memory
6/6/12
4747
6/6/12
4848
6/6/12
Byte multiplexor low speed devices Block multiplexor high speed devices
4949