Courses / Computer Science I
Introduction to Computers

Input-Output and Peripheral Communication

Computer Science I 218 words Free to read

Peripheral Communication

A CPU on its own is deaf and mute; input/output (I/O) is how it communicates with keyboards, disks, networks, and displays. Because these devices operate on their own slower schedules, the system needs disciplined ways to coordinate.

The simplest method is polling (programmed I/O), where the CPU repeatedly asks a device in a loop if it is ready yet. While simple, polling wastes valuable CPU cycles through busy-waiting, doing no useful work while waiting.

I/O MethodCPU InvolvementBest Used For
Polling100% busy-waitTrivial or timing-critical tasks
InterruptsPauses only to handle eventsGeneral asynchronous devices
DMAInterrupted only at the endLarge blocks of bulk data
A busy-wait loop that never once produces useful work

Interrupts and DMA

To avoid wasting cycles, we use interrupts. The CPU issues a request and continues other work until the device sends an interrupt signal, prompting the CPU to run an interrupt handler.

For bulk data transfers, direct memory access (DMA) is used. A dedicated DMA controller moves data between devices and main memory without the CPU handling every single byte.

Common pitfall: Assuming polling is better because it is simpler. Polling wastes CPU cycles; use interrupts or DMA for efficiency.

Practise this lesson

The explanation above is free to read. The graded practice for this lesson lives in the Tryals app.

11practice questions
2interactive scenes

Introduction to Computers