What Are Logic Gates? (AND, OR, NOT, NAND)
1 min read
Quick answer
Logic gates are the smallest building blocks of digital circuits. They take one or more 0/1 (LOW/HIGH) inputs, process them by a set rule, and produce a single 0/1 output. All microchips are made of billions of these gates.
What Is a Logic Gate?
Each gate applies a logic rule to its inputs. The inputs and output are represented by logic levels (0 = LOW, 1 = HIGH). A gate's behavior is fully defined by a truth table.
Basic Gates
| Gate | Rule | Output is 1 when… |
|---|---|---|
| AND | All are 1 | all inputs are 1 |
| OR | At least one is 1 | any input is 1 |
| NOT | Inverter | input is 0 |
| NAND | The inverse of AND | at least one input is 0 |
| XOR | Inputs differ | inputs are not equal |
Truth Table Example (AND)
| A | B | A AND B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Why Is NAND Important?
NAND is the "universal gate": using only NAND gates you can build all logic functions, including AND, OR and NOT. That's why it's used so much as a basic building block in chip manufacturing.
Common Mistakes
- Confusing OR with XOR: in OR 1+1=1; in XOR 1+1=0 (if inputs are equal the output is 0).
- Floating input: an unconnected gate input is undefined; it needs a pull-up/pull-down.
- Supply/level compatibility: connecting different logic families (TTL/CMOS) directly can cause problems.
Frequently Asked Questions
How many basic logic gates are there?+
Three basic gates (AND, OR, NOT) and the derived NAND, NOR, XOR, XNOR are commonly used.
Where are logic gates found?+
Inside processors, memories and all digital circuits; they're also sold as separate ICs (e.g. the 74 series).
Search related parts in our catalog
Find the right part by comparing price, stock and distributors.