Syllabus & Goals 3 min
Cambridge 10.1 · Expressions and circuits from a truth table Paper 2 · Algorithms, Programming and Logic
By the end of this lesson you can:
- Write a logic expression from any 2- or 3-input truth table.
- Draw the matching logic circuit using gates with no more than two inputs.
- Show, with a truth table, that two expressions give the same output.
Textbook: Chapter 10, §10.3 Examples 4 and 5, Activity 10.3 (pp. 367–370)
Recap / Warm-Up 5 min
Last lesson you went from expression to circuit and back. Today you start from the truth table alone.
Quick starter
Which single row of a two-input truth table makes A AND NOT B equal 1?
Reveal the answer
Only A = 1, B = 0. AND needs A = 1 and NOT B = 1, so B must be 0.
Key Concept 14 min
1 · Only the rows where X = 1 matter
Each row where X = 1 describes one exact situation that switches the output on. Write that situation as an AND of every input: the letter if it is 1, NOT the letter if it is 0. Then join the situations with OR, because any one of them is enough.
- Circle every row where the output is 1. Rows with X = 0 are covered automatically: none of the terms match them.
- For each circled row, write (… AND … AND …) using every input. A term is 1 in its own row and 0 in every other row.
- Join the terms with OR. X must be 1 if any circled row happens.
- Check one row with X = 0 against your expression. A quick check catches a missed NOT.
2 · Drawing it with two-input gates
IGCSE questions often say gates may have no more than two inputs. A three-input term such as NOT A AND B AND C is then two AND gates in a chain: (NOT A AND B), then AND C. Three terms need two OR gates in the same way.
Worked Example 12 min
(a) A two-input truth table
| A | B | X |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
- X = 1 in rows 01 and 10. These are the only rows we use.
- Row 01: A is 0 and B is 1, giving (NOT A AND B). 0 becomes NOT.
- Row 10: A is 1 and B is 0, giving (A AND NOT B).
- Join with OR. Either row switches X on.
X = (NOT A AND B) OR (A AND NOT B)
(b) A three-input truth table
| A | B | C | X |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 0 |
- X = 1 in rows 011 and 110.
- Row 011 gives (NOT A AND B AND C). Only A is 0.
- Row 110 gives (A AND B AND NOT C). Only C is 0.
- Join with OR, then draw each three-input AND as two chained two-input AND gates. The question limits gates to two inputs.
X = (NOT A AND B AND C) OR (A AND B AND NOT C)
(c) Show that two expressions give the same output
Show that (A AND B) OR (A AND C) gives the same output as A AND (B OR C).
| Inputs | Working | Output | |||||
|---|---|---|---|---|---|---|---|
| A | B | C | A AND B | A AND C | (A AND B) OR (A AND C) | B OR C | A AND (B OR C) |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 0 | 0 | 1 | 0 |
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 1 | 1 | 1 | 1 |
| 1 | 1 | 0 | 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
The two output columns match in all 8 rows, so the expressions are equivalent. Always state that conclusion.
Try It Yourself 12 min
Goal: Write the logic expression for this table, then draw the circuit.
| A | B | X |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Goal: Write the logic expression for this table.
| A | B | C | X |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 |
Goal: Write the expression for this table and draw its circuit with two-input gates only. Then find a shorter expression and prove with a truth table that it matches.
| A | B | C | X |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 |
Hint
Three rows give three terms and two OR gates. For the shortcut, notice C is 1 in every row where X = 1.
📝 Exam Practice 10 min
Write a logic expression for this truth table. Do not simplify it.
| A | B | C | X |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 0 |
Mark scheme
- (NOT A AND B AND NOT C) (1)
- (A AND NOT B AND C) (1)
- Both terms joined with OR (1).
Identify the single logic gate that gives the same output as (NOT A AND NOT B) OR (NOT A AND B) OR (A AND NOT B).
Mark scheme
- NAND (1). (Outputs 1, 1, 1, 0.)
Show that (A OR B) AND NOT (A AND B) gives the same output as A XOR B.
Mark scheme
- Correct working for A OR B and A AND B (1).
- Correct final column 0, 1, 1, 0 (1).
- Statement that this matches XOR in every row (1).
| Inputs | Working | Output | |||
|---|---|---|---|---|---|
| A | B | A OR B | NOT (A AND B) | result | A XOR B |
| 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 | 1 | 1 |
| 1 | 1 | 1 | 0 | 0 | 0 |
Recap & Key Terms 3 min
Take each row where X = 1, AND together every input (NOT for a 0), and OR the terms. Draw long ANDs as chains of two-input gates. To prove two expressions equal, compare their truth tables row by row.
- Term
- An AND of every input (with NOT on each 0) that is 1 in exactly one row of the truth table.
- Equivalent expressions
- Two expressions whose truth tables give the same output in every row.
- Two-input gate
- A gate with at most two inputs; longer ANDs and ORs are built by chaining them.
- Truth table
- A list of every input combination and its output; the starting point for this method.
Homework 1 min
Task (≤ 15 min): Write the logic expression for this table and describe the circuit, gate by gate, using only two-input gates.
| A | B | C | X |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 |
Model answer
- X = (A AND NOT B AND NOT C) OR (A AND B AND C).
- NOT gates on B and C; AND gate (A, NOT B), then AND with NOT C.
- AND gate (A, B), then AND with C.
- OR gate joining the two chains to give X.