Programmed I/O operations are the result of I/O instructions written in the computer program.

Each data item transfer is initiated by an instruction in the program. Usually, the transfer is to and from a CPU register and peripheral.

Other instructions are needed to transfer the data to and from CPU and memory.

 Transferring data under program control requires constant monitoring of the peripheral by the CPU.

Once a data transfer is initiated, the CPU is required to monitor the interface to see when a transfer can again be made.

It is up to the programmed instructions executed in the CPU to keep close tabs on everything that is taking place in the interface unit and the I/O device.

Figure: Data Transfer from I/O device to CPU

Figure: Flow-chart for CPU Program to input data

  1. Examples:
    • Reading data from a keyboard or a mouse where the CPU continuously polls the device for keypresses or mouse movements.
    • Writing data to a printer where the CPU initiates the print operation, checks the printer status, and transfers data in small chunks.
  2. Drawbacks:
    • Inefficiency: Programmed I/O can be inefficient, especially for high-speed devices or large data transfers, as it keeps the CPU busy and may lead to a waste of processing time.
    • Limited Concurrency: The CPU is dedicated to managing the I/O operation, limiting its ability to perform other tasks concurrently.




Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *