The NAND, NOR and XOR Logic Gates

concept
The NOT, AND and OR gates we've already encountered can be considered the three "fundamental" gates however there are some more complex logic functions that we need often enough that they get packaged into their own gates. In this topic we're going to cover three more exotic gates, the NAND gate, the NOR gate and the XOR gate.
fact
The NAND gate is an AND gate followed by a NOT gate. Its symbol is:
fact
The logic table for the NAND gate is:
ABOutput
001
011
101
110
Below is an interactive NAND gate, click the inputs to toggle their values and the output will change automatically. A dark green square is 0, a light green square is 1. image/svg+xml
fact
The NOR gate is an OR gate followed by a NOT gate. Its symbol is:
fact
The logic table for the NOR gate is:
ABOutput
001
010
100
110
Below is an interactive NOR gate, click on the inputs to toggle their values and see the output change. image/svg+xml
fact
The XOR gate, called the "exclusive or" is a special gate that will output a 1 if exactly one of its inputs is 1, if both are 1 or both are 0 the XOR gate will give you a 0.
fact
The logic table for the XOR gate is:
ABOutput
000
011
101
110
Below is an interactive XOR gate example image/svg+xml
practice problems