CA-08: Input/Output Overview — VLSI Trainers
VLSI Trainers CA Series · 8 / 12
Computer Architecture · Article 8 of 12

CA-08: Input / Output Overview

Why a dedicated I/O module is necessary, how external devices are classified, the five functions of an I/O module, I/O commands, and the two addressing schemes — memory-mapped and isolated I/O. The foundation for understanding the three I/O techniques in CA-09.

🔌Why I/O Modules Are Necessary

The third key element of a computer system — alongside CPU and memory — is the set of I/O modules. Each I/O module sits between the system bus and one or more external peripheral devices, acting as an intermediary that bridges the two worlds.

Why not connect peripherals directly to the system bus? Four compelling reasons make this impractical:

#ProblemExplanation
1Variety of devicesThere are hundreds of peripheral types with completely different operating principles. Incorporating control logic for all of them directly in the CPU would make it impossibly complex.
2Speed mismatchPeripherals are orders of magnitude slower than the CPU and system bus. A keyboard generates a byte every ~100 ms; a CPU executes ~10⁹ instructions per second. Tying the high-speed bus to a slow device would stall all other components.
3Data format mismatchPeripherals use different word lengths, encoding formats, and voltage levels than the computer. Serial devices (UART, USB, SPI) send one bit at a time while the CPU works with 32 or 64-bit words simultaneously.
4Error and status managementPeripherals generate error conditions (paper jam, bad sector, CRC error, cable disconnected) that require detection and reporting. Without a dedicated module, the CPU would need to poll every device constantly.
The I/O module’s dual role: Every I/O module has two interfaces — an internal interface to the CPU and memory (via the system bus) and an external interface to one or more peripheral devices (using device-specific signalling). The module translates between these two worlds in both directions.

🖥️External Device Classification

External devices (peripherals) are broadly classified into three categories based on their communication partner and purpose:

Figure 1 — Classification of external devices
Human-Readable Communicates with the user 🖥️ Video display / monitor ⌨️ Keyboard 🖨️ Printer 🖱️ Mouse / trackpad 🎙️ Microphone / speakers 📷 Camera / scanner → data rate: 0.01–30,000 KB/s Machine-Readable Communicates with equipment 💾 Magnetic disk / SSD 📼 Magnetic tape 💿 Optical disc (CD, DVD) 🔬 Sensors (temp, pressure) 🤖 Actuators / robots 📟 Bar-code scanners → data rate: 200–2,000 KB/s Communication Communicates with remote devices 📡 Modem (PSTN) 🌐 Network interface card (NIC) 📶 Wi-Fi / Bluetooth adapter 🔗 Serial port (UART, RS-232) 🔌 USB host controller ⚡ PCIe / Thunderbolt → data rate: 0.05–200 KB/s (varies) vlsitrainers.com

Three categories of external devices. Human-readable devices interact with users. Machine-readable devices interact with other hardware (storage, sensors, actuators). Communication devices exchange data with remote systems. Data rates span six orders of magnitude — from a keyboard (10 bytes/s) to a display frame buffer (30 GB/s).

🔧External Device Block Diagram

Every external device, regardless of type, contains the same fundamental internal structure:

Figure 2 — Internal structure of an external device
I/O Module (in computer) Control Status Data bits (to & from) External Device Control Logic interprets commands reports status Data Buffer speed matching Transducer physical ↔ electrical conversion Environment physical world (keystrokes, disk surface, light, sound, network) physical signal vlsitrainers.com

Internal structure of any external device. The Control Logic receives commands from the I/O module, reports device status, and manages the data buffer. The Transducer converts between the digital electrical signals inside the device and the physical phenomenon in the environment. The data buffer absorbs speed mismatches.

Keyboard example — how a keystroke becomes data

  1. Mechanical key closure generates an electrical signal in the transducer (key switch matrix)
  2. Control logic identifies which key was pressed
  3. Controller translates to ASCII code: ‘K’ = 0x4B = 0100 1011
  4. ASCII byte placed in the keyboard’s data buffer
  5. Keyboard signals the I/O module (IRQ or status bit set)
  6. I/O module reads the byte and either stores it or generates an interrupt to the CPU

⚙️The I/O Module

The I/O module sits permanently on the system bus, connecting the computer’s internal world (CPU and memory) to the external world (peripheral devices). It is not a passive connector — it contains active logic that manages communication in both directions.

Figure 3 — I/O module in system context: interfaces to CPU/memory bus and to peripheral devices
SYSTEM BUS — Address Lines · Data Lines · Control Lines CPU Memory I/O Module 1 Control Status Data buffer I/O Module 2 Control Status Data buffer 🖨️ Printer ⌨️ Keyboard 💾 Disk 🌐 NIC I/O Module has TWO interfaces: ① Internal interface — to system bus (address/data/control lines) ② External interface — device-specific links (serial, parallel, SCSI, SATA…) vlsitrainers.com

System-level view. I/O Module 1 controls a printer and keyboard; I/O Module 2 controls a disk and network card. Each module contains Control, Status, and Data buffer registers visible to the CPU via the system bus. Each I/O module has a unique address on the bus so the CPU can target commands to specific devices.

