Level:
Correct: 0
Incorrect: 0
Marks: 0/0
Exam Practice
Course:
Topics:
OCR GCSE Computer Science (Paper 2) Smart practice A mixed round aimed at your weak spots
Unit 1
Algorithms
Unit 2
Programming fundamentals
Unit 3
Producing robust programs
Unit 4
Boolean logic
Unit 5
Programming languages and IDEs
Unit 6
Practical programming (Section B)
Avg
score:
–
Topics
done:
0/31

Logic diagrams and combining Boolean operators

Practise 32 exam-style questions on Logic diagrams and combining Boolean operators 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.

  • 32 questions
  • 1–6 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

2 marks

The truth table shows the output P of a logic circuit with inputs A and B.

Write a logic expression for P using AND, OR and NOT.

Truth table with two input columns, A and B, and one output column, P (a thick line separates the inputs from the rest). The 4 rows list every combination of inputs in binary order from 00 to 11. Rows (A B → P): 00 → 0; 01 → 0; 10 → 1; 11 → 0.

Model answer

P = A AND NOT B

Explanation

P is 1 in only one row, where A = 1 and B = 0. To get 1 from that row alone, B must be reversed with NOT (so it becomes 1) and then ANDed with A. Check every row: A AND NOT B gives 0, 0, 1, 0, which matches the table.

Mark scheme
  1. 1 mark

    NOT B

    Accept other valid notation (¬B, B with a bar) and lower-case letters, with or without 'P ='. Accept any logically equivalent expression for both marks, e.g. NOT (NOT A OR B). A description in words ('P is 1 when A is 1 and B is 0') is not an expression and scores 0.

  2. 1 mark

    A joined to the B part with AND: P = A AND NOT B

    P = A AND B scores this mark but not the first.

Question 2

3 marks

A house alarm sounds when the alarm is switched on and either the front door or a window is opened.

The inputs are A (1 when the alarm is switched on), D (1 when the front door is open) and W (1 when a window is open). The output S is 1 when the alarm sounds.

Write a logic expression for S.

Model answer

S = A AND (D OR W)

Explanation

Either the door or a window opening is enough, so D and W are joined with OR. The alarm must also be switched on, so that OR part is joined with A using AND. Brackets are needed round D OR W, because without them AND is worked out before OR and the expression would mean (A AND D) OR W.

Mark scheme
  1. 1 mark

    D OR W

    Accept other valid notation (∧ ∨ ¬, A.D, D+W) and lower-case letters, with or without 'S ='. Accept any logically equivalent expression for full marks, e.g. (A AND D) OR (A AND W).

  2. 1 mark

    A joined with AND to the door and window part

  3. 1 mark

    Brackets so that the OR is worked out first: S = A AND (D OR W)

    A AND D OR W without brackets means (A AND D) OR W, so the alarm would sound whenever a window opened, even when switched off: max 2.

Question 3

3 marks

The truth table shows the output Y of a logic circuit with inputs A, B and C.

Write a logic expression for Y using AND, OR and NOT.

Truth table with three input columns, A, B and C, and one output column, Y (a thick line separates the inputs from the rest). The 8 rows list every combination of inputs in binary order from 000 to 111. Rows (A B C → Y): 000 → 1; 001 → 0; 010 → 1; 011 → 0; 100 → 0; 101 → 0; 110 → 0; 111 → 0.

Model answer

Y = NOT A AND NOT C

Explanation

Y is 1 in only two rows: 000 and 010. In both of them A = 0 and C = 0, while B is 0 in one and 1 in the other, so B does not affect the output. Y is therefore 1 when NOT A and NOT C are both 1: Y = NOT A AND NOT C. Check the answer against all eight rows before moving on.

Mark scheme
  1. 1 mark

    NOT A

    Accept other valid notation (∧ ∨ ¬) and lower-case letters, with or without 'Y ='. Accept any logically equivalent expression for full marks, e.g. NOT (A OR C), or a longer expression that includes B but gives exactly this table, such as (NOT A AND NOT B AND NOT C) OR (NOT A AND B AND NOT C).

  2. 1 mark

    NOT C

  3. 1 mark

    Joined with AND: Y = NOT A AND NOT C

    An expression that also requires B to have a particular value (e.g. NOT A AND NOT B AND NOT C) is wrong: it gives 0 for row 010.

Question 4

4 marks

In a talent show, each of three judges presses a button to vote 'yes'. The inputs are A, B and C (1 when that judge votes 'yes'). A light X comes on when at least two of the three judges vote 'yes'.

Write a logic expression for X, and state how many of the eight possible combinations of inputs make the light come on.

Model answer

X = (A AND B) OR (A AND C) OR (B AND C)

4 combinations make the light come on: 011, 101, 110 and 111.

Explanation

'At least two judges' means some pair of judges both vote yes: A and B, A and C, or B and C. Each pair is an AND, and any one pair is enough, so the pairs are joined with OR. The light is on in the three rows with exactly two 1s and in the row 111, so 4 of the 8 combinations. A common mistake is (A AND B) AND C, which needs all three judges.

Mark scheme
  1. 1 mark

    One pair of judges joined with AND, e.g. A AND B

    Accept other valid notation (∧ ∨ ¬, A.B + A.C + B.C) and lower-case letters, with or without 'X ='. Accept any logically equivalent expression for the first three marks, e.g. (A AND (B OR C)) OR (B AND C).

  2. 1 mark

    All three pairs used: A AND B, A AND C and B AND C

  3. 1 mark

    The pairs joined with OR: X = (A AND B) OR (A AND C) OR (B AND C)

    (A AND B) AND C (all three judges) and A OR B OR C (any one judge) are wrong and score 0 for the expression.

  4. 1 mark

    4 (combinations)

    011, 101, 110 and 111. Mark independently of the expression.

Ready to try the rest? Every answer you write is marked against the mark scheme, so you can see exactly where the marks are.

Study Helper Hints 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.