IGCSE · Practice questions · Writing logic expressions

One line, whole circuit.

Six original Cambridge-style questions on writing logic expressions, from reading circuits to building expressions from truth tables.

Original questions All questions on this page are original work, written in the Cambridge IGCSE style. They are not from past papers. They test the same concepts and skills the syllabus rewards.
Keep these straight

Brackets show the order.

01
Write
[2 marks]

A logic circuit has a NOT gate with input A. The output of the NOT gate and input B go into an AND gate. The output of the AND gate and input C go into an OR gate, whose output is X. Write the logic expression for X.

  • NOT A AND B for the first two gates, in a bracket. ✓
  • X = (NOT A AND B) OR C. ✓
02
Write
[3 marks]

A logic circuit has a NAND gate with inputs A and B and a NOR gate with inputs B and C. Both outputs go into an XOR gate, whose output is X. Write the logic expression for X.

  • (A NAND B). ✓
  • (B NOR C). ✓
  • X = (A NAND B) XOR (B NOR C). ✓
03
Apply
[3 marks]

A sprinkler S switches on (S = 1) if the soil is dry (D = 1) and it is not raining (R = 0), or if the temperature is very high (T = 1). Write the logic expression for S.

  • Not raining is NOT R. ✓
  • D AND NOT R in one bracket. ✓
  • S = (D AND NOT R) OR T. ✓
04
Apply
[2 marks]

A two-input truth table has the output X = 1, 1, 0, 1 for the rows A B = 00, 01, 10, 11. Write a logic expression for X.

  • X is 0 only when A = 1 and B = 0. ✓
  • X = NOT A OR B (or the equivalent (NOT A AND NOT B) OR (NOT A AND B) OR (A AND B)). ✓
05
Data
[3 marks]

A three-input truth table has X = 1 only in the rows A B C = 010 and 110. Every other row has X = 0. Write a logic expression for X.

  • Row 010: (NOT A AND B) AND NOT C. ✓
  • Row 110: (A AND B) AND NOT C; join the two with OR. ✓
  • X = ((NOT A AND B) AND NOT C) OR ((A AND B) AND NOT C), which is equivalent to X = B AND NOT C. ✓
06
Analysis
[3 marks]

An alarm X sounds if the door is open (D = 1) and either the window is open (W = 1) or the motion sensor is triggered (M = 1). A student writes X = (D AND W) OR M. Explain the error, give the correct expression and give one set of inputs for which the two expressions differ.

  • The student's expression lets the motion sensor sound the alarm even when the door is closed. ✓
  • Correct: X = D AND (W OR M). ✓
  • For example D = 0, W = 0, M = 1: the student's expression gives 1 but the correct one gives 0. ✓

Mark this once you have attempted all six and checked your working. It records a Practiced badge on the topic and adds a one-time bonus. Revealing the solutions alone does not count.