OCR J277 GCSE Computer Science · 2.4 Boolean Logic
Stretch tasks Boolean Logic
Quiz Challenge
A quiz game against four computer players, then short and long written answers.
- Quiz Blitz12 questions against the clock
- Quick Fire4 short answers
- Big Think2 long answers
About 20 minutes
This or That
Pixel the cat asks 8 questions. Each has two answers: pick the right one.
- Two answers to every question
- A fish treat for every right answer
- Streaks win Pixel shades, then a party hat
About 4 minutes
Memory Match
Flip the cards two at a time to match each term card to its meaning card.
- 12 cards: each term has a meaning
- One peek at every card
- Combo points for pairs found in a row
6 pairs, about 4 minutes
Sort It
Sort each statement into the right box, like the tick-box tables in the exam.
- 12 cards to sort into 3 boxes
- Drag a card, tap a box or press its number
- Combo points for cards sorted in a row
12 cards, about 4 minutes
The games need JavaScript. Every question is below, with the answers at the end.
Read the lesson: Boolean Logic
Boolean Logic: the questions
Quiz Challenge, round 1: Quiz Blitz
When does an AND gate output 1?
- When at least one input is 1
- When both inputs are 0
- When the inputs are different
- Only when both inputs are 1
When does an OR gate output 1?
- Only when both inputs are 0
- Only when the inputs are different
- When at least one input is 1
- Only when both inputs are 1
A NOT gate has two inputs.
- True
- False
How many rows does a truth table for three inputs need?
What is 1 AND 0?
What is 1 OR 0?
What is NOT 1?
An alarm sounds if the door is opened and the system is armed. Which expression is right?
- Alarm = Door AND Armed
- Alarm = Door OR Armed
- Alarm = NOT Door
- Alarm = Door AND NOT Armed
After brackets, in which order are Boolean operators worked out?
- Strictly left to right
- NOT, then AND, then OR
- OR, then AND, then NOT
- AND, then OR, then NOT
Q = (A AND B) OR (NOT C). What is Q when A, B and C are all 1?
In a question, the word either usually means which gate?
- AND
- NOT
- OR
Put the first four rows of a three-input truth table in order.
Number these 1 to 4.
- 001
- 010
- 011
- 000
Quiz Challenge, round 2: Quick Fire
Explain the difference between an AND gate and an OR gate. [2 marks]
State what each of the NOT, AND and OR gates does. [3 marks]
Explain why intermediate columns should be included in a truth table. [2 marks]
A truth table has 3 inputs. Explain how many rows it needs and how to list them. [2 marks]
Quiz Challenge, round 3: Big Think
Explain how to build the truth table for a logic circuit with three inputs. [4 marks]
A greenhouse fan should turn on if it is too hot or too humid, but only when the system is switched on. Explain which gates are needed and why. [4 marks]
This or That: tick the right answer
Two switches in series control a light. Which gate is that like?
- AND
- OR
Two switches in parallel control a light. Which gate is that like?
- AND
- OR
How many rows does a truth table for two inputs have?
- 4
- 2
What does A OR B AND C mean?
- A OR (B AND C)
- (A OR B) AND C
The word unless usually signals which gate?
- OR
- NOT
What is NOT (1 AND 1)?
- 1
- 0
What is (0 OR 1) AND 1?
- 1
- 0
Which gate's symbol is a D shape?
- OR
- AND
Memory Match: match each term to its meaning
| Term | Meaning |
|---|---|
| A AND | 1 1 when at least one input is 1 |
| B OR | 2 Every input combination and its output |
| C NOT | 3 Eight rows in the truth table |
| D Truth table | 4 Performs a Boolean operation on its inputs |
| E Logic gate | 5 Flips its single input |
| F Three inputs | 6 1 only when both inputs are 1 |
Sort It: tick one box in each row
Which gate does each statement describe?
| Statement | AND | OR | NOT |
|---|---|---|---|
| Signalled by the word either | |||
| Like two switches in parallel | |||
| Signalled by the words as well as | |||
| Has only one input | |||
| Outputs 1 when at least one input is 1 | |||
| Outputs 1 only when both inputs are 1 | |||
| Signalled by the words unless or without | |||
| Drawn as a curved shield shape | |||
| Like two switches in series | |||
| Drawn as a D shape | |||
| Inverts its input | |||
| Drawn as a triangle with a small circle |
Answers
Round 1: Quiz Blitz
- Only when both inputs are 1 AND needs both.
- When at least one input is 1 OR needs at least one.
- False A NOT gate has one input, and outputs the opposite.
- 8 2 x 2 x 2 = 8. Count in binary from 000 to 111.
- 0 AND needs both inputs to be 1.
- 1 OR needs at least one input to be 1.
- 0 NOT flips its input.
- Alarm = Door AND Armed Both conditions must be true, so it is AND.
- NOT, then AND, then OR So A OR B AND C means A OR (B AND C).
- 1 A AND B is 1, so the OR outputs 1, whatever NOT C is.
- OR Either means at least one: OR.
- 000 → 001 → 010 → 011 Count in binary, so no combination is missed.
Round 2: Quick Fire
- AND outputs 1 only when both inputs are 1
- OR outputs 1 when at least one input is 1
Model answerAn AND gate outputs 1 only when both of its inputs are 1. An OR gate outputs 1 when at least one of its inputs is 1.
- NOT inverts its input
- AND outputs 1 only when both inputs are 1
- OR outputs 1 when at least one input is 1
Model answerNOT inverts its input, giving the opposite. AND outputs 1 only when both inputs are 1. OR outputs 1 when at least one input is 1.
- They show the working: the output of each gate
- So errors are easier to spot, and method marks can be earned
Model answerThey show the working, one column for the output of each gate, so mistakes are easier to spot, and they earn method marks even if the final column has an error.
- 8 rows, because 2 x 2 x 2 is 8
- Count in binary from 000 to 111
Model answerIt needs 8 rows, because each input can be 0 or 1, and 2 x 2 x 2 is 8. List them by counting in binary from 000 to 111, so no combination is missed.
Round 3: Big Think
- There are 8 rows
- List the inputs by counting in binary, 000 to 111
- Add a column for each intermediate output, one for each gate
- Work through the circuit in the order the signals flow
- The last column is the final output
Model answerWith three inputs there are 2 x 2 x 2 = 8 rows. List the inputs by counting in binary from 000 to 111, so no combination is missed. Add a column for each intermediate output, one for each gate, and work through the circuit in the order the signals flow, from the inputs towards the output. The last column is the final output.
- An OR gate for hot or humid, because either on its own is enough
- An AND gate with the switch, because both must be 1
- The OR gate's output feeds into the AND gate
- Brackets make the OR happen first
Model answerAn OR gate is needed for the temperature and humidity sensors, because either condition on its own is enough. Its output feeds into an AND gate with the on switch, because the fan should only run when both that result and the switch are 1. Brackets are needed: Fan = (Hot OR Humid) AND On, so the OR is worked out first.
This or That
- AND In series, the light only comes on if both switches are closed.
- OR In parallel, either switch on its own completes the circuit.
- 4 00, 01, 10 and 11: 2 x 2 = 4.
- A OR (B AND C) AND is worked out before OR, unless brackets say otherwise.
- NOT Unless and without both mean NOT.
- 0 1 AND 1 is 1, and NOT flips it to 0.
- 1 0 OR 1 is 1, and 1 AND 1 is 1.
- AND AND is a D shape. OR is a curved shield shape.
Memory Match
- A 6 AND: 1 only when both inputs are 1
- B 1 OR: 1 when at least one input is 1
- C 5 NOT: Flips its single input
- D 2 Truth table: Every input combination and its output
- E 4 Logic gate: Performs a Boolean operation on its inputs
- F 3 Three inputs: Eight rows in the truth table
Sort It
- OR Signalled by the word either Either means at least one: OR.
- OR Like two switches in parallel In parallel, either switch is enough.
- AND Signalled by the words as well as As well as means both: AND.
- NOT Has only one input NOT is the only one of the three with a single input.
- OR Outputs 1 when at least one input is 1 OR needs at least one.
- AND Outputs 1 only when both inputs are 1 AND needs both.
- NOT Signalled by the words unless or without They reverse a condition: NOT.
- OR Drawn as a curved shield shape The OR symbol is a curved shield.
- AND Like two switches in series In series, both switches must be closed.
- AND Drawn as a D shape The AND symbol is a D shape.
- NOT Inverts its input NOT flips 1 to 0 and 0 to 1.
- NOT Drawn as a triangle with a small circle The small circle shows the inversion.