NAND gates are simply the opposite of AND gates.
Y = A NAND B or Y = NOT(A AND B)
In programming it can be written as Y = A !& B or Y = !(A && B).
NAND Gate Truth Table
A | B | Y |
---|---|---|
0 | 0 | 1 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
NAND Gates are just simplified combination of AND and NOT gates.
NAND From AND and NOT Truth Table
A | B | P0 (A AND B) | Y (NOT(A AND B)) |
---|---|---|---|
0 | 0 | 0 | 1 |
0 | 1 | 0 | 1 |
1 | 0 | 0 | 1 |
1 | 1 | 1 | 0 |