Understanding I/O Techniques: Programmed, Interrupt & DMA

Data Transfer Modes with Peripherals

Data transfer to and from peripherals can be handled in three ways:

  1. Programmed I/O
  2. Interrupt-Initiated I/O
  3. Direct Memory Access (DMA)

Programmed I/O

This method relies on I/O instructions within a computer program. Each data transfer is initiated by a specific instruction, typically moving data between a CPU register and memory. Programmed I/O requires the CPU to constantly monitor peripheral devices.

Interrupt-Initiated I/O

This technique utilizes interrupts and commands to signal the interface when data is ready from a device. The CPU can execute other programs while the interface monitors the device. When the device is ready, the interface sends an interrupt request to the CPU. The CPU temporarily pauses its current task, processes the I/O transfer using a service program, and then resumes its original task.

Direct Memory Access (DMA)

DMA addresses the speed limitations of CPU-mediated data transfers between fast storage (like magnetic disks) and memory. DMA allows peripherals to communicate directly using memory buses, bypassing the CPU. This method is particularly useful for high-speed data transfers.

DMA Controller

A DMA controller typically includes:

  • Two data registers (ports)
  • A control register
  • A status register
  • Bus buffers
  • Timing and control circuits

The interface interacts with the CPU via the data bus. Chip select and register select inputs determine the interface’s address. I/O read and write lines control data direction. The registers communicate with the connected I/O device. Commands are sent to the device through the interface register, and the control register receives instructions from the CPU.