Simplifying logic and testing equivalence
OCR J277 Paper 2 sets 4–6 mark questions on Boolean logic that go beyond drawing a single gate. You must be able to (1) write a Boolean expression from a problem description, (2) draw a truth table, and (3) decide whether two expressions are equivalent.
From problem description to Boolean expression
A burglar alarm sounds when:
- the alarm is armed, AND
- (a window sensor OR a door sensor is triggered), AND
- the system is NOT in test mode.
Letters: A = armed, W = window, D = door, T = test.
Expression: Alarm = A AND (W OR D) AND NOT T.
Tips:
- Identify the inputs first.
- Translate "or"/"and"/"not" carefully — natural English "or" is usually inclusive OR.
- Use brackets to make precedence explicit.
Building a truth table
A truth table lists every combination of the inputs (2^n rows for n inputs) and the output for each row.
Three-input AND-of-OR example, X = A AND (B OR C):
| A | B | C | B OR C | X = A AND (B OR C) |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 1 | 0 |
| 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 | 1 |
Add intermediate columns (here B OR C) to break the calculation into steps — it makes mark-scheme credit easier.
Testing equivalence
Two Boolean expressions are equivalent if they produce the same output for every combination of inputs. Build a truth table for both and compare the final columns.
Example — show that (A AND B) OR (A AND C) is equivalent to A AND (B OR C). Build columns for each, line by line — the two output columns are identical, so the expressions are equivalent. (This is the distributive law.)
Useful identities (simplification)
- A AND 0 = 0; A AND 1 = A; A OR 0 = A; A OR 1 = 1.
- A AND A = A; A OR A = A.
- A AND NOT A = 0; A OR NOT A = 1.
- NOT (NOT A) = A.
- De Morgan: NOT (A AND B) = NOT A OR NOT B; NOT (A OR B) = NOT A AND NOT B.
J277 does not require formal Boolean algebra proofs — you can answer all simplification questions with a truth table.
Common OCR exam mistakes
- Producing a truth table with the wrong number of rows (forgetting one combination, or repeating).
- Mixing up the precedence of NOT vs AND vs OR — always use brackets.
- Saying two expressions are equivalent without producing or referring to the truth table.
- Confusing inclusive OR with exclusive OR (XOR is not named in J277, but watch the wording).
AI-generated · claude-opus-4-7 · v3-ocr-computer-science-leaves