Subtopic 2 of 8
9.2Programmed I/O (polling)
The idea
In programmed I/O the CPU keeps asking the device "ready yet?" (polling) until it is, then transfers the data itself.
Think of it like this: Standing at the oven door asking every second if the cake is done.
Why it exists
Simplest scheme, but the CPU does nothing useful while waiting.
How it works
- CPU reads the device status register.
- If not ready, loop again (busy wait).
- When ready, CPU reads/writes the data register.
- Every word passes through the CPU.
Worked example: Slow device
If the device takes 5 cycles, the CPU wastes 5 cycles looping.
Now play with it
- →Press Play and count the red "poll" cells.
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |
|---|---|---|---|---|---|---|---|---|
| CPU | poll | poll | poll | poll | poll | xfer | work | work |
| Device | busy | busy | busy | busy | busy | ready |
The CPU does nothing useful while the device is busy: it just loops reading the status register (busy-wait).
Check yourself
The main drawback of polling is:
Remember: Polling: simple, wasteful.
Exam notes (the dense version)
CPU loops checking status. Simple but wastes CPU (busy-wait).
Previous year questions: I/O Interface, Interrupts & DMA (8)
PYQs are grouped by topic, so this is the full set for I/O Interface, Interrupts & DMA; try the ones that match this subtopic. Open all 8 on the topic page.