This module covers the logic that sits behind every condition in a program and every gate in a processor. You will evaluate Boolean expressions, build truth tables, read simple logic circuits, decide whether two expressions are equivalent, and turn everyday sentences into precise conditions.
Check the current Cambridge Computer Science 0478 syllabus for the content points in your exam year, and read which years your syllabus covers if you are unsure. Our Computer Science learning guide shows where this module sits among the others.
What should you already know?
You need to know that a value can be true or false, written as 1 or 0, and to be comfortable with `IF …
THEN … ELSEin pseudocode. If a condition such asAge >= 13` already makes sense, you are ready.
An orienting example
A school lab door opens when the teacher card is present or both a student card is present and a teacher has switched on the lab. In symbols, with T for teacher card, S for student card and L for lab switched on:
Q = T OR (S AND L)
Step 1, evaluate for T = 0, S = 1, L = 1. Bracket first: 1 AND 1 = 1. Then 0 OR 1 = 1, so the door opens.
Step 2, evaluate for T = 0, S = 1, L = 0. Bracket: 1 AND 0 = 0. Then 0 OR 0 = 0, so the door stays shut.
Step 3, count the cases. Three inputs give 23 = 8 rows, so a truth table for the door has 8 rows. Q is 1 whenever T = 1 (4 rows), plus the single extra row with T = 0, S = 1, L = 1. That makes 5 rows where the door opens.
The same expression appears as a condition in code:
IF TeacherCard = TRUE OR (StudentCard = TRUE AND LabOn = TRUE) THEN
OUTPUT "Door opens"
ENDIF
In what order should you study the lessons?
- Evaluate a logical expression with parentheses: the operator order everything else depends on.
- Construct a truth table: evaluate an expression for every input, in a structure that cannot skip a case.
- Interpret a simple logic circuit: read gates in a diagram as the same expressions.
- Compare two equivalent expressions using cases: use tables as a proof that two forms agree.
- Distinguish logical AND from ordinary language ambiguity: translate sentences into brackets before you evaluate.
Then work through the Boolean logic practice set. The Boolean and number-representation lab, the restricted pseudocode trace trainer and the safe Python reasoning sandbox are useful for checking small cases.
What traps catch students in this topic?
- Ignoring that AND is evaluated before OR when brackets are missing.
- Applying NOT to a whole expression when it belongs to one letter, or the reverse.
- Leaving out a row in a truth table, usually the last one.
- Treating XOR like OR when both inputs are 1.
- Declaring two expressions equal after checking only one case.
How should you use the practice set?
Do the questions in order, writing your working as if for an exam. Open the answer only after you have written yours, and mark where your first wrong step was, not just the final value. The “if you got these wrong” section points each error type back to a lesson.
Students who want someone to look over their working can ask about our online one-to-one Computer Science tuition.