Skip to main content

Programmed vs interrupt-driven vs DMA

Short answer

Programmed I/O has CPU polling each transfer through CPU registers, wasting time. Interrupt-driven I/O lets CPU do other work but still transfers each word via CPU with interrupt overhead. DMA moves blocks directly between device and memory with minimal CPU involvement after setup, providing highest speed.

Compare programmed I/O, interrupt driven I/O and direct memory access (DMA).

Programmed I/O

The CPU executes an I/O program and repeatedly tests the device status (polling) until the device is ready, then moves each word through a CPU register. The CPU is kept busy and no other work is done during the transfer.

Interrupt-driven I/O

The CPU starts the I/O and goes on with other work. When the device is ready, it raises an interrupt. The CPU saves its state, runs the service routine which transfers one word, and returns. No polling, but each word needs an interrupt, which has overhead.

Direct memory access (DMA)

A DMA controller moves a whole block directly between the device and memory. The CPU only initialises it and is interrupted at the end of the block.

Comparison

PointProgrammed I/OInterrupt-driven I/ODMA
CPU involvementFull, CPU polls the deviceCPU starts transfer, then serves interruptsCPU only sets up and handles final interrupt
CPU waitingBusy waitingNone while the device preparesNone during the transfer
Transfer pathDevice - CPU register - memoryDevice - CPU register - memoryDevice - memory directly
SpeedSlowestMediumFastest (block transfer)
HardwareSimpleInterrupt logic neededDMA controller needed
Suitable forSlow, simple devicesModerate-speed devices, keyboard, mouseFast devices, disk, network
Overhead per wordHigh (poll + transfer)High (save/restore context per interrupt)Very low (one setup per block)

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Organization and Architecture chapter 7 questions →