Discover / Computer architecture / Reading path

Best Books on Computer Architecture, in Reading Order

@codesherpaBeginner → Intermediate
12
Books
177
Hours
4
Stages
Rate this path

Computer architecture is the one subject where a reader can genuinely build the whole tower — from a relay that can hold a bit up to a superscalar processor with a multi-level cache — and the order matters enormously. This path starts with Petzold's Code, which gets you from switches to a working computer with no prerequisites, moves through digital logic and the classic Patterson and Hennessy undergraduate text, takes the detour every programmer should take into how code actually meets the machine, and ends with the quantitative literature on pipelines, memory hierarchy and parallelism.

1

From a switch to a computer

Beginner

Build a complete mental model of how binary, logic gates, memory and an instruction set compose into a machine that executes programs, without needing any electronics background.

Study plan for this stage

Pace: 10-12 weeks, most of it on the third book. Code is 393 pages and reads like a narrative — three weeks at 20 pages a day. But How Do It Know is 206 pages and can be read in a week because you already know most of it. The Elements of Computing Systems is not a reading assignment: it is twelve projects

Key concepts
  • Petzold's ladder, which is the model everything later refines: switch to relay to logic gate to adder to flip-flop to latch to register to RAM to a machine that fetches and executes. Each rung is built from the one below with nothing hidden
  • Why a relay in a feedback loop stores a bit — the single most important idea in Code, because it is where a circuit stops being a function and starts having state
  • Two's complement and why it makes subtraction the same circuit as addition. Petzold derives it rather than asserting it; make sure you can do the derivation
  • The instruction set as an interface: a fixed set of bit patterns the control logic decodes into datapath actions. Clark's book builds exactly one such machine end to end, which is why it works as a second pass — the same model, a different concrete instance
  • The Nand2Tetris stack in order: NAND gates, then the ALU, then registers and memory, then the Hack CPU, then the assembler, then the VM translator, then a compiler and an OS. Every layer is built on the one you built yourself the week before
  • The Hack machine's deliberate simplicity — a small instruction set, no pipelining, no cache — and the fact that this is a feature. You want one complete machine in your head before you meet complications
  • The single most valuable thing this stage gives you: a reflex, when you meet a new architectural feature later, of asking what problem in this simple machine it solves
You should be able to answer
  • Draw a flip-flop and explain in your own words why the feedback makes it hold a value. If you cannot do this without looking, redo Petzold's chapter
  • Why does two's complement mean an adder circuit can subtract? Derive it for a 4-bit case on paper
  • In the Hack machine you built, trace one instruction from memory fetch through decode to the register write. Name every component it touches
  • Clark and Petzold build different machines to the same purpose. What did the second construction make clear that the first did not?
  • After Nand2Tetris, what is the actual boundary between hardware and software in your machine? Point to the exact layer where it moves
Practice
  • Do all twelve Nand2Tetris projects. This is not optional and it is not skimmable — the projects are the stage. Everything from stage 2 onward reads as commentary on work you have done rather than as new material
  • Before starting project 5, sketch the Hack CPU yourself from the specification and then compare it to what you end up building. The gap between your design and the working one is the most instructive artefact of the whole stage
  • Build a 4-bit ripple-carry adder on paper from NAND gates only, then count the gate delays along the critical path. You will need exactly this reasoning when you meet carry-lookahead later
  • Write a 300-word explanation of how a computer executes an instruction, aimed at someone who has read none of these books. If you need to say 'somehow', find the rung you skipped
  • Keep a one-page diagram of your complete machine — gates at the bottom, compiler at the top. Every later stage adds a feature to this diagram rather than replacing it

Next up: You have built one complete simple machine, which is exactly the baseline you need for the textbooks to read as explanations of why real machines are more complicated.

Code
Charles Petzold · 1999 · 393 pp

The best entry point in the whole field: Petzold starts with flashlights and Morse code and ends with a working computer, never skipping a step. A reader who begins with a textbook instead usually stalls; this book prevents that.

But How Do It Know
J. Scott Clark · 2009 · 206 pp

Covers similar ground to Petzold but builds one specific simple CPU in full detail, register by register. Useful as a second pass because repetition with a different concrete machine is what makes the model stick.

The Elements of Computing Systems
Noam Nisan · 2005

