How computers work

Map of scales: from the transistor to the Earth

This site is one continuous zoom: from a switch tens of nanometers across to a planet 12,742 km in diameter. Between them lie about 14 orders of magnitude, and at every step the new object is built from many copies of the previous one. Here are all the levels of the model in order: how big they are, what they are made of, and what they add to the overall picture.

Open on the site →

How to read the map

If a transistor were enlarged to the size of a grain of sand (0.5 mm), the processor die would become a lot about 150 × 150 m, the motherboard a 3 km neighborhood, and the Earth a ball almost as wide as the distance from the Earth to the Sun. A spread like that cannot be taken in at a glance, so the model is split into levels, and each one shows exactly what you need in order to understand the next.

The main line runs from bottom to top: transistor → gate → adder → core blocks → core → die → package → motherboard → system unit → workstation → local network → server → data center → region → continent → Earth. Side levels branch off from it, where individual devices are examined in detail: the cache and the pipeline next to the core; memory, storage and the graphics card next to the motherboard.

Every level answers two questions: what it is built from (the level below) and what it is for (the level above). If at some level it is unclear where a part came from, go down a step; if it is unclear why it is there, go up. And the software side (double-click the monitor screen) shows what the programs that all this hardware runs actually do.

See also: Transistor: a switch controlled by voltage · System unit: what a computer is built from · Internet and Earth: cables and satellites

Transistor: tens of nanometers

The very bottom level is the MOS transistor, a switch with no moving parts. A voltage on the gate creates a conducting channel beneath it between the source and the drain; remove the voltage and the channel disappears. Switching takes picoseconds. The gate length is 10–50 nm, and the gate dielectric is about a nanometer thick, just a few layers of atoms.

Process names like “5 nm” and “3 nm” have long since become marketing: the real spacing between gates is about 45–50 nm. The density, however, is impressive: a square millimeter of a modern die holds 100–200 million transistors. In the model the transistor is shown as a flat cross-section, but in real chips the channels are three-dimensional: “fins” (FinFET) or stacks of nanosheets surrounded by the gate on all sides (GAA).

A single transistor can do only one thing: let current through or block it. Everything else is a matter of how you connect them.

See also: Transistor: a switch controlled by voltage

Gate: fractions of a micrometer

A logic gate 0.1–0.5 µm in size is built from 2–16 transistors. In CMOS technology every gate has two networks: pMOS transistors pull the output up to the supply, nMOS transistors pull it down to ground, and in a steady state only one of them is open. That is why current flows through a gate only at the moment it switches.

An inverter takes 2 transistors; NAND and NOR take 4 each. Any logic function can be built from NAND alone, but in practice cell libraries contain hundreds of optimized cells. The “Gate” level shows how the voltages on the inputs open some transistors and close others. This is the transition from physics to logic: from here on we talk not about currents but about zeros and ones.

Gates are wired together into chains, and a signal passes through each gate in a few to a few dozen picoseconds. The longest chain between two registers determines how short the processor’s clock cycle can be, which is why designers count picoseconds on every path.

See also: Logic gate: from transistors to logic

Adder and core blocks: from one bit to 64 bits

A full adder adds three bits (two operands and a carry) and outputs a sum bit and a carry to pass on. That is five gates in an area of 1–3 µm. A chain of 64 full adders adds 64-bit numbers; in real processors the carry is sped up so as not to wait for it to ripple through every bit position.

The “Core blocks” level shows how adders and gates are assembled into everything needed to execute an instruction: an arithmetic logic unit (ALU) with a shifter and logic, a register file of 32 registers of 64 bits each, an instruction decoder, a program counter, a branch unit and memory access. Each block is thousands to tens of thousands of gates.

This is also where a program first appears: a 32-bit instruction of a teaching RISC-V core is split into fields, and you can see which wires switch on to carry out, for example, the addition of two registers.

See also: Adder: how a processor adds numbers · Core blocks: what each part of a processor core does

Core: a few square millimeters

A processor core occupies 3–5 mm² and contains anywhere from hundreds of millions to a billion transistors. The teaching core at this level executes each instruction in a single cycle: fetch, decode, register read, ALU, memory, write-back. A real x86-64 or ARM64 core is far more complex: it fetches and decodes 6–8 instructions per cycle, renames registers, executes instructions out of order as soon as their data are ready, and predicts branches.