📋Five I/O Module Functions

An I/O module performs five major functions:

#FunctionWhat it doesWhy it matters
1Control & TimingCoordinates data flow between CPU/memory resources and peripheral devices. Arbitrates between competing requests. Manages the sequence of I/O operations.CPU only issues high-level commands — the I/O module handles all the detailed timing and sequencing with the slow device.
2CPU CommunicationResponds to CPU commands (read, write, test). Reports status via BUSY/READY/ERROR signals. Recognises its own address on the address bus.CPU can check device readiness or issue commands without needing to know the device’s internal workings.
3Device CommunicationSends commands to the peripheral. Receives status information. Exchanges data using device-specific protocols (serial bit stream, parallel byte, SCSI commands, etc.).CPU is completely isolated from device-specific protocols — it never handles serial-to-parallel conversion, SCSI commands, or analog signals.
4Data BufferingTemporarily stores data moving in both directions. Accepts fast bursts from memory and feeds them slowly to the printer; buffers slow trickles from keyboard and delivers them efficiently to memory.Without buffering, either the fast device (memory bus) would stall waiting for the slow device, or data would be lost.
5Error DetectionDetects mechanical failures (paper jam, bad disk sector, cable disconnect) and transmission errors (parity errors). Reports errors to CPU via status register.Error handling is centralised in the I/O module — CPU does not need polling logic for every possible error condition on every device.

Detailed I/O sequence — 5-step exchange

  1. CPU reads the I/O module’s status register to check if the device is ready
  2. I/O module returns the device status (READY, BUSY, or ERROR)
  3. If READY, CPU issues a READ command to the I/O module via the control bus
  4. I/O module obtains the data from the external device (this may take many CPU cycles)
  5. I/O module places data in its data register; CPU reads it via the data bus
This 5-step exchange is the basis of programmed I/O (polling). The CPU blocks at step 1, repeatedly reading the status register until READY. CA-09 covers how interrupt-driven I/O and DMA improve on this by eliminating the CPU’s need to wait.

🧱I/O Module Internal Structure

Figure 4 — I/O module internal register structure
SYSTEM BUS Address lines → Data lines ↔ Control lines ↔ IRQ → I/O Module Address Decoder Status Register BUSY · READY · ERROR Control Register READ · WRITE · RESET… Data Register input/output buffer Control Logic Decodes commands · Sequences device operations Drives status and data registers · Asserts IRQ when ready Peripheral Device (printer, disk, keyboard, network…) Device-specific protocol SATA, USB, I²C, SPI… vlsitrainers.com

I/O module internal registers. The Address Decoder recognises the module’s unique address on the bus. Status Register holds BUSY/READY/ERROR flags readable by CPU. Control Register holds the last command from CPU. Data Register holds the byte(s) being transferred. The Control Logic orchestrates all interactions and drives the IRQ line when the module needs CPU attention.

📝I/O Commands

When the CPU communicates with an I/O module, it issues commands over the control bus. Four classes of commands exist:

Command classPurposeExample
ControlActivates the peripheral and tells it to do something specific. Device-dependent.Spin up disk, seek to track 42, rewind tape, reset printer, turn on motor
TestChecks status of the I/O module and peripheral. CPU polls the status register.Is device ready? Is there a paper jam? Is power on? Did a CRC error occur?
ReadCauses the I/O module to obtain a unit of data from the peripheral and place it in the data register for the CPU to collect.Read one byte from keyboard, read a sector from disk, receive a byte from UART
WriteCauses the I/O module to take data from the data bus and transmit it to the peripheral.Send a byte to UART, write a sector to disk, send a pixel to display controller

🗺️I/O Device Addressing

There are two strategies for how I/O devices are addressed by the CPU:

🔍 Comparison — Memory-Mapped I/O vs Isolated I/O

Scenario: A CPU with a 32-bit address bus needs to communicate with 4 GB of DRAM and also control a UART, a display controller, and a GPIO bank.

Memory-Mapped I/O approach: Reserve part of the 32-bit address space (e.g. 0xF000_0000–0xFFFF_FFFF) for I/O registers. UART status at 0xF000_0000, UART data at 0xF000_0004, GPIO at 0xF001_0000. CPU uses normal LDR/STR instructions to access them — same as reading/writing a memory location. No special I/O instructions needed.

Isolated I/O approach: Separate I/O address space accessed only with special IN/OUT instructions (as in x86). UART port 0x3F8, keyboard port 0x60. I/O and memory have separate address spaces of (potentially) different widths.

⚖️Memory-Mapped vs Isolated I/O

Figure 5 — Memory-mapped I/O vs isolated I/O address space layout
Memory-Mapped I/O Single unified address space RAM 0x0000_0000 to 0xEFFF_FFFF I/O Registers 0xF000_0000 – 0xFFFF_FFFF UART, GPIO, timers, display… 0xFFFF_FFFF 0xF000_0000 0x0000_0000 ✓ Normal load/store instructions · Large I/O space Isolated I/O (Port-Mapped) Separate address spaces Memory Full 4 GB address space 0x0000_0000–0xFFFF_FFFF (accessed by LDR/STR) I/O Port Space 0xFFFF 16-bit port addr 0x0000 IN/OUT instr. separate spaces ✓ Full memory space for RAM · ✗ Special IN/OUT instructions needed vlsitrainers.com

