Every digital circuit — from a simple alarm system to a full processor — is built from a small handful of basic logic gates. Everything on this site, from K-map grouping to the auto-generated circuit diagrams, ultimately compiles down to these seven. Knowing them cold makes everything else click faster.
AND
Outputs 1 only when every input is 1. Two inputs, both required:
| A | B | A AND B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
OR
Outputs 1 when at least one input is 1:
| A | B | A OR B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
NOT
The only single-input gate here — simply flips its input:
| A | NOT A |
|---|---|
| 0 | 1 |
| 1 | 0 |
NAND: AND, inverted
NAND is AND followed by NOT — 1 in every case except when both inputs are 1:
| A | B | A NAND B |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
NAND is one of two "universal" gates — any Boolean function can be built from NAND gates alone, with no separate AND, OR, or NOT needed. See NAND/NOR-Only Circuit Implementation for exactly how that conversion works.
NOR: OR, inverted
NOR is OR followed by NOT — 1 only when both inputs are 0:
| A | B | A NOR B |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
NOR is the other universal gate — equally capable of building any function alone.
XOR: "exactly one, not both"
XOR (exclusive OR) outputs 1 when its inputs differ — one is 1 and the other is 0, but not both the same:
| A | B | A XOR B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
XOR has a special relationship with K-maps worth knowing early: functions built from XOR produce a checkerboard truth table pattern that K-map grouping can't simplify at all — see the parity checker example for a fully worked demonstration.
XNOR: "the same"
XNOR is XOR inverted — 1 when both inputs match (both 0 or both 1):
| A | B | A XNOR B |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
XNOR shows up naturally in equality-checking circuits — see the magnitude comparator example, where the A=B output is built on exactly this pattern.
All seven, side by side
| A | B | AND | OR | NAND | NOR | XOR | XNOR |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 |
How these connect to everything else on this site
Every SOP expression this solver produces is literally a set of AND gates feeding one OR gate — that's what the auto-generated circuit diagram draws directly. Every POS expression is OR gates feeding one AND gate. The NAND/NOR conversion shows how to rebuild either using only universal gates, and the Boolean algebra laws are the formal rules governing how these seven gates combine and simplify.