16 min read
Logic and Truth Tables
Inputs and outputs are 1 or 0. A truth table lists every combination of inputs and the output for each.
True and False as 1 and 0
In logic, a statement is either true or false. We write true as 1 and false as 0 — the same as on and off in a circuit.
We give each input a capital letter: A, B, C … The output is often called Q or X.
How Many Rows?
Each input can be 0 or 1. With n inputs there are 2ⁿ combinations, so the truth table has 2ⁿ rows.
| Inputs | Rows |
|---|---|
| 1 | 2 |
| 2 | 4 |
| 3 | 8 |
| 4 | 16 |
Listing the Rows Without Missing Any
The safest way is to count in binary, starting from 0. For three inputs A, B and C, count from 000 to 111:
| The 8 input combinations for A, B, C | |||
|---|---|---|---|
Practice
A circuit has 4 inputs. How many rows does its truth table have?
Your answer
More lessons in Boolean Algebra and Logic Gates · Next: AND, OR and NOT Gates · Previous: Introduction
