Practise 28 exam-style questions on Logic gates and truth tables for OCR GCSE Computer Science (Paper 2). Write your answer as you would in the exam and get it marked in seconds against the mark scheme, point by point, with the Study Helper on hand if you get stuck.
28 questions
1–4 marks each
Instant marking
No sign-up needed
20 questions, marked as you go
Sample questions with model answers
Here are 4 of the questions in this topic, each with a model answer, an explanation of why it earns the marks and the mark scheme an examiner would use.
Question 1
1 mark
A single logic gate has inputs A and B and output P. The truth table shows its output for every combination of inputs.
Identify the logic gate.
Model answer
An OR gate.
Explanation
The output is 1 whenever at least one input is 1, and 0 only when both inputs are 0 - this is an OR gate. An AND gate would give 1 only in the last row. Look carefully at the last row (A = 1, B = 1): an OR gate gives 1 there too.
Mark scheme
1 mark
OR (gate)
Do not accept AND or NOT. Do not accept XOR (it would give 0 when A = 1 and B = 1).
Question 2
2 marks
Give two differences between a NOT gate and an AND gate.
Model answer
A NOT gate has only one input, but an AND gate has two inputs. A NOT gate outputs the opposite of its input, whereas an AND gate outputs 1 only when both of its inputs are 1.
Explanation
A NOT gate (an inverter) takes a single input and reverses it: 0 becomes 1 and 1 becomes 0. An AND gate combines two inputs and gives 1 only if both are 1. The symbols differ too: NOT is a triangle with a small circle at its tip, while AND is D-shaped. When asked for differences, say what each gate does rather than describing just one of them.
Mark scheme
1 mark
A NOT gate has one input but an AND gate has two inputs
Max 2 from the three points. Each difference must refer to both gates, or the other gate must be clearly implied by the comparison (e.g. 'only the NOT gate has a single input').
1 mark
A NOT gate outputs the opposite of its input, whereas an AND gate outputs 1 only when both inputs are 1
Accept TRUE/FALSE for 1/0. 'NOT reverses its input but AND needs both inputs to be 1' is enough. Describing only one gate's output rule, with no contrast, does not score.
1 mark
The NOT symbol is a triangle with a small circle // the AND symbol is D-shaped (straight back, rounded front)
Accept any correct description of the difference between the symbols.
Question 3
2 marks
The logic diagram shows a circuit with inputs A and B and output Q.
Write the logic expression for Q.
Model answer
Q = NOT (A OR B)
Explanation
Follow the diagram from left to right: A and B go into an OR gate, and the output of the OR gate goes into a NOT gate. The NOT therefore applies to the whole of A OR B, which needs brackets: Q = NOT (A OR B). Without the brackets, NOT A OR B would mean (NOT A) OR B, which is a different circuit.
Mark scheme
1 mark
A OR B
For the OR gate joining A and B. Accept other valid notation (A ∨ B, A + B) and lower-case letters, with or without 'Q ='. Accept any logically equivalent expression (same truth table) for both marks, e.g. (NOT A) AND (NOT B).
1 mark
NOT applied to the whole of (A OR B): Q = NOT (A OR B)
The brackets are needed. NOT A OR B means (NOT A) OR B, so it scores the first mark only.
Question 4
3 marks
The truth table is for the logic expression P = NOT (A AND B). The column headed A AND B is a working column.
State the values of J, K, L and M.
Model answer
J = 0 K = 1 L = 1 M = 0
Explanation
First work out A AND B, which is 1 only when both inputs are 1, so J (A = 0, B = 1) is 0. Then NOT reverses each value of A AND B: the rows where A AND B is 0 give P = 1 (K and L), and the last row, where A AND B is 1, gives P = 0 (M). A common mistake is to apply the NOT to A only, which gives a different expression.
Mark scheme
1 mark
J = 0
Accept T/F or TRUE/FALSE for 1/0.
1 mark
K = 1 and L = 1
Both needed for the mark.
1 mark
M = 0
Ready to try the rest? Every answer you write is marked against the mark scheme, so you can see exactly where the marks are.
Ctrl + Enter to check
Study HelperHints first, answers after you try
Stuck on this one? Ask for a hint and I’ll point you in the right direction, without giving the answer away. Once you’ve checked your answer, I’ll show you how the marks are awarded.