The Benedict Year › The workshop

Project 5 · Weeks 25–30

The computer

Everything comes together: memory, the processor that runs the instructions, and the whole computer, which runs any program in the language you learned.

Beside Unit 9 · The Act and Unit 10 · The City

In the course: Project 5, Computer Architecture · slides and project notes at nand2tetris.org

The kind of answer

Judged, and supplied. At each tick the processor decodes one instruction and acts on it, and what it does is settled by that instruction alone. The computer is a small city of parts, each given what the whole needs from it and nothing more.

On paper first

Write one instruction, for example D=M+1, as its sixteen bits. Underline the bits that choose what the ALU computes, and circle the ones that say where the answer goes.

What you build

In the Hardware Simulator, choose Project 5 from the list at the top, then each chip in turn.

  • Memory
  • CPU
  • Computer

Each one is done when its test passes in the IDE. A pass cannot be argued with, and neither can a fail.

Week by week

About an afternoon a week. If a week runs long, let it: the strand keeps its own order, not the calendar’s.

WeekWatchDo
Week 255.1; 5.2The idea of a stored-program computer, and the fetch-execute cycle: fetch an instruction, carry it out, fetch the next.
Week 265.3The CPU, explained. Copy the course’s CPU diagram large onto graph paper.
Week 275.4The whole Hack computer: memory, CPU and the program’s memory together.
Week 285.5Build Memory: the RAM, the screen and the keyboard joined into one address space.
Week 29—Build the CPU, one part of the diagram at a time. Label every control wire with the instruction bit that drives it.
Week 305.6Build the Computer, and run its tests: your computer runs the course’s programs.

The lectures

6 lectures, about 95 minutes in all, by Nisan and Schocken. Watch with your parent, one or two at a sitting.

For the parent

The CPU is the hardest chip in Part I. Let it take two weeks if it needs them, and spend the extra time on the diagram, not on the editor. Every wire in the drawing is a line of HDL.

Public domain I have dedicated this page to the public domain under CC0 1.0. Copy it, change it, translate it, print it and share it, for any purpose, without asking. Quotations from other writers keep their own terms.