You are on page 1of 2

Boolean Algebra - NAND Logic

The NAND function is a universal function because with one or more NAND gates you can implement
any logic function.

Here is how the NAND gate works:

Q = A NAND B = NOT(A AND B)

a b Q

0 0 1

0 1 1

1 0 1

1 1 0
*This is the truth table for NAND

I will show you the first implementation and truth table, your task is to complete the rest using only NAND
gates.

AND Gate

a b Q

0 0 0

Q = a AND b 0 1 0

1 0 0

1 1 1

a b S = a NAND b Q = S NAND S

0 0 1 0

0 1 1 0

1 0 1 0
Q = (a NAND b) NAND (a NAND b) = a NAND b
1 1 0 1
NOT Gate

a Q

0 1

1 0

OR Gate

a b Q

0 0 0

0 1 1
Q = a OR b
1 0 1

1 1 1

NOR Gate

a b Q

0 0 1

0 1 0
Q = a NOR b = NOT( a OR b)
1 0 0

1 1 0

XOR Gate (*this one is a bit tricky)

a b Q

0 0 0

0 1 1
Q = a XOR b
1 0 1

1 1 0

You might also like