Most of a modern core’s area goes not to computation but to keeping the execution units from sitting idle: the branch predictor, a reorder buffer holding hundreds of instructions, schedulers, the L1 and L2 caches. A clock rate of 4–6 GHz means a cycle of about 0.2 ns, in which light travels just 6 cm.

At the “Core” level you can switch between a view of a modern out-of-order core and the teaching datapath, where a teaching program actually runs: the values in the registers, on the ALU wires and in memory are taken from the current step. The core is the last level where an individual instruction is still visible; above it begins a world where billions of instructions per second merge into the work of programs.

See also: The processor core: an educational datapath and a modern core

Cache and pipeline: the core’s side levels

The “Cache” level explains why the core does not wait for main memory on every instruction. The L1 cache is about 0.1 mm² of fast SRAM next to the core, 32–64 KB, answering in 1 ns. An address is split into a tag, an index and an offset; if the tag matches, it is a hit; if not, it is a miss and a long read from memory, 80 times longer in the model.

The “Pipeline” level shows how the core executes several instructions at once: fetch, decode, execute, memory and write-back, five stages of 200 ps each. While one instruction is in the ALU, the next one is already being decoded. You can see where the stalls come from: dependence on the result of the previous instruction, and mispredicted branches.

Both ideas, caching and pipelining, then reappear at every level above: the page cache in the OS, the buffer pool of a database, the CDN on the internet; the rendering pipeline in the graphics card and in the browser.

See also: Cache: why the processor doesn’t wait for memory · Pipeline: several instructions at once

Die: 1–2.5 square centimeters

The die is a sliver of silicon 100–250 mm² in area holding tens of billions of transistors. On it sit several identical cores (8 in the model, in two rows), a shared L3 cache of tens of megabytes, a ring bus or on-chip network connecting them, a memory controller, integrated graphics, and PCIe and display controllers.

Dies are made on silicon wafers 300 mm in diameter, from a hundred to several hundred per wafer, through hundreds of process steps over two to three months. Above the transistors lie 10–20 layers of copper wiring whose total length in a single die is measured in kilometers. More and more processors are assembled from several dies, called chiplets: the cores separately, the input/output separately. This is cheaper than making one huge die.

Why several cores instead of one giant one? There is almost no room left to push the clock beyond 5–6 GHz, because the strain on power delivery and the heat keep growing, and making a single core twice as “wide” yields only a small gain. Several cores make it possible to run many threads at once, and dividing them among programs is the job of the operating system’s scheduler.

See also: The processor die: what goes where on the silicon

CPU package: about 4 centimeters

The die is too fragile and too small to connect to the motherboard directly. The package solves three problems. The substrate, a multilayer printed circuit board about 3.75 × 4.5 cm (LGA1700/1851; for AM5 it is 4 × 4 cm), routes the die’s tens of thousands of micro-bumps (at a pitch of 0.1–0.2 mm) to roughly 1,700–1,850 pads on the bottom. Capacitors on the substrate smooth out current surges. A metal lid, through a thermal interface material, draws up to 150–250 W from the die and passes it to the cooler.

Power is a story of its own: at around 1 V the processor draws more than 100 A, so hundreds of the package’s contacts are devoted solely to power and ground.

At the “CPU package” level the layers can be pulled apart and seen one by one: the contact pads, the substrate with its capacitors, the micro-bumps, the die itself, the thermal interface and the lid. Server and high-end processors carry several dies on one substrate, and the HBM memory of AI graphics cards is placed right next to the die on a shared silicon interposer.

See also: The CPU package: from die to board

Motherboard: 30 × 24 centimeters

An ATX board (305 × 244 mm) is a multilayer printed circuit board, typically 6–12 layers of copper, that ties everything together. The processor in its socket is wired directly to the fastest things: two DDR5 channels, 16 PCIe 5.0 lanes for the graphics card and 4 lanes for an NVMe drive. Everything else (USB, SATA, networking, audio) hangs off the chipset, which is connected to the processor by a single link.