The Nand2Tetris book, and the point where reading becomes building — you construct gates, an ALU, a CPU, an assembler and a compiler yourself. Do this before any textbook and the textbook becomes commentary on work you have already done.

2

Digital logic and the datapath

Intermediate

Design and analyse combinational and sequential logic, then trace a real instruction set through a single-cycle and pipelined datapath, reasoning about hazards and control.

Study plan for this stage

Pace: 16-20 weeks. Structured Computer Organization (587 pages) is orientation — read the layered-machine framing and the chapters on levels you are weakest at, three weeks. Digital Design and Computer Architecture (592 pages) is five to six weeks with the exercises. Computer Organization and Design (909

Key concepts
  • Tanenbaum's layered model — digital logic, microarchitecture, ISA, operating system, assembly language — as a map. Its value here is orientation: you can see which layer any later question belongs to
  • Combinational versus sequential logic, and the discipline of the synchronous design: everything settles within a clock period, so the critical path sets the clock rate. Harris and Harris drills this properly
  • Hardware description language as a way of thinking, not just a tool. Writing Verilog or VHDL forces you to distinguish what is a wire from what is a register, which is the distinction the software habit of assignment destroys
  • Timing: setup and hold, propagation delay, and why the longest combinational path between two registers is the number that matters. Every pipelining argument later is an argument about shortening it
  • The Patterson and Hennessy performance equation — time equals instruction count times cycles per instruction times clock period — which is the tool for every design argument in the rest of the path. Learn to reach for it automatically
  • The single-cycle datapath, then the multicycle, then the five-stage pipeline (fetch, decode, execute, memory, writeback), and exactly what each transition buys and costs
  • Hazards in their three kinds: structural, data (with forwarding and stalls as the responses) and control (with branch prediction and delayed branches). Being able to say which kind a given stall is, is the competence this stage is for
  • Amdahl's law, introduced here and used relentlessly in stage 4 — the speedup ceiling imposed by the part you did not improve
You should be able to answer
  • Given a five-stage pipeline and a specific instruction sequence, identify every hazard and say how forwarding does or does not resolve it. Do this for at least ten sequences until it is automatic
  • Use the performance equation to argue for a design change that lowers CPI while raising clock period. Under what ratio does the change win?
  • Why does the pipeline's clock rate depend on the slowest stage rather than the average? What does that imply about how to divide the stages?
  • In HDL, what distinguishes code that synthesises to a register from code that synthesises to combinational logic? Give an example of each
  • Compare the Hack machine you built in stage 1 to the pipelined machine here. Which features are additions for performance and which are additions for capability?
Practice
  • Work every hazard exercise in the pipelining chapter of Computer Organization and Design. Not most of them — all of them. This is the one chapter where volume of practice is what produces fluency
  • Implement a small pipelined processor in HDL from Harris and Harris and simulate it. Getting a forwarding unit right in simulation teaches what no amount of reading a hazard table will
  • Take a short loop in C, compile it to assembly, and hand-trace it through the five-stage pipeline, marking every stall. Then count the cycles and compare against the performance equation prediction
  • Compute the critical path of the ALU you designed in stage 1 and identify which operation sets it. Then propose one change that shortens it and calculate the cost in gates
  • Add the pipeline stages and hazard-handling units to the one-page machine diagram you started in stage 1

Next up: You can now reason about a datapath in cycles and gates, which is exactly what is needed to see why the code you write performs the way it does.

Structured Computer Organization
Andrew S. Tanenbaum · 1975 · 587 pp

Tanenbaum's layered view — digital logic, microarchitecture, ISA, operating system, assembly — is the clearest map of how the levels stack. A short orientation before committing to a full architecture text.

Digital Design and Computer Architecture
Sarah Harris · 2010 · 592 pp

Teaches the hardware side properly: Boolean logic, sequential design, and HDL, then builds a processor from it. Read before Patterson and Hennessy if your logic design is weak, which for most self-taught readers it is.

Computer Organization and Design
John L. Hennessy · 1994 · 909 pp

The canonical undergraduate text, and the core of this path. Instruction sets, arithmetic, the pipelined datapath, memory hierarchy and I/O, all with the performance equations that let you argue about design tradeoffs numerically.

3

Where software meets the machine

Intermediate

Connect architecture back to the code you write — how compilers lay out data, why cache behaviour dominates performance, and what a modern out-of-order processor is doing to your instruction stream.

Study plan for this stage

Pace: 14-16 weeks. Computer Systems: A Programmer's Perspective is 1,128 pages and has the best lab assignments in the discipline — ten to twelve weeks, and do the labs. Inside the Machine (320 pages) is a three-week reward at the end, read straight through.

Key concepts
  • Machine-level representation of programs: how C constructs — structs, arrays, switch statements, function calls — become x86-64 instructions, and what the stack frame actually looks like in memory
  • The memory hierarchy chapter, which is the most consequential in the book for a working programmer: cache lines, associativity, the three kinds of miss (compulsory, capacity, conflict), and why loop order over a 2D array can change runtime by an order of magnitude
  • Locality as a property you can design for, not observe after the fact — spatial and temporal, and the specific transformations (blocking, loop interchange, structure-of-arrays) that improve each
  • Linking, static and dynamic, and why symbol resolution and relocation are worth understanding rather than treating as build-system magic
  • Exceptional control flow — interrupts, traps, signals, process context switches — which is where architecture and operating system meet and which the earlier books largely deferred
  • Stokes's tour of shipped microarchitectures: the Pentium family, PowerPC, Core, explained as sequences of design decisions under commercial constraints rather than as textbook diagrams
  • Superscalar execution and out-of-order issue introduced concretely here — multiple instructions per cycle, reorder buffers, and the fact that the sequential program you wrote is not the order the machine executes
  • The commercial dimension Stokes adds: the Pentium 4's deep pipeline chasing clock rate, and why that bet lost. Architecture decisions have market consequences, and this is where you first see it
You should be able to answer
  • Explain, with a cache-line calculation, why iterating a 2D array row-major and column-major differ so much in runtime. Do the arithmetic for a specific cache size
  • Trace a function call through the stack frame at the assembly level, including where arguments and the return address live. Where does a stack buffer overflow get its power from?
  • What is the difference between a cache miss you can eliminate by blocking and one you cannot? Classify three real examples
  • Stokes explains the Pentium 4's design bet. Using the performance equation from stage 2, state exactly what the bet was in terms of CPI and clock period, and why it failed
  • What does an out-of-order processor guarantee about the visible results of your program, and what does it not guarantee? This question becomes central in stage 4
Practice
  • Do the CS:APP labs — bomb lab, attack lab, cache lab and performance lab at minimum. The cache lab in particular converts the memory-hierarchy chapter from information into intuition
  • Take a matrix multiply, measure it, then apply loop blocking and measure again. Predict the improvement from your cache parameters before you measure, and account for the discrepancy
  • Compile the same C function at -O0 and -O2, diff the assembly, and write a paragraph explaining each transformation the compiler made and which architectural feature it is exploiting
  • Pick one microarchitecture from Inside the Machine and draw its pipeline next to the five-stage pipeline from stage 2. Label every stage that has no counterpart in the simple version and say what each is for
  • Write 400 words explaining to a colleague why their code is slow, using cache behaviour and a specific calculation rather than general advice

Next up: You have seen real microarchitectures and felt the memory hierarchy in measured runtimes, which is the practical grounding the quantitative literature assumes.

Computer Systems: A Programmer's Perspective (3rd Edition)
Randal E. Bryant · 2015 · 1128 pp

The single most useful book here for a working programmer: machine-level representation, linking, exceptional control flow and the memory hierarchy, all framed by their effect on real program performance.

Inside the Machine
Jon Stokes · 2006 · 320 pp

An illustrated tour of actual shipped microarchitectures — Pentium, PowerPC, Core — explaining superscalar execution and pipelining through real design decisions. The bridge from teaching machines to commercial ones.

4

Quantitative architecture

Intermediate

Evaluate architectural choices the way designers do — with quantitative models of instruction-level parallelism, cache and memory behaviour, coherence protocols and multiprocessor scaling.

Study plan for this stage

Pace: 40+ weeks, and this stage is a year of serious study rather than a reading list. Computer Architecture: A Quantitative Approach (936 pages) is twelve to sixteen weeks with the appendices. Modern Processor Design (642 pages) eight to ten weeks. A Primer on Memory Consistency and Cache Coherence (294

Key concepts
  • The quantitative method itself, which is the book's real subject: architectural claims are argued from measured benchmark data and cost models, not from plausibility. Hennessy and Patterson's insistence on this is why the book is the standard
  • Instruction-level parallelism and its limits — Tomasulo's algorithm, register renaming, speculation, and the empirical ceiling on extractable ILP that ended the single-core scaling era
  • Memory hierarchy design as an optimisation problem: multi-level caches, way prediction, non-blocking caches, prefetching, and the ten advanced optimisations the book treats systematically
  • Domain-specific architectures, which is the modern chapter — TPUs and accelerators as the answer to the end of general-purpose scaling, and the argument for specialisation as the remaining source of gains
  • Shen's deeper treatment of the superscalar core: dynamic scheduling, the reorder buffer, branch prediction schemes in detail, and speculation recovery. This is the book for anyone whose interest is the processor itself
  • Cache coherence versus memory consistency, which Sorin separates cleanly and which most engineers conflate: coherence is about a single location's value, consistency is about the order of operations across locations
  • Coherence protocols concretely — MSI, MESI, MOESI, snooping versus directory-based — and consistency models from sequential consistency through total store order to relaxed models, with the fences that recover ordering
  • Culler's shift of subject: at multiprocessor scale, architecture becomes a question about communication — interconnect topology, latency and bandwidth, synchronisation cost — rather than about computation
You should be able to answer
  • Work Tomasulo's algorithm by hand on an instruction sequence and show the reservation-station state each cycle. If you cannot, you do not yet understand dynamic scheduling
  • Use Amdahl's law to bound the speedup of a program that is 90 percent parallelisable on 64 cores. Then explain why real multicore performance falls short even of that bound
  • Give an example of a program behaviour that is legal under total store order and illegal under sequential consistency. Then write the fence that fixes it
  • Coherence and consistency are different problems. State each in one sentence and give an example of a system that solves one and not the other
  • Hennessy and Patterson argue for domain-specific architectures as the remaining source of performance gains. What is the strongest objection, and what would the evidence for it look like?
Practice
  • Work through the quantitative exercises at the end of the ILP and memory-hierarchy chapters, with the arithmetic done rather than the answers read. These chapters are exercise-driven by design
  • Simulate a cache with a tool such as a simple trace-driven simulator, vary associativity and line size across a real program trace, and plot the miss rate. Then explain each inflection point using the three-kinds-of-miss taxonomy from stage 3
  • Implement MSI and then MESI as a state machine on paper for two cores, and hand-trace a sequence of reads and writes through both. The extra state in MESI should visibly save a transaction
  • Write a small program that exhibits a memory-ordering bug on a relaxed-consistency machine, then fix it with the minimum necessary fences and explain what each fence guarantees
  • Take the one-page machine diagram you have been extending since stage 1 and produce a final version: the simple Hack machine on one side, a modern multicore with a cache hierarchy and interconnect on the other, with every feature annotated by the problem it solves. That single sheet is the deliverable of this path

Next up: This is the end of the path: you can read a processor's architectural documentation, evaluate a design claim against measured data, and say what any given feature is there to fix.

Computer architecture : a quantitative approach
John L. Hennessy · 2019 · 936 pp

The graduate standard, and the reason to have done everything above: pipelining, ILP, memory hierarchy design, vector and domain-specific accelerators, all argued with measurements rather than assertions.

Modern processor design
John Paul Shen · 2005 · 642 pp

Goes deeper than Hennessy and Patterson on superscalar microarchitecture specifically — register renaming, dynamic scheduling, branch prediction and speculation. The right follow-up if the processor core is your interest.

A primer on memory consistency and cache coherence
Daniel J. Sorin · 2011 · 294 pp

Short, precise, and the clearest treatment anywhere of the two ideas that make multicore hard. Read before the parallel architecture literature, which assumes both.

Parallel computer architecture
David E. Culler · 1998 · 1063 pp

The classic treatment of shared-memory and message-passing multiprocessors, interconnects and scaling. A fitting close: the point where architecture becomes a question of communication rather than computation.

Discussion

Keep reading

Paths that share books, cover the same subject, or open a related topic.

Shares 2 books

The Best Books to Learn Assembly Language, In Order

Beginner10books133 hrs4 stages
Shares 1 book

The Best Books to Learn C programming language, In Order

Beginner8books151 hrs3 stages
More on Software architecture

Software architecture reading path: from patterns to resilient systems at scale

Intermediate9books100 hrs4 stages
More on Computer vision

Computer vision reading path: from image basics to deep learning models

Intermediate10books139 hrs4 stages

More on computer architecture