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

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

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

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

#Multiway Variants

NOTE: nandgame does not have these

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

Your task is to build all of these gates starting only from a NAND gate. Once you’ve successfully built a gate, you may use it as a building block for the gates that follow.

For example:

First, build the Not gate using only NAND gates.
After that, you may use both NAND and Not gates to build the And gate.
Continue this process for the remaining gates.

It is highly recommended to follow the order listed above, since the gates become progressively more challenging as you move down the list.

#Hardware Simulator

Nand Game (drag and drop gates)
Nand2Tetris Web IDE (text based chip diagrams)
Circuitverse (alternative diagraming)

I highly 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.

#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!