Next to the socket sits the VRM voltage regulator: it turns the 12 V from the power supply into ≈1 V for the cores, switching hundreds of thousands of times per second. A flash chip on the board holds the UEFI firmware, the first code that runs after power-on. From here you can descend to the side levels: memory, storage and the graphics card.

The traces on the board are not just wires but transmission lines with carefully controlled impedance: at gigahertz frequencies a signal behaves like a wave, and the traces of the memory bus are length-matched to within fractions of a millimeter. Turn on the bus layer or the power layer at the motherboard level to see how everything is connected.

See also: Motherboard: how everything is connected

Memory: from module to cell

A DDR5 module measuring 13 × 3 cm contains 8–16 DRAM chips. Each chip is divided into 32 banks, each bank into arrays of rows and columns, and a single bit is stored in a cell made of one transistor and a tiny capacitor about 0.002 µm² in area. A single chip holds 16–32 billion such cells.

The capacitor’s charge leaks away within tens of milliseconds (the guarantee is 32 ms; many cells hold it for seconds), so the memory is refreshed constantly, hence the name “dynamic.” You cannot read an individual cell: a whole row is opened, 1 KB in each chip, about 8 KB across a whole rank of eight chips, and the needed bytes are taken from it. That is why sequential reads are faster than scattered ones, a property that affects all the software above.

A DDR5 channel at 6,000 MT/s transfers about 48 GB/s; two channels, about 96 GB/s. But the latency of the first byte is 70–100 ns, hundreds of processor cycles. It is exactly this latency that the L1–L3 caches from the “Cache” level hide.

See also: DDR5 memory: how a byte is stored

Storage: where data live without power

An M.2 SSD (22 × 80 mm) is a board with a controller, a DRAM buffer and NAND flash chips. A bit is stored as charge in an insulated layer of a transistor and persists for years. The cells are stacked in 3D piles of 200–300 layers, and one cell stores 3–4 bits. Data can be written in 16 KB pages but erased only in blocks of megabytes, so the controller constantly moves data around and maintains a “logical address → physical page” table.

A hard disk is a set of magnetic platters spinning at 7,200 rpm with a head on an arm floating nanometers above the surface. It is cheaper per terabyte, but every jump to a new location costs milliseconds, a hundred times slower than an SSD. The “Storage” level shows why an SSD writes “somewhere else” and why it matters so much for a hard disk to read sequentially.

The difference in speed across the whole hierarchy is enormous: a register takes a fraction of a nanosecond, the L1 cache 1 ns, main memory 80 ns, an SSD 50–100 µs, a hard disk 5–10 ms. If you stretched an L1 access to one second, main memory would answer in a minute and a half, an SSD in about a day, and a hard disk in two to four months.

See also: Storage: SSDs and hard drives

Graphics card: thousands of simple cores

The graphics card’s die, 300–600 mm² in area, is the largest chip in the computer, with up to 70–90 billion transistors. Instead of a few complex cores, it carries tens of thousands of simple compute units grouped into multiprocessors, plus tensor cores for neural networks. Next to it are 8–32 GB of GDDR video memory with bandwidth from hundreds of gigabytes up to 1.8 TB/s, an order of magnitude more than the CPU’s main memory.

At the “Graphics card” level a triangle passes through the whole graphics pipeline: vertex shader, rasterization, pixel shader, writing to the framebuffer and output to the monitor. The same units that compute pixels also compute neural networks: both are millions of independent, identical calculations.

The graphics card is connected to the processor by 16 PCIe lanes and receives from it not pixels but commands and data: “here are the triangles, here are the textures, draw.” It draws 200–575 W, more than all the other parts of the computer combined, hence the massive heatsinks and separate power cables.

See also: Graphics card: how an image appears

System unit and workstation

The system unit (about 45 × 47 × 21 cm) brings together the motherboard, the graphics card, the drives, the power supply and the cooling. The power supply turns 230 V AC into 12, 5 and 3.3 V DC; under load a gaming computer consumes 300–700 W and turns nearly all of it into heat, which the fans carry away in a stream of air from front to back.

The workstation (a desk about 160 × 75 cm) is the boundary between hardware and software: the keyboard and mouse pass on what the person does, the monitor shows the result. From here, a double-click on the screen takes you into the software side, where you can see which layers of software (firmware, OS, browser, languages, neural networks, databases, network) run on this hardware.

