AND, OR, NOT gates
Three basic operations, with examples and truth tables.
AND, OR, and NOT operate on binary values: 0 and 1. Their outputs follow a small set of rules.
AND gate
AND outputs 1 when both inputs are 1. Try turning on either input alone, then both together.
Click an input to change its value.
| A | B | Output |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
OR gate
OR outputs 1 when at least one input is 1. Compare its output with AND when only one switch is on.
Click an input to change its value.
| A | B | Output |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
NOT gate
NOT has one input and one output. It inverts the input: 0 becomes 1, and 1 becomes 0.
| Input | Output |
|---|---|
| 0 | 1 |
| 1 | 0 |
Combine gates
A gate’s output can become another gate’s input. Placing NOT after AND gives NAND; placing NOT after OR gives NOR.
Continue with NAND and NOR gates to compare these inverted outputs.