Memory-mapped I/O (left): I/O registers and RAM share the same 32-bit address space. Normal load/store instructions access devices — no special I/O instructions needed. Isolated I/O (right): separate address spaces for memory and I/O ports. Special IN/OUT instructions switch to I/O space. x86 uses isolated I/O; modern ARM SoCs use memory-mapped I/O exclusively.

AspectMemory-Mapped I/OIsolated I/O
Address spaceShared with RAM — I/O uses part of memory mapCompletely separate I/O port space
Instructions neededNormal load/store (LDR, STR, MOV)Special IN/OUT instructions
Protection/isolationOS can protect I/O regions with MMU page permissionsHardware-separate — no MMU needed to isolate I/O
Available memory spaceReduced — I/O registers consume part of 4 GB mapFull memory space available for RAM
Instruction richnessAll memory instructions work on I/O (bit-set, compare, etc.)Limited — only IN and OUT
Used byARM, RISC-V, MIPS, most RISC architecturesx86 (IN/OUT instructions, ports 0–0xFFFF)

📊I/O Device Data Rates

One of the central challenges of I/O design is the enormous range of data rates across different devices:

DeviceBehaviourTypical data rateNotes
KeyboardInput0.01 KB/sHuman-limited — ~10 chars/sec max
MouseInput0.02 KB/sPosition updates at ~125 Hz
Voice inputInput0.02 KB/s8-bit audio at 8 kHz = 8 KB/s raw
ScannerInput200 KB/sHigher for professional scanners
Line printerOutput1 KB/s~100 chars/sec mechanical
Laser printerOutput100 KB/sPage description language processing
Graphics displayOutput30,000 KB/s4K at 60 Hz: ~3 GB/s to frame buffer
Network LANInput/Output200 KB/s10 Mbit/s Ethernet (legacy); Gigabit = 125 MB/s
Magnetic diskStorage2,000 KB/sModern HDD: 100–200 MB/s; NVMe SSD: 3,500 MB/s
The ratio matters: Keyboard generates data 3,000,000× slower than a graphics display. Without buffering and intelligent I/O techniques (CA-09), efficiently servicing both simultaneously on a single CPU would be impossible.

🔬VLSI Connections

🔬 Memory-mapped I/O in every SoC — the peripheral register map

Every ARM-based SoC uses memory-mapped I/O exclusively. When you open the Technical Reference Manual (TRM) or datasheet for any SoC (STM32, Raspberry Pi BCM2711, Qualcomm Snapdragon), you find a memory map table listing every peripheral register at its fixed address: UART0 at 0x02100000, SPI0 at 0x02101000, GPIO at 0x02200000, and so on. The five I/O module functions you learned here are all implemented in the peripheral’s register interface. When you write a device driver or verify a peripheral IP, you are programming the same conceptual register model described in this article.

🔬 I/O module as peripheral IP block in RTL design

In SoC RTL design, the I/O module is an IP block connected to the AMBA APB or AXI-Lite bus. Each peripheral IP — UART, SPI controller, I²C master, PWM, ADC controller — implements the I/O module concept in hardware: address decoder, control/status/data registers, interrupt generation, and a device-specific protocol state machine. The peripheral IP’s register interface is defined by a register map specification (often in IP-XACT format), which tools like IPGEN and Arm’s SoCDesigner use to auto-generate the APB interconnect fabric and documentation.

🔬 I/O data rates → FIFO depth and burst transfer sizing

The wide range of I/O data rates directly influences hardware design decisions. The data buffer inside an I/O module is a FIFO — the same asynchronous FIFO studied in sequential logic design. For a UART at 115,200 baud (~11.5 KB/s) serviced by the CPU via interrupts every 1 ms, the FIFO needs to hold ~11.5 bytes between interrupts — a 16-byte FIFO is standard. For a PCIe NVMe SSD at 3.5 GB/s doing DMA transfers, the FIFO and DMA engine must be designed for burst sizes of 4 KB or more. Every I/O peripheral IP specification starts with the target data rate and derives FIFO depth, burst size, and DMA granularity from it.

Summary — CA-08 key points: I/O modules are necessary because of device variety, speed mismatch, data format differences, and error management complexity. External devices are classified as human-readable (keyboard, display), machine-readable (disk, sensors, actuators), or communication (NIC, modem). Every I/O module performs five functions: control/timing, CPU communication, device communication, data buffering, and error detection. The CPU interacts with I/O modules via four command classes: control, test, read, write. Two addressing strategies: memory-mapped I/O (I/O registers in the memory address space, normal load/store — used by ARM, RISC-V) and isolated I/O (separate port space, special IN/OUT instructions — used by x86). I/O device data rates span six orders of magnitude, motivating buffering and the three I/O techniques covered in CA-09.
Cache & Virtual Memory ☰ CA Series Index I/O Techniques
Scroll to Top