Writing a logic expression from a truth table
To write an expression from a truth table, take each row with output 1 and join its inputs with AND, adding NOT to any input that is 0. Then join those rows with OR.
Understanding Writing a logic expression from a truth table in IGCSE Computer Science Paper 2
What it does: Both inputs are 0 in the row with output 1, so each gets NOT and the two are joined with AND. AND gives 1 only when both inputs are 1. OR would also give 1 for the rows 0,1 and 1,0. An input that is 1 is written as it is. An input that is 0 gets NOT. So A stays as A and B becomes NOT B. X is 1 if any one of the rows matches, so the parts are joined with OR. Only B is 0 in that row, so only B gets NOT. A and C are 1, so they have no NOT.
Common mistakes: A is 0 in this row, so it must be written as NOT A. The row should be NOT A AND B. An output that is 1 only when both inputs are 1 is the AND pattern. OR gives 1 for three of the four rows.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 562–580) and word search (Modules 539–580).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
X = (A AND NOT B) OR (NOT A AND B)Fill in the Blanks
Spot the Error
Student with a class code? Join your class →