The “PC boot” scenario shows everything coming to life at once: the power supply brings up its voltages, the firmware checks the hardware, and the screen goes from “No signal” through the UEFI logo and the boot loader to the desktop.

See also: System unit: what a computer is built from · Workstation: the whole computer

Local network: an apartment

In an apartment of roughly 11 × 7 m, the computer is one of many devices on the network: a laptop, a phone, a printer, a network storage box. Inside the network they talk in Ethernet frames addressed by MAC address, through a switch and a Wi-Fi access point. The router is the boundary: everything addressed to the outside world it sends to the provider, replacing the private addresses with its own public one.

The optical fiber from the provider ends at an ONT terminal, which turns light into electrical Ethernet. Inside the apartment the latency is a fraction of a millisecond over a cable and a few milliseconds over Wi-Fi.

To find a neighbor’s MAC address from its IP address, the computer broadcasts an ARP request to the whole network, and the switch remembers which device is behind which port and from then on forwards frames only where they need to go. The demo at this level shows the path of a frame inside the apartment and out through the router to the internet.

See also: Local network: router, switch, Wi-Fi

Server and data center

A 2U server (about 44 × 75 × 9 cm) is built from the same parts as a PC, only more of them and more reliable: two processors with 64–128 cores each, 32 memory modules (terabytes), 24 NVMe drives, a 2 × 100 Gbit/s network card, two power supplies, a wall of fans and a separate service computer, the BMC, for remote management.

Servers sit in racks, 10–20 per rack (the rack’s power limit allows no more), and the racks stand in rows in the data center’s machine halls. Cold air is fed into the aisle between the fronts of the racks, and hot air leaves from the back. Power comes through UPS units with batteries and diesel generators. A large data center consumes tens to hundreds of megawatts, as much as a small town, and houses tens of thousands of servers; clusters for training neural networks contain hundreds of thousands of graphics cards.

The providers’ fiber enters a separate room (the meet-me room), from which traffic flows through the hall’s network core to the switch in each rack. Inside the data center servers exchange data in tens of microseconds, orders of magnitude faster than with users.

See also: Server: a computer for the data center · Data center: where websites live

Region: a city and its networks

At the city level (about 20 × 14 km) you can see how homes and cell towers are connected to providers. Fiber from a building runs to a district node (OLT), and from there to the provider’s point of presence (PoP) with its core routers. The networks of different companies are joined at an internet exchange point (IX), a building where dozens of providers and data centers are connected by switches.

Light crosses the city in a fraction of a millisecond; most of the time is added by the nodes: GPON access, and on mobile networks, the radio interface. In the model a request from the apartment to a server in a city data center and back takes about 1.6 ms.

Over a phone the same request takes longer: the cellular network’s radio interface adds milliseconds at each step, and the RTT grows several times over. The demo at this level breaks the latency down by segment: propagation of light, serialization of the packet and processing in each node.

See also: City and region: how networks connect

Continent and Earth

Cities are linked by backbone cables running along roads and railways. A single fiber carries dozens of channels of different colors (DWDM) at 100–400 Gbit/s each, and optical amplifiers stand every 80–100 km. Europe’s major hubs (Frankfurt, Amsterdam, London, Paris, Stockholm) are clusters of data centers and exchange points through which most of the continent’s traffic flows. There are always several routes between them: if a cable is cut, the routers reroute the traffic within seconds.

The continents are connected by more than 500 submarine cables with a total length of over 1.4 million km; each carries tens to hundreds of terabits per second. Satellites are needed where there is no cable. At the “Internet and Earth” level a request to New York takes about 98 ms round trip over cable, about 80 ms via low Earth orbit, and more than half a second via a geostationary satellite.

And so the circle closes: every bit that crosses the ocean begins and ends with transistors switching, in the computer’s processor, in the network card, in the lasers and receivers of the optical links. This whole zoom is a single system.

See also: Continent: backbones between cities · Internet and Earth: cables and satellites

Open on the site →

All articles

Overviews

Logic: from transistor to arithmetic

Processor

Computer

Servers and data centers

Networks and the internet

Software