Navi

INPUT/OUTPUT TECHNIQUES


There are 3 type of I/O techniques:
i)   Programmed
ii)  Interrupt driven
iii) Direct Memory Access (DMA)


i) Programmed I/O; here, data is exchanged between the processor and the I/O module. The CPU has direct control over the I/O. programmed I/o wastes CPU time.

Programmed I/O detail:
o  CPU requests I/O operation
o  I/O module performs operation
o  I/O module sets status bits
o  CPU checks status bits periodically
o  I/O module does not inform CPU directly
o  I/O module does not interrupt CPU
o  CPU may wait or come back later.

With programmed I/O, lots of CPU time is wasted in polling because processors are faster than I/O devices. This results into CPU inefficient usage. This means that the programmed I/O is suitable for lower performance.



ii) Interrupt Driven I/O;
o  This overcomes CPU waiting
o  There is no repeated CPU checking of devices
o  I/O module interrupts when ready
Interrupt driven I/O basic operation
This is the order in which the interrupt driven i/O carries out its commands step by step.
·       CPU issues read command
·       I/O module gets data from peripherals while CPU does some other work.
·       I/O module interrupts CPU
·       CPU requests data
·       I/O module transfers data
Viewpoint:
v Issue read command
v Do other work
v Check for interrupt at the end of each instruction cycle
v If interrupted




I/O Commands
There are four types of I/O commands that an I/O module may receive when it is addressed by a processor. They include the following;
ü Control. This is used to activate a peripheral and tell it what to do. Instructions like stop, rewind, forward, etc.
ü Test. This is used to try out various conditions associated with an I/O module and its peripherals.
ü Read. This enables the I/O to obtain an item of data from the peripheral and place it in an internal buffer
ü Write. This enables the I/O to take an item of data from the data bus and subsequently transmit that data item to the peripheral

Interrupt I/O is more efficient than programmed I/O because it needs less waiting as compared to programmed I/O. however, interrupt I/O still consumes more processor time because data transfer from memory to I/O module to memory must pass through the processor.
Problems Faced by programmed I/O and Interrupt Driven I/O :
a.   The I/O transfer rate is limited by the speed with which the processor can test and service a device.
b.   The processor is tied up in managing an I/O transfer. A number of instructions must be executed for each I/O transfer.

iii) Direct Memory Access(DMA)
With direct memory access, large amounts of data can be transferred between memory and the peripherals which greatly improves CPU performance.
DMA OPERATIONS.
vCPU tells DMA controller
§  Read/write
§  Device address
§  Starting address of memory block for data
§  Amount of data to be transferred
vCPU carries on with other tasks/work
vDMA controller deals with transfer
vDMA controller sends interrupt when finished



0 comments: