Chhetri AcademyGCSE & A level Paper Builder

2.4.1Logic gates, diagrams and truth tables

OCR GCSE Computer Science (J277) · Algorithms and programming (Paper 2) › Boolean logic

Practise Logic gates, diagrams and truth tables. 11 exam-style questions plus unlimited generated ones on this subtopic, at up to four difficulty levels, with full mark schemes and a progress tracker. Free, no account needed.

Build a paper on this topic

▶ Watch videos on Logic gates, diagrams and truth tables (Craig 'n' Dave OCR on YouTube) · Practise all of Boolean logic

Quick recall

Cover the answers and test yourself. The app has these as flashcards that come back just before you'd forget them.

State the number of inputs a NOT gate has.
1

Sample questions

Written for this site in the style of OCR exam questions. They are not taken from real past papers.

Question 1Easy3 marks
(a) Which logic gate's output is 1 only when both of its inputs are 1?
Tick (✓) one box.[1]
  • OR
  • NOT
  • AND
(b) State the number of inputs a NOT gate has.[1]
(c) State the output of an AND gate when both of its inputs are 0.[1]
Show the answer and mark scheme
(a) Answer: AND
(b) Answer: 1
  • 1
(c) Answer: 0
  • 0
Question 2Medium6 marks
An alarm system has three inputs:
  • S = 1 when the system is switched on
  • D = 1 when a door is open
  • B = 1 when the panic button is pressed.
The alarm, A, sounds when the system is switched on and a door is open, or at any time when the panic button is pressed.
(a) Write a Boolean expression for A.[3]
(b) Draw a logic diagram for the alarm system.[3]
Show the answer and mark scheme
(a) Answer: A = (S AND D) OR B
  • S AND D
  • OR B
  • brackets / order correct, so that B on its own sounds the alarm: A = (S AND D) OR B
(b)
  • an AND gate with inputs S and D
  • an OR gate with inputs from the AND gate and B
  • the output of the OR gate labelled A (correct symbols used)
Question 3Hard6 marks
{fig} shows a logic diagram.
[object Object]
(a) Complete {table} for the logic diagram in {fig}.[4]
[object Object]
(b) Write a Boolean expression for the logic diagram.[2]
Show the answer and mark scheme
(a) Answer:
ABCA OR BNOT CP
000010
001000
010111
011100
100111
101100
110111
111100
  • A OR B column: 0, 0, 1, 1, 1, 1, 1, 1
  • NOT C column: 1, 0, 1, 0, 1, 0, 1, 0
  • P = 0, 0, 1, 0 for the first four rows
  • P = 1, 0, 1, 0 for the last four rows
(b) Answer: P = (A OR B) AND NOT C
  • (A OR B) and NOT C both present
  • joined with AND: P = (A OR B) AND NOT C

Stuck? Get 1-to-1 help. Chhetri Academy tutors GCSE and A level Maths and Science online, with a free 30-minute trial lesson.

Book a free trial