IGCSE Computer Science · Tool
Logic and truth tables
How do you complete a truth table for a logic circuit?
List every combination of the inputs (2 inputs give 4 rows, 3 inputs give 8), then work out each gate’s output in turn, with a column for each. AND outputs 1 only when both inputs are 1, OR when at least one is, XOR when exactly one is, and NOT inverts its input.
Q = (A AND B) OR NOT C
Truth table · your row is highlighted
| A | B | C | A AND B | NOT C | Q |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 | 1 |
A AND B is 1, so the OR gate gives 1 whatever C is.
Free to use here, with no account.
What to take away
- A truth table lists every combination of inputs: 2ⁿ rows for n inputs.
- AND outputs 1 only if both inputs are 1; OR if at least one is; XOR if exactly one is.
- NAND and NOR give the opposite output to AND and OR.
Common mistakes
- Confusing OR with XOR when both inputs are 1: OR gives 1, XOR gives 0.
- Leaving out input combinations: three inputs need all 8 rows.
Questions
How do you complete a truth table for a logic circuit?
List every combination of the inputs (2 inputs give 4 rows, 3 inputs give 8), then work out each gate’s output in turn, with a column for each. AND outputs 1 only when both inputs are 1, OR when at least one is, XOR when exactly one is, and NOT inverts its input.
How many rows does a truth table with three inputs need?
Eight, one for each combination of three inputs that can each be 0 or 1: 2 × 2 × 2 = 8.
Is the logic simulator free?
Yes. It runs here in your browser with no account, and every ConceptOrbit course tool is free.
More to try
- IGCSE Computer Science · SimulationBubble sort, step by step How does bubble sort work?
- IGCSE Physics · SimulationBalance the beam What is the principle of moments?
- IGCSE Physics · SimulationPhases of the Moon Why does the Moon have phases?
- IGCSE Maths · SimulationProbability with two dice What is the most likely total when you throw two dice?
- IGCSE Maths · ToolGraphing calculator How do you find the roots and turning point of a quadratic graph?
- IGCSE Physics · ToolCircuits How do you work out resistance in series and in parallel?
113 lessons and 51 simulations in IGCSE Computer Science open at launch. The first 50 people to confirm their email get 50% off, and the next 50 get 25% off. Discounts are announced when ConceptOrbit opens.