EXAM QUESTIONS · IGCSE 0478

Logic Gates Exam-Style Questions with Answers (IGCSE 0478)

Original exam-style questions on logic gates, truth tables, logic expressions and circuits for Cambridge IGCSE Computer Science 0478 (Paper 2). There are 31 marks in total. Try each question first, then press Show answer to see the mark scheme. The truth tables mark themselves.

Question 1[2 marks]

State the name of the logic gate described in each statement.

  1. The output is 1 only when the two inputs are different.
  2. The output is 0 only when both inputs are 1.
Show answer
  1. XOR [1]
  2. NAND [1]
Question 2[4 marks]

Complete the truth table for the logic expression:

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

Click each output cell to set it to 0 or 1, then press Check.

ABCX
000
001
010
011
100
101
110
111
Show answer
ABCX
0001
0010
0101
0110
1001
1010
1101
1111

4 marks for all 8 rows correct, 3 marks for 6–7 correct, 2 marks for 4–5 correct, 1 mark for 2–3 correct.

Tip: work out the brackets first. NOT C is 1 whenever C = 0, so every row with C = 0 gives X = 1.

Question 3[3 marks]

A greenhouse fan (F) switches on when:

  • the temperature is high (T = 1) and the window is closed (W = 0)
  • or the humidity is high (H = 1).

Write the logic expression for F.

Show answer

F = (T AND NOT W) OR H

  • 1 mark: T AND NOT W
  • 1 mark: … OR H
  • 1 mark: correct brackets / fully correct expression
Question 4[4 marks]

Draw the logic circuit for the expression in Question 3. Use only NOT, AND and OR gates.

Show answer
TWHF NOTANDOR
  • 1 mark: NOT gate on input W
  • 1 mark: AND gate with inputs T and NOT W
  • 1 mark: OR gate with H as one input
  • 1 mark: output of the AND gate goes into the OR gate, giving F
Question 5[4 marks]

Complete the truth table for:

X = NOT (A OR B) AND C

Click each output cell to set it to 0 or 1, then press Check.

ABCX
000
001
010
011
100
101
110
111
Show answer
ABCX
0000
0011
0100
0110
1000
1010
1100
1110

NOT (A OR B) is only 1 when A = 0 and B = 0. It must also have C = 1, so only the row A = 0, B = 0, C = 1 gives X = 1.

4 marks for all 8 rows correct, 3 marks for 6–7 correct, 2 marks for 4–5 correct, 1 mark for 2–3 correct.

Question 6[3 marks]

This truth table shows the output of a single logic gate.

ABX
000
011
101
110
  1. Name the gate. [1]
  2. Write a logic expression that gives the same output using only AND, OR and NOT. [2]
Show answer
  1. XOR [1]
  2. X = (A AND NOT B) OR (NOT A AND B)
    1 mark for each correct bracket, joined by OR. [2]
Question 7[2 marks]

Describe the difference between the output of an OR gate and the output of an XOR gate.

Show answer
  • When both inputs are 1, OR outputs 1 but XOR outputs 0. [1]
  • For all other input combinations the two gates give the same output. [1]
Question 8[6 marks]

A machine (M) can only run (M = 1) when:

  • the safety guard is closed (G = 1)
  • and the start button is pressed (P = 1)
  • and the emergency stop is not pressed (E = 0).
  1. Write the logic expression for M. [2]
  2. Complete the truth table for M. [4]

Click each output cell to set it to 0 or 1, then press Check.

GPEM
000
001
010
011
100
101
110
111
Show answer
  1. M = G AND P AND NOT E
    1 mark for G AND P, 1 mark for AND NOT E. [2]
  2. GPEM
    0000
    0010
    0100
    0110
    1000
    1010
    1101
    1110
    Only one row gives M = 1: G = 1, P = 1, E = 0. [4]
Question 9[2 marks]

State how many rows (not including the heading row) a truth table needs for a circuit with three inputs, and explain why.

Show answer
  • 8 rows [1]
  • Each input can be 0 or 1, so there are 2 × 2 × 2 = 23 = 8 combinations. [1]
Question 10[1 mark]

For the expression X = (A XOR B) AND NOT C, state the output X when A = 1, B = 0 and C = 1.

Show answer

X = 0 [1]

A XOR B = 1 XOR 0 = 1, but NOT C = NOT 1 = 0, and 1 AND 0 = 0.

Frequently asked questions

Which logic gates do I need for IGCSE Computer Science 0478?

NOT, AND, OR, NAND, NOR and XOR. You need to know their symbols, their truth tables and how to use them in logic expressions and circuits.

How many inputs can a logic circuit have in IGCSE?

IGCSE questions use circuits with up to three inputs, so truth tables have up to 8 rows.

Are these past paper questions?

No. These are original exam-style questions written by a Computer Science teacher in the same style as Cambridge questions.

Revise the topic: IGCSE Boolean logic notes · Logic gates and truth tables guide · Truth table generator · All exam-style questions