NAND theorem

Youtube

#The NAND Gate

NAND
ABOUT
001
011
101
110

Above is the NAND gate(aka NOT AND), which outputs 0 if and only if both inputs are 1, and outputs 1 otherwise. It looks like an AND gate, just with a bubble at the end, which represents the NOT operation.

#Building the NAND Gate

Let's build the NAND gate!

We can build a NAND gate by cleverly arranging Relays. Relay’s have a wire wrapped around an magnetic rod. When electricity runs through the coil, it creates a magnetic field that can pull down a lever which then outputs electricity depending.

#The Universal Gate

The NAND is also known as the “universal gate”, meaning it can be used to build all the other gates, like AND, NOT, OR, etc.

Elementary Logic Gates

  1. Not
  2. And
  3. Or
  4. Xor
  5. Mux(hardest), aka selector in nandgame
  6. DMux(hardest), aka switch in nandgame

16-bit variants

nandgame does not have these but it’s easy to do in HDL

  1. Not16
  2. And16
  3. Or16
  4. Mux16

Multiway Variants

  1. Or8Way
  2. Mux4Way16
  3. Mux8Way16
  4. DMux4Way
  5. DMux8Way

So, you are tasked to start off with a NAND gate, and work your way up to build other gates, and when you have built those other gates, you can use those gates you built to build other gates. It’s recommended you do it in the order above because the difficulty increases as you go down the list.

#Resources

Nand Game (drag and drop gates)

Nand2Tetris Web IDE (text based chip diagrams)

I recommend you first use the visual NAND game, since the UI is more intuitive, and then transcribe what you did to HDL using the online web IDE.

Chip truth tables and specs (pages 19 to 28)

#HDL

HDL also known as Hardware Description Language is what real chip designers use and we have stripped it down to its bare bones to make it easier to learn.

It is NOT a programming language in the typical sense.

  • No loops
  • No conditionals(if else)
  • No Functions

You just plug in variables to outputs.
It is case sensitive, mandatory semicolons, commands, becareful of typos!