01 / Reading Guide
Reading Guide
Citation
Nisan, N., & Schocken, S. (2021). The Elements of Computing Systems: Building a Modern Computer from First Principles (2nd ed.). MIT Press.
Chapter Summary
The second edition, about 344 pages, leads readers through twelve chapters, each paired with a project, that together build a simple but complete computer system: the hardware platform first, then the software hierarchy on top of it. The journey, known as Nand to Tetris, starts from a single elementary logic gate, Nand, and ends with a general-purpose computer able to run Tetris or any other program. According to the publisher, this edition was extensively revised: it is split into Part I, Hardware, and Part II, Software, with six projects in each; every chapter and project was rewritten with an emphasis on separating abstraction from implementation; and substantial new appendices treat technical and theoretical topics in focus. All projects are done with free software tools from the authors' Nand to Tetris website, including a hardware simulator, a CPU emulator and a VM emulator, so no physical hardware is needed. Google Books lists the chapter titles in short form; the website's project pages identify the two virtual-machine and the two compiler chapters.
Chapter 1: Boolean Logic
Starting from the Nand gate as the only primitive, readers build the elementary logic gates (Not, And, Or, Xor, multiplexor and demultiplexor) and their 16-bit and multi-way versions, the building blocks from which the CPU and RAM are later made.
Chapter 2: Boolean Arithmetic
Gate logic for binary arithmetic: half and full adders, a 16-bit adder and incrementer, and finally the arithmetic logic unit (ALU) of the Hack computer, the one chip in this sequence that is specific to this architecture.
Chapter 3: Memory
How gate logic can store bits over time and how memory registers are addressed. Using a data flip-flop as the primitive, readers build a 1-bit register, a 16-bit register, RAM units from 8 up to 16K registers, and a program counter.
Chapter 4: Machine Language
The computer described from the programmer's side: the Hack machine language that the finished hardware will execute and its symbolic assembly form. In the project readers write and test two low-level assembly programs (one multiplies numbers) on the supplied CPU emulator.
Chapter 5: Computer Architecture
The ALU and RAM from earlier chapters are put together into the Hack CPU, the full memory address space and the top-level Computer chip: a general-purpose computer that runs programs written in the machine language of Chapter 4.
Chapter 6: Assembler
The first software project: a program that translates symbolic Hack assembly into binary machine code. It closes Part I; Part II, Software, begins on the next page with an introduction of its own.
Chapters 7–8: Processing; Control
The two virtual-machine chapters. Following the model of the Java and .NET platforms, the book defines a stack-based VM language and has readers write a translator from VM code into Hack assembly. Chapter 7 (Project 7, "VM I: Stack Arithmetic") covers the VM specification, arithmetic and logical commands and the memory-access commands over eight memory segments, with the mapping of the VM onto the Hack platform; Chapter 8 (Project 8, "VM II: Program Control") extends the translator to branching and function calls.
Chapter 9: High-Level Language
Introduces Jack, a simple, Java-like, object-based language. In the matching project, using the services of the Jack operating system, readers write a small game or interactive program in Jack, to become familiar with the language before compiling it.
Chapters 10–11: Syntax Analysis; Code Generation
The two compiler chapters (Projects 10 and 11, "Compiler I" and "Compiler II"). The Jack compiler is two-tiered: Chapters 7–8 built its back end, and these chapters build the front end. Chapter 10 develops a tokenizer and a parser that follows the Jack grammar, tested by producing XML output; Chapter 11, at more than thirty pages the longest in the book, adds a symbol table and turns the parser into a code generator that emits VM code.
Chapter 12: Operating System
The operating system as a collection of services that closes the gap between hardware and application software. Readers implement the Jack OS, eight classes (Math, Memory, Array, String, Output, Screen, Keyboard and Sys), in Jack itself; the project page notes that this involves a set of classic algorithms of applied computer science.
Chapter 13: More Fun to Go
A four-page closing chapter.
Appendices
About forty pages of appendices give focused presentations of technical and theoretical topics that support the projects.
Key Concepts
Part I: Hardware (Chapters 1–6)
- Nand as a universal gate: every other logic gate, and hence the whole computer, can be built from Nand gates.
- Combinational and sequential logic: chips whose output depends only on current inputs, and chips that hold state from one clock cycle to the next.
- Arithmetic logic unit: the chip that computes arithmetic and logical functions on binary numbers.
- Machine language and the stored-program computer: instructions held in memory and executed by the CPU.
- Assembler: the translator from symbolic assembly language to binary machine code.
Part II: Software (Chapters 7–13)
- Virtual machine: an intermediate, stack-based abstraction between high-level languages and machine code.
- Stack arithmetic and memory segments: how the VM computes on a stack and addresses its variables.
- Syntax analysis: parsing source code according to a grammar.
- Code generation: translating a parsed program into lower-level code.
- Operating system services: library routines that give a high-level language access to memory, input and output.
- Abstraction and implementation: the principle, stressed in this edition, of specifying each layer's interface separately from how it is built.
Critical Analysis
Strengths
- One coherent system, built by the reader. Each of the twelve chapters has a project whose result is used by later ones, so students experience how gates, CPU, assembler, VM, compiler and operating system fit together rather than studying them in separate courses. The publisher lists hardware, architecture, operating systems, programming languages, compilers, data structures and algorithms, and software engineering among the subjects learned this way.
- Free, complete tooling. The authors' website provides the simulators, emulators, test scripts and compare files for every project; each project comes with a precise contract and staged tests, as the Project 7 page shows. Everything is free and open-source for non-profit use, and the site reports that Nand to Tetris courses are taught at more than 400 universities, high schools and bootcamps.
- Abstraction separated from implementation. The publisher says every chapter of the second edition was rewritten to separate abstraction from implementation, and the project pages reflect this: each states a contract (a chip interface, a VM specification and mapping, an API) that the student's implementation must satisfy and test against.
- Flexible structure. The split into two six-project parts means that a course can take only the hardware or only the software half. The website also offers an extended syllabus of a typical course and points to paid Coursera versions with certificates.
Limitations
- A deliberately simple machine. The Hack computer is designed for teaching; the book does not cover pipelining, caches, performance measurement or real instruction sets, which are the subject of standard architecture textbooks.
- Demanding software half. The projects in Part II (assembler, VM translator, compiler and OS) require reasonable programming skill in a language of the reader's choice and considerable time; Chapter 11 on code generation is the longest in the book.
- Edition mismatch in free materials. The website states that some project pages link to book chapters mostly from the first edition, whose chapter structure and titles differ (for example, the first edition's Chapter 3 is "Sequential Logic", the second edition's "Memory"). Readers combining the free chapters with the second edition need to check which version they are using.
Where It Fits in the Course
This is the hands-on core of the computer architecture course for readers new to the subject. Charles Petzold's Code covers similar ground, from switches and gates to a working CPU, as a narrative without exercises; it makes a gentle preparation for Part I or a companion when a project feels abstract. Harris and Harris's Digital Design and Computer Architecture, RISC-V Edition takes the hardware further, with hardware description languages, a real instruction set and a pipelined processor, and is the natural next step after Chapters 1–5.
Bryant and O'Hallaron's Computer Systems: A Programmer's Perspective examines real machines from the programmer's side (machine code, memory, linking, processes) and complements Part II. Hennessy and Patterson's Computer Architecture: A Quantitative Approach and Shen and Lipasti's Modern Processor Design treat the performance techniques of modern processors and assume a computer organization course; read them after this book, not instead of it.
How to Use This Book
The book suits first- and second-year students in a computer systems or organization course, self-learners who want to see what lies beneath high-level code, and instructors running laboratory courses. No electronics background is needed. Programming experience in some high-level language is needed for Part II, where readers write an assembler, a VM translator and a compiler in a language of their choice.
- Work in order. Each project depends on the previous one. Read the chapter, implement the project with the supplied tools, and run the supplied tests before moving on.
- Hardware only: Chapters 1–6 make a complete hardware-and-assembler course of six projects.
- Software only: Part II can be studied on its own; the provided tools and the specifications in the book stand in for the hardware.
- Plan time for Chapters 10–11. The compiler is the largest single piece of work.
- Appendices: consult them as the projects require.
Download the tools and project files from the Nand to Tetris website, and use the staged tests in each project exactly as the project pages suggest: unit-test small pieces, then the whole. If you use the free first-edition chapters linked from the site, compare them with the second edition's specifications before implementing. Keep your own code from each project, since later projects build on it.
