Level:
Correct: 0
Incorrect: 0
Marks: 0/0
Exam Practice
Subject:
Topics:
Avg
score:
–
Topics
done:
0/32

Logic expressions

Practise 29 exam-style questions on Logic expressions for Cambridge IGCSE 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 an AI tutor on hand if you get stuck.

  • 29 questions
  • 1–5 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 logic circuit has the logic expression
X = NOT (A OR B)

Rewrite this logic expression using a single logic gate.

Model answer

X = A NOR B

Explanation

NOR means NOT OR: it gives the opposite output to OR, so NOT (A OR B) is exactly A NOR B. In the same way, NOT (A AND B) is A NAND B.

Mark scheme
  1. 1 mark

    X = A NOR B

Question 2

2 marks

The table shows the truth table for a logic circuit with two inputs, A and B, and output X.

Write a logic expression for X.

Truth table with two input columns, A and B, and one output column, X (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 → X): 00 → 0; 01 → 0; 10 → 1; 11 → 0.

Model answer

X = A AND (NOT B)

Explanation

X is 1 only in row 10, where A = 1 and B = 0. To make an AND gate output 1 for that row, B must be inverted: A AND (NOT B). Writing an AND term for each row where the output is 1 is a reliable method.

Mark scheme
  1. 1 mark

    NOT B

    1 mark for each correct part

  2. 1 mark

    A AND ... (A joined to NOT B by AND)

    X = A AND (NOT B). Accept any correct equivalent, e.g. NOT ((NOT A) OR B).

Question 3

3 marks

An oven heats (O = 1) when it is switched on (S = 1), the door is closed (D = 1) and the set temperature has not been reached (T = 1 when it has been reached).

Write the logic expression for O.

Model answer

O = (S AND D) AND (NOT T)

Explanation

All three conditions must be true, so they are joined by AND. Each gate has only two inputs, so three conditions need two AND operators, grouped with brackets. "Not reached" needs NOT T.

Mark scheme
  1. 1 mark

    S AND D

    1 mark for each correct part

  2. 1 mark

    NOT T

  3. 1 mark

    all three joined by AND with correct brackets

    O = (S AND D) AND (NOT T). Accept S AND (D AND (NOT T)) or S AND D AND (NOT T).

Question 4

5 marks

The logic circuit shown has three inputs and five logic gates.

Write the logic expression for this circuit.

Logic circuit with three inputs, A, B and C, on the left and one output, X, on the right. It has five logic gates (numbered here from left to right, then top to bottom): gate 1 is a NOR gate with inputs A and B; gate 2 is a NOT gate with input C; gate 3 is an AND gate with inputs from gate 1 (upper) and input C (lower); gate 4 is an AND gate with inputs from input A (upper) and gate 2 (lower); gate 5 is an OR gate with inputs from gate 3 (upper) and gate 4 (lower), and its output is X. Input A is drawn once and branches, with junction dots, to gates 1 and 4. Input C is drawn once and branches, with junction dots, to gates 2 and 3. Some wires cross without a junction dot, so those wires are not connected.

Model answer

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

Explanation

Work from the inputs to the output. The NOR gate's output is ANDed with C in one branch, while A is ANDed with NOT C in the other; the OR gate joins the two branches. Each gate's output becomes a bracket inside the next gate's expression.

Mark scheme
  1. 1 mark

    (A NOR B)

    1 mark for each correct part. Brackets must show the correct order.

  2. 1 mark

    (A NOR B) AND C

  3. 1 mark

    NOT C

  4. 1 mark

    A AND (NOT C)

  5. 1 mark

    the two bracketed parts joined by OR

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

AI Tutor Hints first, answers after you try

Hi! Stuck? Ask me for a hint and I’ll help you work it out. Once you’ve checked your answer I can explain exactly where the marks are.