Skip to content

The levels of a computer

A computer is a stack of abstraction levels. Explore each one, from programming languages down to transistors.

  1. 0
    Level 0

    Programming languages

    What you write: variables, functions, pointers — and what a compiler turns them into.

    From source code to a running binary · Variables, types and memory layout · Pointers and arrays · Functions, calls and the stack · Structs, malloc and the heap · Control flow: if, loops, switch

    c = a + b;
  2. 1
    Level 1

    Assembly language

    One line per instruction: registers, flags, jumps — the view debuggers and disassemblers give you.

    Registers and the register file · Flags, cmp and conditional jumps · Calling conventions (System V, cdecl) · Assembler, linker and loader · Directives, sections and macros

    add eax, ecx
  3. 2
    Level 2

    Operating system

    The layer that turns one CPU into many processes: virtual memory, system calls, files.

    Processes and the address space · System calls and privilege levels · Virtual memory and paging · Files, devices and I/O · Threads and synchronization

    syscall
  4. 3
    Level 3

    Instruction set architecture

    The contract between software and silicon: instruction formats, encodings, addressing modes.

    Instruction formats and encoding · Addressing modes · x86, ARM and RISC-V side by side · Interrupts and exceptions · Data types the hardware understands

    01 C8
  5. 4
    Level 4

    Microarchitecture

    How one instruction becomes fetch, decode, execute: datapath, buses, caches and pipelines.

    The fetch–decode–execute cycle · Datapath, internal and system buses · Control units and microcode · Pipelining and hazards · Caches and the memory hierarchy · Branch prediction and out-of-order execution · Multicore and parallel machines

    MAR ← rip · MEMR
  6. 5
    Level 5

    Digital logic

    Gates, adders, the ALU, flip-flops and memory cells — where 0 and 1 become arithmetic.

    Gates and Boolean algebra · Adders, the ALU and the flags · Multiplexers, decoders and buses · Latches, flip-flops and clocks · Registers and memory arrays

    S = A ⊕ B ⊕ Cin
  7. 6
    Level 6

    Devices & physics

    The bottom of the stack: transistors as switches, CMOS gates, and how chips are made.

    Transistors as switches · Building gates from CMOS · From sand to chips

    NMOS · PMOS

Foundations

The number systems every level relies on.

Binary and hexadecimalTwo’s complement and signed numbersFloating point (IEEE 754)Characters, ASCII and UnicodeEndianness