Syllabus & Goals 3 min
Cambridge 10.1 · Logic expressions ↔ logic circuits Paper 2 · Algorithms, Programming and Logic
By the end of this lesson you can:
- Write a logic expression from a logic circuit.
- Draw a logic circuit from a logic expression, using only the six gates.
- Complete a truth table directly from a logic expression.
Textbook: Chapter 10, §10.3 Examples 2, 3 and 8 (pp. 363–364, 366–367, 375–376)
Recap / Warm-Up 5 min
Last lesson you filled truth tables from circuits, one working column per gate. Each of those columns was really a small expression.
Quick starter
A circuit has an AND gate fed by A and B. Its output goes into a NOT gate. Write the output as one expression.
Reveal the answer
X = NOT (A AND B). The brackets show that NOT applies to the whole AND. (This is the same as A NAND B.)
Key Concept 14 min
1 · A logic expression is a circuit written in words
A logic expression uses the gate names and brackets, for exampleX = (A OR NOT B) NAND (B XOR C). Every pair of brackets is one gate. The operator that sits outside every bracket is the final gate, nearest the output.
2 · Circuit → expression
- Find the gates connected directly to the inputs. Write each as a bracket, e.g.
(A NOR B). These are the innermost brackets. - Move right. For each gate, replace its inputs with the brackets that feed it. This nests the brackets in the right order.
- The last gate joins everything:
X = (…) OR (…). Its operator is the one outside all brackets.
3 · Expression → circuit
- Find the operator outside every bracket. Draw that gate on the right, with output X. It is the last thing the circuit does.
- Each bracket becomes the gate feeding one of its inputs. Work backwards from the output towards the inputs.
NOTapplies only to the next input or bracket. Draw a NOT gate on that wire. NOT B is a NOT gate on B alone.- If an input is used twice, split its wire with a junction dot. Examiners expect one labelled input line per letter.
4 · Brackets change the meaning
X = NOT A AND B
| A | B | X |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
X = NOT (A AND B)
| A | B | X |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Worked Example 12 min
(a) Write the logic expression for this circuit
- Gate 1 takes A and B: (A NOR B). It is connected straight to the inputs.
- Gate 2 takes B and C: (B AND C). The dot on B shows it feeds gates 1 and 2.
- Gate 3 takes gate 2 and input C: ((B AND C) XOR C). C reaches gate 3 directly, below gate 2.
- Gate 4 joins gates 1 and 3 with OR. This is the final gate.
X = (A NOR B) OR ((B AND C) XOR C)
Marks are usually given for each correct part: gate 1, gate 3 (which contains gate 2) and the final OR.
(b) Draw the circuit and truth table for X = (A OR NOT B) NAND (B XOR C)
- The operator outside the brackets is
NAND. Draw a NAND gate with output X. It joins the two brackets. - Left bracket: an OR gate with inputs A and NOT B. NOT B needs its own NOT gate on the B wire.
- Right bracket: an XOR gate with inputs B and C. B is used twice, so its wire splits.
- Fill the truth table with columns NOT B, P, Q and X. One column per gate, as in Lesson 3.
| Inputs | Working | Output | ||||
|---|---|---|---|---|---|---|
| A | B | C | NOT B | P = A OR NOT B | Q = B XOR C | X = P NAND Q |
| 0 | 0 | 0 | 1 | 1 | 0 | 1 |
| 0 | 0 | 1 | 1 | 1 | 1 | 0 |
| 0 | 1 | 0 | 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 0 | 0 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 1 | 1 | 1 | 1 | 0 |
| 1 | 1 | 0 | 0 | 1 | 1 | 0 |
| 1 | 1 | 1 | 0 | 1 | 0 | 1 |
Try It Yourself 12 min
Goal: Write the logic expression for this circuit.
Goal: Draw the logic circuit for X = (A NAND B) OR NOT C. Then complete its eight-row truth table.
Goal: Draw the circuit for X = ((A OR B) AND NOT C) XOR (B NOR C), using gates with no more than two inputs. Complete its truth table.
Hint
The final gate is XOR. Its left input is itself an AND gate fed by (A OR B) and NOT C. You need five gates in total.
📝 Exam Practice 10 min
Write a logic expression for this logic circuit.
Mark scheme
- (NOT A OR B) (1)
- (B NAND C) (1)
- …joined by AND: X = (NOT A OR B) AND (B NAND C) (1).
Draw a logic circuit for X = (A AND B) OR (NOT B XOR C). Each gate must have no more than two inputs.
Mark scheme
- AND gate with inputs A and B (1).
- NOT gate on B (1).
- XOR gate with inputs NOT B and C (1).
- OR gate joining the AND and XOR outputs, giving X (1).
Complete the truth table for X = (A AND B) OR (NOT B XOR C).
| Inputs | Working | Output | |||
|---|---|---|---|---|---|
| A | B | C | Working space | X | |
| 0 | 0 | 0 | |||
| 0 | 0 | 1 | |||
| 0 | 1 | 0 | |||
| 0 | 1 | 1 | |||
| 1 | 0 | 0 | |||
| 1 | 0 | 1 | |||
| 1 | 1 | 0 | |||
| 1 | 1 | 1 | |||
Mark scheme
- 8 correct = 4; 6–7 = 3; 4–5 = 2; 2–3 = 1.
- X (000 → 111): 1, 0, 0, 1, 1, 0, 1, 1.
| Inputs | Working | Output | |||
|---|---|---|---|---|---|
| A | B | C | A AND B | NOT B XOR C | X |
| 0 | 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 | 1 |
Recap & Key Terms 3 min
Write an expression by working from the inputs to the output, one bracket per gate. Draw a circuit by working from the output back: the operator outside all brackets is the last gate. NOT applies only to what follows it.
- Logic expression
- A statement of a circuit's function using gate names and brackets, e.g. X = (A AND B) OR NOT C.
- Final (output) gate
- The gate whose operator lies outside all brackets; it produces X.
- Brackets
- Group the inputs of one gate; each bracketed part is one gate's output.
- Boolean algebra
- A symbolic form of logic (. for AND, + for OR, a bar for NOT); beyond the IGCSE syllabus.
Homework 1 min
Task (≤ 15 min): For X = (NOT A AND B) NOR C: (a) draw the logic circuit; (b) complete the truth table with working columns.
Model answer
(a) NOT gate on A; AND gate with inputs NOT A and B; NOR gate with inputs (the AND output) and C, giving X.
| Inputs | Working | Output | |||
|---|---|---|---|---|---|
| A | B | C | NOT A | P = NOT A AND B | X = P NOR C |
| 0 | 0 | 0 | 1 | 0 | 1 |
| 0 | 0 | 1 | 1 | 0 | 0 |
| 0 | 1 | 0 | 1 | 1 | 0 |
| 0 | 1 | 1 | 1 | 1 | 0 |
| 1 | 0 | 0 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 | 1 |
| 1 | 1 | 1 | 0 | 0 | 0 |