← All concepts
TechnologyBasic theoryInteractive
Boolean logic & gates
Boolean algebra and the seven logic gates, with truth tables you can toggle.
Logic gate explorer
0
| A | B | AND |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Boolean algebra works with two values, 0 (false) and 1 (true). Logic gates are the hardware that implements the Boolean operators, and they are the building blocks of every digital circuit.
The gates
| Gate | Output is 1 when… |
|---|---|
| AND | both inputs are 1 |
| OR | at least one input is 1 |
| NOT | the single input is 0 (it inverts) |
| NAND | NOT of AND — 0 only when both inputs are 1 |
| NOR | NOT of OR — 1 only when both inputs are 0 |
| XOR | the inputs differ |
| XNOR | the inputs are the same |
Laws worth memorising
- Identity:
A·1 = A,A+0 = A. - Complement:
A·Ā = 0,A+Ā = 1. - De Morgan's:
¬(A·B) = Ā+B̄and¬(A+B) = Ā·B̄.
Tip:NAND and NOR are *universal* — any circuit at all can be built from just one of them.
