What Are NAND / NOR / XOR Gates?
NAND, NOR and XOR are common logic gates derived from the three basic gates (AND/OR/NOT). For the general concept see the what are logic gates article.
NAND Gate
It's the inverse of AND: the output is 0 if all inputs are 1, and 1 in all other cases. Its classic IC is the 7400, one of the most-used logic chips.
NOR Gate
It's the inverse of OR: the output is 0 if at least one input is 1. Its IC is the 7402.
XOR Gate
The output is 1 if the inputs are different from each other (0 if equal). It's fundamental in adder circuits and equality checks; its IC is the 7486.
| A | B | NAND | XOR |
|---|---|---|---|
| 0 | 0 | 1 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 1 | 0 | 0 |
The Universal Gate Concept
NAND and NOR are "universal gates": using only NAND (or only NOR) any logic function, including AND, OR and NOT, can be built. That's why they're fundamental building blocks in chip production.
XNOR (Equality) Gate
The XNOR, the inverse of XOR, makes the output 1 if the inputs are equal to each other; so it's also known as the "equality gate". It's used together with XOR in comparison and parity (error-check) circuits. A common IC is the 74266.
Common Mistakes
- Confusing OR and XOR: in OR 1+1=1, in XOR 1+1=0.
- Floating input: unused inputs must be tied to a fixed level.
- Wrong family: TTL or CMOS must be chosen correctly for speed/power.
Frequently Asked Questions
Why is NAND so common?+
Where is XOR used?+
Search parts related to "What Are NAND / NOR / XOR Gates?"
Find the right part by comparing price, stock and distributors.