NAND theorem
Youtube
#The NAND Gate
NAND
| A | B | OUT |
|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
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
- Not
- And
- Or
- Xor
- Mux(hardest), aka selector in nandgame
- DMux(hardest), aka switch in nandgame
16-bit variants
nandgame does not have these but it’s easy to do in HDL
- Not16
- And16
- Or16
- Mux16
Multiway Variants
- Or8Way
- Mux4Way16
- Mux8Way16
- DMux4Way
- 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)
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.
#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!