TopMyGrade

GCSE/Computer Science/OCR

2.4.2Simplifying logic: writing Boolean expressions for simple problems; testing equivalence with truth tables

Notes

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):

ABCB OR CX = A AND (B OR C)
00000
00110
01010
01110
10000
10111
11011
11111

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

Practice questions

Try each before peeking at the worked solution.

  1. Question 12 marks

    Write a Boolean expression

    A heating system turns on the boiler when:

    • the thermostat is below the target temperature, AND
    • the user has switched the heating on, AND
    • it is not the night setback period.

    Let T = "below target", U = "user on", N = "night period".

    Write a Boolean expression for B (boiler on) in terms of T, U and N. [2 marks]

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-ocr-computer-science-leaves

  2. Question 24 marks

    Truth table

    Complete a truth table for X = (A AND B) OR (NOT C). [4 marks]

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-ocr-computer-science-leaves

  3. Question 36 marks

    Equivalence

    Use a truth table to determine whether the following two Boolean expressions are equivalent:

    X1 = NOT (A AND B)
    X2 = NOT A OR NOT B

    [6 marks]

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-ocr-computer-science-leaves

Flashcards

2.4.2 — Simplifying logic: writing Boolean expressions for simple problems; testing equivalence with truth tables

7-card SR deck for OCR Computer Science (J277) — leaves batch 1 topic 2.4.2

7 cards · spaced repetition (SM-2)