Truth tables
List every input combination and check the corresponding outputs.
Read a truth table
A truth table lists every possible input combination and the output for each one. Each row describes one case.
A circuit with n binary inputs has 2^n input combinations. Two inputs give four rows; three inputs give eight.
AND example
The first two columns are inputs A and B. The final column is the output. AND produces 1 only in the last row, where both inputs are 1.
| A | B | Output |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
OR example
OR produces 1 whenever at least one input is 1. Compare the middle two rows with the AND table.
| A | B | Output |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
Check a circuit
- Write down its inputs and outputs.
- List every input combination.
- Set the input switches to match each row.
- Record the output values and compare them with the expected behavior.
You can try this with the interactive examples in AND, OR, NOT gates. A table checks all cases, including the combinations you might miss when toggling inputs at random.