You are on page 1of 3

NetPro Certification Courseware for NetPro Certified Systems Engineer – N.C.S.

INPUT/ OUTPUT TECHNIQUES

Data transfer means moving a certain number of bytes from input device from
memory, or from memory to output device. There are three techniques of data
transfer:

1. Programmed mode
2. Interrupt mode
3. DMA mode.

Programmed Mode
In this method, the CPU is totally in charge of data transfer. It first transfers a
data byte from the memory to the CPU and then sends it to the device. The CPU for
every data byte does these actions, with appropriate instructions in the program. The
functions to be performed by the program for an output device are:

1. Checking whether the device is powered ON.


2. Reading device status.
3. Checking if the device is ready.
4. Reading data from the device.
5. Storing data in memory.
6. Checking whether the device is ready with the next byte of data transfer.
7. If ready , repeating steps 4 to 6.
8. If not ready, loop on step 6.

The operations for an output device are similar except for the direction of data
transfer. The CPU is totally dedicated for the data transfer. If the input or the output
device is a slow device, the CPU time is wasted. The programmed mode is also
known Polling.
NetPro Certification Courseware for NetPro Certified Systems Engineer – N.C.S.E

Memory

Ready
2 Data

1 status
Printer Printer
CPU Controller
3 Data

Steps 1.Reading device status. 2. Moving data from memory


3. Sending data to device

Interrupt Mode
In this method the CPU does data transfer, but is relieved from the task of checking
whether the device is ready with the data byte, in the case of an input device. As soon
as the CPU does one byte of data transfer, it is free till the device is ready is ready
with the next byte. Hence it can start executing the program. Whenever the device is
ready with the next byte and it raises an interrupt to the CPU, the CPU transfers one
more byte and again it goes back to non-i.o. program execution. This process
continues till all data bytes are transferred. The program is organized into I/O
routines and Non I/O routines. The I/O program is the interrupt service routine. The
CPU in effect multiplexes between an I/O program and a Non I/O program. It is not
tied up with unproductive operations, and is therefore utilized better.

Memory

2 Printer
CPU Printer
3 Controller

5
NetPro Certification Courseware for NetPro Certified Systems Engineer – N.C.S.E

Steps:

1. Giving commands.
2. Servicing interrupts.
3. Reading status.
4. Moving data from memory.
5. Sending data to device.

DMA Mode
In this mode the CPU doesn’t perform data transfer. Instead the DMA controller does
the data transfer. The CPU only supplies the DMA parameters to the DMA controller.
These parameters are:

1. Start Address: Memory address from where data transfer has to be started.
2. Byte Count: Number of data bytes to be transferred.
3. Direction: Direction of data transfer.
4. Device: I/O device to be involved in the data transfer.

The program has to give an appropriate command to the device controller, in addition
to supplying DAM with parameters to the DMA controller. Once the CPU initializes
the DMA controller with the DMA parameters, the CPU is free to do instruction
processing. The DMA controller does the data transfer every time the device
controller raises a DMA request. Once all bytes are transferred, the DMA controller
terminates the data transfer and the device controller raises an interrupt to the CPU.
Now the CPU understands the data transfer is complete.

Read/ Write command


to I/O controller.

DMA parameters to
DMA controller.
I/O controller

‘ Last
Continue with other Byte’
routines Signal
Interrupt (End on I/O operation

You might also like