---
title: "DMA vs programmed and interrupt-driven I/O"
subject: "Computer Organization and Architecture"
chapter: 7
key: "semester_5/computer_organization_and_architecture:dma-overcomes"
source: https://www.bctengineer.com/q/semester_5/computer_organization_and_architecture/dma-overcomes
site: BCT Engineering
---

# DMA vs programmed and interrupt-driven I/O

Computer Organization and Architecture · Chapter 7: Input-Output Organization

- Asked in: 2078 Kartik, 4 marks; 2071 Chaitra, 6 marks; 2070 Chaitra, 5 marks (asked 3 times)
- Video: [23. Input Output Techniques- Programmed I/O, Interrupt I/O, DMA | Riday Sir](https://www.youtube.com/watch?v=Ys2uguQkZVI) — STUDY SQUARE
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/computer_organization_and_architecture/dma-overcomes
- Whole chapter: https://www.bctengineer.com/md/semester_5/computer_organization_and_architecture/chapter-7

## Question

How does DMA overcome the problems of programmed I/O and interrupt-driven I/O? How is DMA different from programmed I/O?

## Short answer

DMA avoids CPU busy-waiting and per‑word interrupts by letting a controller transfer a whole block directly between device and memory, interrupting only at completion. Unlike programmed I/O where the CPU moves each word through its registers, DMA moves data directly, making it faster and freeing the CPU for other tasks.

## Answer

#### Problems of the older methods
- **Programmed I/O:** the CPU is busy-waiting in a polling loop and wastes time; transfer speed is limited by the CPU.
- **Interrupt-driven I/O:** the CPU avoids waiting, but every word needs an interrupt with saving and restoring of context, and every word goes through the CPU. This is unsuitable for fast devices or large blocks.

#### How DMA overcomes these problems
- The CPU only sets up the controller (address, count, direction). The controller then moves the whole block directly between device and memory, so no CPU register is involved.
- No polling and no per-word interrupt; the CPU gets one interrupt at the end of the block.
- The CPU can do useful work in parallel, since the controller takes the bus only for the transfer cycles (cycle stealing or burst).
- High data rate, since the transfer is limited by memory speed, not by the instruction execution time.

#### Difference between DMA and programmed I/O
| Point | DMA | Programmed I/O |
|---|---|---|
| Who transfers data | DMA controller | CPU |
| CPU role | Only initialises and handles the end interrupt | Executes the transfer loop |
| Path | Device to memory directly | Device - CPU register - memory |
| Speed | Fast, block transfer | Slow, word by word |
| Hardware | Needs DMA controller | Simple |
| CPU utilisation | High, CPU free | Low, busy waiting |

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What is the main problem of programmed I/O?
   A. It needs an interrupt for every word
   B. It needs a DMA controller
   C. The CPU busy-waits in a polling loop and wastes time
   D. It cannot transfer data to memory
   Answer: C. In programmed I/O the CPU keeps polling the device status, so its time is wasted and the speed is limited by the CPU. (Key point: Problem of programmed I/O)

2. During a DMA block transfer, what does the CPU do?
   A. Only sets up address, count and direction, then is interrupted once at the end
   B. Moves each word through its registers
   C. Stays idle until the transfer ends
   D. Handles an interrupt for each word
   Answer: A. The CPU only initialises the controller; the controller moves the whole block directly and interrupts the CPU once at the end, so the CPU can do other work. (Key point: DMA transfer)

3. Why is interrupt-driven I/O unsuitable for fast devices or large blocks?
   A. Every word needs an interrupt with context save/restore and passes through the CPU
   B. It needs more than one CPU
   C. It needs the CPU to poll continuously
   D. It cannot use memory
   Answer: A. Per-word interrupts with context saving and CPU involvement make it too slow for large or fast transfers. (Key point: Interrupt-driven I/O drawback)

4. What is the data path in DMA compared with programmed I/O?
   A. DMA: device to memory directly; programmed: device-CPU register-memory
   B. Both go directly to memory
   C. DMA: device-CPU register-memory; programmed: device-memory directly
   D. Both go through the CPU register
   Answer: A. DMA moves data directly between device and memory; programmed I/O passes every word through a CPU register. (Key point: DMA vs programmed I/O path)

## Related in Computer Organization and Architecture

- [Programmed vs interrupt-driven vs DMA](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Aio-techniques-compare) — Computer Organization and Architecture, chapter 7, asked 5×

## Related in other subjects

- [Interrupt-driven I/O with vectored interrupt](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Avectored-interrupt-io-flow) — Embedded System, chapter 5, asked 3×
- [Compare status check I/O, interrupt I/O and DMA](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Acompare-status-interrupt-dma) — Instrumentation II, chapter 1
- [Programmed I/O, DMA, device-independent software](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Aprogrammed-io-dma-device-independent) — Operating System, chapter 6
- [Programmed I/O disadvantages; DMA](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Aprogrammed-io-disadvantages-dma) — Operating System, chapter 6
