Use brackets to group conditions that go together.
Example: the alarm X sounds if the door is open (D) and the system is armed (S), or if the panic button (P) is pressed.
X = (D AND S) OR P
Quick check
?A greenhouse sprinkler W switches on when the soil is dry (D) and it is not raining (R), or when the manual override (M) is pressed. Which logic statement matches?
Boolean logic · combining operators
Logic circuits
A logic circuit joins gates with wires, inputs on the left. Each gate's output feeds the next gate.
To write the expression, work from the inputs to the output, one gate at a time.
The alarm X = (D AND S) OR P is an AND gate (inputs D, S) feeding an OR gate with P.
Quick check
?Look at the circuit in the diagram. Which logic statement does it represent?
Mission check
?Three sensors, one alarm. How many different input combinations must the truth table cover?
8. Each sensor can be 0 or 1, so each one doubles the number of cases: 2 × 2 × 2 = 8. Counting in binary from 000 to 111 lists all 8 rows, so no case is missed.
Recap
Big ideas
Every input and output is 1 (TRUE) or 0 (FALSE). A truth table lists every combination of inputs.
AND: 1 only if both inputs are 1. OR: 1 if at least one input is 1. NOT: reverses its one input.
Work out brackets first; NOT applies only to what comes straight after it.
3 inputs give 8 rows: count in binary from 000 to 111, and add working columns for each part.
Turn a problem into a statement by giving each condition a letter and mapping "and", "or", "not".
In a circuit, each gate's output feeds the next gate; read it from inputs to output.
🏆
Mini-lesson complete!
⭐⭐⭐
You've worked through Boolean logic for OCR GCSE Computer Science (J277). 🎉
Mission 1"Tea or coffee?" Would a computer's OR let you have both?
Mission 2Three sensors, one alarm: how many cases must you test?