Input and Output Explained
September 7, 2026 • 6 min read

Table of Contents
Part of the series:Computers
The previous posts built a complete machine that can compute, remember, and persist, yet one that is deaf, mute, and blind. A computer with no way in and no way out would be useless. This post covers input/output (I/O)1: the devices that carry information across the machine’s boundary, the controllers and buses that connect them, and the two mechanisms (interrupts and DMA) that let the CPU cooperate with devices far slower (and sometimes faster) than itself. How operating systems manage all of this (drivers, scheduling, filesystems) belongs to the future OS series; here we stay inside the hardware.
Input devices: bringing the world in
Input devices2 convert the outside world into bits. A keyboard3 is conceptually a grid of switches: a controller scans rows and columns many times per second, detects which intersection closed, and reports a code identifying the key, not a letter but just a position. Which character that position means (q versus й, lower versus upper case) is decided later, by software layouts.
An optical mouse4 reports relative movement: its sensor photographs the surface thousands of times per second and computes how far the image shifted between frames, sending distance counts the machine accumulates into cursor position. Touchscreens, microphones, and cameras work in a broadly similar way at higher bandwidth, converting physical input into streams of values on a schedule. Every input device is, at this level of abstraction, a sampler with a reporting discipline.
Output devices: carrying bits back out
Output devices5 run the reverse direction. A display6 is a grid of hundreds of thousands to millions of pixels, each holding color values the machine wrote into a dedicated region of memory called the framebuffer. The display controller reads that memory on a fixed schedule (typically sixty or more times per second) and translates each value into light. The image you see is a frozen instant of memory, refreshed faster than your eyes can follow.
Audio7 works the same way in time rather than space: values representing air pressure are written into a buffer, and the audio controller feeds them to a converter on a strict schedule (typically tens of thousands of samples per second), producing sound. Miss the schedule and you hear it: a click or a gap. Displays tolerate a late frame; audio does not forgive a late sample.
Storage and network devices: I/O in disguise
Two devices from earlier posts reappear here wearing I/O uniforms. Storage devices (the disks and SSDs of the storage post) are I/O devices from the CPU’s point of view: the processor does not reach into them directly but issues commands (read and write blocks identified by logical addresses) and waits for completion.
Network devices8 are the most symmetrical of all: the same network card is both input and output, carrying packets in and out. That is why a machine with nothing attached except Wi-Fi remains fully useful. The network is a universal input-output channel to other machines. The interconnects post will follow these packets beyond the machine.
Controllers: translators at the border
No CPU speaks “keyboard” or “display” natively. Typically, between the processor and a device sits a controller9: specialized logic that speaks the device’s language on one side and the machine’s on the other. The keyboard controller scans the key matrix; the display controller sustains the framebuffer rhythm; the storage controller translates read/write commands into platter seeks or flash operations; the network controller sends and receives frames over wires or radio waves.
Controllers matter for a performance reason too: they offload timing-critical, repetitive work the CPU is ill-suited to babysit. The CPU issues a high-level request (“deliver this frame,” “fetch these sectors”), and the controller handles the millisecond-by-millisecond choreography alone.
Buses and ports: the roads and doors
Devices and controllers connect through electrical links. A traditional bus10 is a set of signals carrying addresses, data, and control between components: the memory bus of the memory post is the classic example. Modern machines often use a hierarchy of fast point-to-point links such as PCIe to attach controllers at high speed, but the idea is unchanged: named roads with agreed traffic rules.
A port11 is the physical connector where a road meets the outside, such as a USB-C, HDMI, RJ45 Ethernet, or audio jack. These connectors belong to broader interfaces and standards such as USB, HDMI, or Ethernet, which define the electrical conversation and protocols so devices from different makers interoperate. Plugging in a mouse is, electrically, joining a small network with its own protocol and schedule.
Interrupts: devices that raise their hand
The CPU runs billions of cycles per second; a keystroke arrives a few times per second. Having the processor constantly ask every device “anything new?” (known as polling) would burn its attention on silence. The alternative is the interrupt12: a signal by which a device pauses the CPU’s current work to announce an event.
Conceptually the flow is: the device raises its interrupt line; the CPU finishes the current instruction, saves enough state to resume later, jumps to a handler routine associated with that device, services the event (read the key code, acknowledge the packet), restores state, and continues as if nothing happened. The program that was interrupted never notices because its registers and instruction pointer are preserved across the detour. Interrupts turn waiting upside down: instead of the fast polling the slow, the slow taps the fast on the shoulder.
DMA: moving data without the CPU
Interrupts solve notification, but bulk movement raises a second problem: dragging every byte of a disk read or network packet through CPU registers would still waste the processor. Direct memory access13 solves it: DMA-capable hardware moves data between a device and main memory on its own.
The CPU sets up the transfer (source, destination, size) and turns to other work; the DMA engine performs the transfer, often in bursts and contending for memory access as needed; on completion it raises an interrupt to say “the data is there.” High-throughput devices (disks, SSDs, network cards, GPUs) all depend on this arrangement. The pattern is the machine’s recurring theme: the CPU delegates steady bulk work to specialized logic and spends its own cycles only on decisions.
The big picture
Input devices sample the world into bits; output devices render bits back into light and sound; storage and network devices are I/O wearing different uniforms; controllers translate at the border; buses and ports provide roads and doors; interrupts let slow devices tap a fast CPU on the shoulder; DMA moves bulk data without requiring the CPU to move every byte.
With computation, memory, storage, and now I/O in place, one boundary remains: the wires and waves between machines. The next post follows packets outward to interconnects before the series steps back to view the computer as a whole.
Footnotes
Enjoyed this post? You can sponsor me and this site.