Computer Architecture Roadmap

Nine levels from building arithmetic out of logic gates to reading performance counters on a loaded multicore machine.

0 / 138 mastered0%

Level 1 · How arithmetic becomes hardware

Binary and two's complement, why floating point approximates, and the path from a truth table to an adder. By the end, arithmetic is no longer a primitive — it is something you could build.

What Actually Happens When You Add Two Numbers
Binary, and Why Everything Is Eventually Bits
Floating Point: Trading Precision for Range
Why 0.1 + 0.2 Is Not 0.2 + 0.1's Problem
Logic Gates: Where Software Stops and Physics Starts
Building an Adder: Where Arithmetic Comes From
Adding Memory: Combinational, Sequential and the Clock

Level 2 · What a CPU is made of

Registers, the ALU, the datapath they sit on and the control unit that steers it — plus the first myth to lose: that clock speed is performance.

What Is Actually Inside a CPU
The ALU: Where Arithmetic Actually Happens
The Control Unit: Turning Instructions Into Actions
The Datapath: How Values Move Through the Machine
The Program Counter: Deciding What Happens Next
The Clock: Why GHz Is Not Performance

Level 3 · The contract, and executing against it

The ISA as the interface between software and hardware, the distinction from microarchitecture that most performance arguments miss, and the fetch-decode-execute cycle that pipelining then overlaps.

The ISA: The Contract Between Software and Hardware
x86-64, ARM and RISC-V: Three Families, Three Histories
Reading Assembly Without Writing It
Addressing Modes: How an Index Becomes an Address
Instruction Fetch: Code Is Data Too
Decode: Turning Bytes Into Intent
Execute: Not All Operations Cost the Same
Load and Store: Why Arithmetic Happens in Registers
Pipelining: Throughput Without Making Anything Faster
Pipeline Hazards: The Three Ways Overlap Fails
Forwarding and Stalls: Paying for Dependencies

Level 4 · Guessing, reordering and doing several things at once

A modern core is a throughput machine: it predicts branches, executes speculatively, runs instructions as their inputs arrive, and only commits in program order. This is where the line-by-line mental model dies.

Branch Prediction: Guessing Well Enough to Matter
Misprediction: What a Wrong Guess Costs
Branchless Code: A Trade, Not an Upgrade
Out-of-Order Execution
Dependency Graphs: The Real Shape of Your Code
Instruction-Level Parallelism
Superscalar Execution
Register Renaming
The Reorder Buffer and Precise State
IPC: Instructions Per Cycle
Four Kinds of Parallelism
SIMD: One Instruction, Many Elements
Vectorization: Turning a Loop Into Vector Work
Auto-Vectorization: Verify, Do Not Assume

Level 5 · The memory hierarchy

The deepest level, because this is where most real programs spend their time. Lines, locality, associativity, replacement, thrashing and prefetching — everything behind "why is this loop slow".

The Memory Hierarchy
What a Cache Actually Is
Memory Moves in Lines, Not Variables
Spatial Locality
Temporal Locality
Hits, Misses and What a Miss Actually Costs
Three Kinds of Miss, Three Different Fixes
Direct-Mapped Caches: One Address, One Home
Set-Associative Caches: The Compromise That Won
Tag, Index and Offset: How an Address Finds Its Line
Cache Thrashing: Load, Evict, Reload, Repeat
Working Set: Why Performance Falls Off a Cliff

Level 6 · Past the cache, and where the bytes sit

DRAM organization, latency against bandwidth as two separate resources, and the layout decisions — alignment, padding, contiguity, AoS versus SoA — that decide how much of each fetched line you actually use.

Past the Last-Level Cache
How DRAM Is Organised
Latency and Bandwidth Are Different Resources
When the Memory Bus Is the Bottleneck
When You Cannot Ask the Next Question Yet
Alignment: Why Addresses Are Not Arbitrary
Padding: Why Your Struct Is Bigger Than Its Fields
Endianness: Which Byte Comes First
What `arr[i]` Actually Compiles To
Both Are O(n). One Is Far Slower.
Pointer Chasing: The Address You Do Not Have Yet
Array of Structs, or Struct of Arrays?
Data-Oriented Design, Without the Dogma

Level 7 · Address translation and protection

The hardware half of virtual memory: the MMU on the path of every access, the TLB that makes it affordable, and the privilege and permission bits that process isolation is actually built from.

Every Address Your Program Uses Is Fake
The MMU: Translation and Protection in One Check
The Page-Table Walk: Dependent Loads All the Way Down
The TLB: A Cache for Addresses, Not Data
When Translation Itself Is the Bottleneck
Huge Pages: More Coverage per Entry, and What It Costs
Why Kernel Mode Is Actually Privileged
Why a System Call Costs More Than a Function Call

Level 8 · More than one core

Coherence keeping caches consistent, false sharing as its most expensive surprise, NUMA and affinity — then the ordering rules and atomic instructions that every lock and every lock-free structure is built on.

What a Second Core Actually Adds
Core, Hardware Thread, Software Thread
SMT: Two Contexts, One Core
Hardware Threads Are Not OS Threads
Cache Coherence: Why Shared Memory Works At All
MESI and Its Relatives
False Sharing: Independent Data, Shared Line
NUMA: Not All Memory Is Equally Far
Thread Affinity: Pinning and Its Price
Cache Warmth and the Real Cost of Migration
Sequential Consistency: The Model You Already Have
Why Your Loads and Stores Happen Out of Order
Store Buffers: Where Your Writes Wait
Memory Barriers: Ordering, Not Flushing
Hardware Memory Models Are Not Language Memory Models
Compare-and-Swap: The Primitive Everything Is Built On
What a Mutex Actually Does

Level 9 · The rest of the machine, and reading it

Interrupts, DMA and the path to devices; GPUs and accelerators as throughput hardware with a transfer bill; the counters that tell you what the machine is doing; and where all of it shows up in code you already write.

Interrupts: How Hardware Gets the CPU's Attention
Polling versus Interrupts
DMA: Moving Bytes Without the CPU
I/O Architecture: The Interconnect Is a Shared Resource
Memory-Mapped I/O: When a Store Is Not a Store
PCIe: Lanes, Generations and the Transfer Budget
The Storage Path: Why One Small Read Is the Worst Case
CPU Cache Is Not the Page Cache
CPU or GPU: Two Bets About What Work Looks Like
What Is Actually Inside a GPU
Lanes, Divergence and Coalescing
The Transfer You Forgot to Count
What GPU-Friendly Work Has in Common
Accelerators: The Specialization Spectrum
The Specialization Trade-off
LLM Inference Is a Memory Bandwidth Problem
The CPU Counts Itself
CPI and IPC: The Number Everyone Misreads
Busy Is Not the Same as Working
Misses That Overlap Are Nearly Free
Your Code Is Data Too
Every Way a CPU Microbenchmark Lies
The Clock Is a Variable
The First Ten Seconds Lie
Performance Per Watt
Throughput Improved, Latency Did Not
Cache-Aware Algorithms
Matrix Tiling: Same Arithmetic, Ten Times Faster
The Compiler Reordered It Before the CPU Did
Why Reading the Source Cannot Tell You the Cost
Side Channels: When Performance Optimisations Leak
The Hardware That Makes Virtual Machines Possible
What a vCPU Actually Is
From malloc to Cache Lines