Peripheral Devices and Input-Output Interface
What are Peripheral Devices? (In Simple Words)
A computer processor by itself is just a microscopic chip that crunches 0s and 1s.
To be useful to humans, it must connect to external hardware called Peripheral Devices (or I/O devices).
Common peripherals include:
- Input Devices: Keyboard, mouse, barcode scanner, microphone.
- Output Devices: Monitor screen, printer, speakers.
- Storage Devices (Secondary Memory): Solid-State Drives (SSD), Hard Disks (HDD), USB pen drives.
1. Why Can’t Peripherals Connect Directly to the CPU?
You cannot plug a keyboard or printer directly into the CPU’s internal system wires. Why? Because of three huge mismatches:
- Speed Mismatch:
The CPU operates in nanoseconds (billions of steps per second). Peripherals are electromechanical and operate in milliseconds (thousands of times slower). - Data Format Mismatch:
Peripherals send data serially (1 bit at a time over a cable), whereas the CPU processes 32-bit or 64-bit parallel words. - Signal Voltage Levels:
Peripherals use different electrical voltages (USB uses 5V; RS-232 uses ±12V), while modern CPUs operate at tiny voltages (1.2V to 3.3V).
An I/O Interface is a specialized hardware bridge chip that sits between the CPU and the device. It handles data buffering, converts serial signals to parallel, and adjusts voltage levels safely.
(Buffers, Decoders, Handshaking)
2. Isolated I/O vs. Memory-Mapped I/O
How does the CPU talk to an I/O device? There are two primary architectural methods:
Uses dedicated instructions (
IN, OUT).Uses regular memory instructions (
MOV, LDA).Detailed Comparison:
| Feature | Isolated I/O (Port-Mapped) | Memory-Mapped I/O |
|---|---|---|
| Address Space | Separate address spaces for RAM and I/O ports | Shared: A section of RAM addresses is reserved for I/O ports |
| Control Signals | Uses separate control wires (IOR, IOW vs. MEMR, MEMW) |
Uses standard memory control wires (READ, WRITE) |
| Instructions Used | Only special commands: IN port, OUT port |
All standard memory commands: MOV, LOAD, STORE, ADD |
| Addressing Modes | Very limited (only port numbers) | Rich (all CPU addressing modes can be used on I/O ports!) |
| Effect on RAM | Full RAM address space remains free for programs | Slightly reduces usable RAM space because I/O occupies addresses |
| Hardware Design | Needs extra decoding circuits | Simpler hardware decoding |
| Typical CPUs | Intel x86 architecture (Pentium, Core i3/i5/i7) | ARM (smartphones), MIPS, Apple Silicon |
💡 DAVV Exam Preparation Tips
5-Mark Question: “Why can peripheral devices not be connected directly to the CPU system bus? List three reasons.”
- Clearly list the 3 mismatches:
- Speed mismatch (nanoseconds vs milliseconds)
- Data format mismatch (parallel CPU vs serial devices)
- Voltage levels mismatch (1.2V CPU vs 5V USB / 12V serial)
- Explain how the I/O Interface chip resolves these differences.
10-Mark Question: “Explain Isolated I/O and Memory-Mapped I/O schemes in detail with address space diagrams, instruction examples, and a comparison table.”
- Draw side-by-side address space diagrams showing separate vs shared memory layouts.
- Give instruction examples:
- Isolated:
IN 80HandOUT 80H- Memory-Mapped:
MOV A, [5000H]andMOV [5000H], A- Provide the 6-point comparison table covering instructions, control lines, address space, and real-world processor examples.