nand2tetris

  • Build a Modern Computer from First Principles
  • Don’t worry about the “how”[^1], only about the “what”1

The goal of the course is to build an understanding of how computing and software works, starting from the bottom up, with Nand gates^3.

Notes

In 0.2 they mentioned that the HACK computer could run any type of program you can imagine, but then proceed to list just games.

[assembly], it’s a very low level language, very inconvenient

Logic

A gate is a logic operation. Gates can be combined into boolean expressions. These can often be manipulated and reduced. Another way to simplify an expression is by looking at its truth-table and see if there is a simpler expression for it.

NOT(NOT(x) AND NOT(x OR y)) = x OR y

Creating the function from the truth-table is at the heart of computer design. You do that by going through each row of the truth-table where the result is 1 and figure out a function for this row only. Then you join all of these function by OR and than reduce that construct. Any boolean function can be represented by AND, OR, and NOT … or even just AND and NOT. Hence the NAND gate :D

Words…

  • boolean identities
  • commutative/associative/distributive laws
  • De Morgan Laws…

Gates

  • NOT (unary), flips value
  • AND, only two 1 = 1
  • OR, either is 1 = 1
  • NAND, either is 0 = 1

See also

^1

Footnotes

  1. abstraction: what the programming language promises to do