The Benedict Year › The workshop

Project 3 · Weeks 13–15

Memory

A chip that remembers. With a clock, the machine gets a before and an after, and from one remembered bit you build registers, memory and a counter.

Beside Unit 5 · Memory

In the course: Project 3, Memory · slides and project notes at nand2tetris.org

The kind of answer

Dated. A flip-flop gives out now what it was given one tick ago. It is the first part of the machine with a past, and the clock is what dates it. The unit’s rule holds here too: first the order of the ticks, then the values.

On paper first

Draw a clock as a row of ticks along the bottom of a page. Above it, write what a one-bit memory holds at each tick if you tell it to “load 1” at tick 3 and “load 0” at tick 7.

What you build

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

  • Bit
  • Register
  • RAM8
  • RAM64
  • RAM512
  • RAM4K
  • RAM16K
  • PC

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 133.1; 3.2Ticks and the flip-flop. Build Bit, then Register out of Bits.
Week 143.3RAM8, then RAM64 out of RAM8s: the same pattern again, one size up.
Week 153.4; 3.5; 3.6RAM512, RAM4K and RAM16K, then the program counter, PC.

The lectures

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

For the parent

The flip-flop (DFF) is the one chip the course gives rather than has you build. It is taken on trust, as a given. A wire may loop back on itself only through a DFF; that is how the clock gives the machine a past.

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.