Skip to content
NewAll 84 chapters are online, in English and French

How a computer really works, layer by layer.

Start from the apps you use and the algorithms behind them, then follow a single line of C down through assembly, machine code, micro-operations and buses to the logic gates and transistors that run it, and step through every one of them live.

levels of abstraction
10
levels of abstraction
chapters planned
84
chapters planned
runnable examples
24
runnable examples
installs or sign-ups
0
installs or sign-ups

The simulator

Stop imagining what the CPU does. Watch it.

A compiler, an emulator and a debugger that explain themselves, running entirely in your browser.

int c = a + b;→mov eax, DWORD PTR [rbp-4]mov ecx, DWORD PTR [rbp-8]add eax, ecxmov DWORD PTR [rbp-12], eax
if (c > 7)→cmp DWORD PTR [rbp-12], 7jle .L1

C → assembly, in your browser

A real compiler with types, pointers, structs and strings. Every assembly line maps back to the C that produced it.

OF0
SF1
ZF0
AF1
PF0
CF1

cmp eax, 5 · 3 − 5 = −2 → jl taken

Every flag, every bit

The full RFLAGS register, what each instruction wrote or changed, and which conditional jump will be taken, and why.

▸ factorial(n=3) · ← factorial(n=4) ← main()
[rbp-4]argn0x00000003
[rbp]fpsaved rbp (factorial)0x7fffff98
[rbp+8]retreturn → factorial+140x00401011

The stack, labeled

Frames, locals, arguments, saved frame pointers and return addresses, named from your C source. Watch a buffer overflow smash one.

CPUMAR · MDR
Address0x7fffffc8
Data0x7fffffe0 →
ControlMEMW
RAMstack

Inside the CPU

Fetch, decode, address calculation, bus reads and writes, ALU, write-back: each micro-operation animated on the system bus.

Foundations

The number systems every level relies on.

Levels of abstraction and a short history of computersBinary and hexadecimalTwo’s complement and signed numbersFloating point (IEEE 754)Characters, ASCII and UnicodeEndiannessParity, Hamming codes and error correctionUnits: kilo, kibi and friends

Start at the top. Go as deep as you like.

No install, no account. Every chapter has live demos to play with.

Start with the levels