You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
This lesson covers how the processor communicates with peripheral devices — keyboards, displays, storage, sensors, and more. At A-Level you must understand I/O techniques, the role of device drivers, and how data is transferred between the CPU and peripherals.
Every peripheral device connects to the CPU through an I/O port managed by a device controller (or I/O controller). The device controller:
┌─────┐ ┌──────────────┐ ┌──────────────┐
│ CPU │ ──→ │ Device │ ──→ │ Peripheral │
│ │ ←── │ Controller │ ←── │ Device │
└─────┘ └──────────────┘ └──────────────┘
System Bus Device-specific signals
The CPU continuously checks (polls) the device's status register to see if data is available or if the device is ready.
| Step | Action |
|---|---|
| 1 | CPU sends a request to the device controller. |
| 2 | CPU repeatedly reads the status register in a loop. |
| 3 | When the status register indicates "ready", the CPU reads or writes data via the data register. |
Advantages:
Disadvantages:
Instead of polling, the device sends an interrupt signal to the CPU when it is ready. The CPU can perform other tasks while waiting.
| Step | Action |
|---|---|
| 1 | CPU sends a request to the device and continues executing other instructions. |
| 2 | When the device is ready, it sends an interrupt signal along the control bus. |
| 3 | The CPU pauses its current task, saves its state (pushes registers onto the stack). |
| 4 | The CPU executes the Interrupt Service Routine (ISR) to handle the data transfer. |
| 5 | The CPU restores its state and resumes the original task. |
Advantages:
Disadvantages:
For high-speed, bulk data transfers (e.g. reading from a hard disk or network card), neither polling nor simple interrupts are efficient enough. DMA allows a dedicated DMA controller to transfer data directly between the device and main memory, without involving the CPU for each byte.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.