10.1

Topic 10

Boolean logic

  • IGCSE Computer science 0478
  • 3 min read
  • Syllabus 2026, 2027 and 2028

Objectives

  1. 1

    Identify and use the standard symbols for logic gates

  2. 2

    Define and understand the functions of logic gates

  3. 3

    • aUse logic gates to create given logic circuits from a: (i) problem statement (ii) logic expression (iii) truth table
    • bComplete a truth table from a: (i) problem statement (ii) logic expression (iii) logic circuit
    • cWrite a logic expression from a: (i) problem statement (ii) logic circuit (iii) truth table

Cambridge IGCSE Computer Science 0478 syllabus 2026-2028, 10.1 Boolean logic (copied for internal use as permitted by Cambridge)

Detailed · Deep study

1Logic gates

A logic gate takes one or more binary inputs (0 or 1) and produces a single binary output. NOT has a single input; all the other gates have two inputs.

Fig. 1Standard symbols and truth tables.
GateFunctionExpression
NOToutput is the opposite of the inputX = NOT A
ANDoutput is 1 only if A and B are both 1X = A AND B
ORoutput is 1 if A or B (or both) is 1X = A OR B
NANDoutput is 0 only if both inputs are 1 (opposite of AND)X = A NAND B
NORoutput is 1 only if both inputs are 0 (opposite of OR)X = A NOR B
XOR (EOR)output is 1 if the inputs are differentX = A XOR B

2Circuits, expressions and truth tables

A truth table shows the output for every possible combination of inputs. With three inputs there are 2³ = 8 combinations; list them as binary counting from 000 to 111. Circuits use at most three inputs and one output, and must be drawn for the statement given, without simplification.

Fig. 2From a logic expression to a circuit.
Working columns help: X = (A AND B) OR NOT C.
ABCA AND BNOT CX
000011
001000
010011
011000
100011
101000
110111
111101

Worked example

Problem statement → expression → circuit → truth table

An alarm X sounds if a door is open (A = 1) and the alarm is set (B = 1), or if a window is open (C = 1) and the alarm is set (B = 1). Write the logic expression and complete the truth table.

  1. 1

    Turn each part of the statement into a gate.

    door open and set: A AND B; window open and set: C AND B

  2. 2

    Join the parts with the word between them (or).

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

  3. 3

    Work out X for each of the 8 rows.

    X = 1 when B = 1 and A or C is 1

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

Fig. 3Circuit drawn exactly as the statement is written.
Alarm: X = (A AND B) OR (C AND B).
ABCX
0000
0010
0100
0111
1000
1010
1101
1111

Worked example

Truth table → expression

A two-input truth table has X = 1 only for A = 0, B = 1 and for A = 1, B = 0. Write a logic expression.

  1. 1

    Write an AND term for each row where X = 1.

    (NOT A AND B) and (A AND NOT B)

  2. 2

    Join the terms with OR.

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

AnswerX = (NOT A AND B) OR (A AND NOT B), which is the same as A XOR B

3Exam focus

Key words: logic gate; NOT; AND; OR; NAND; NOR; XOR; truth table; logic expression; logic circuit; input; output.

Quick self-check

Answer in your head first, then reveal.

  1. NOT (1).

  2. 1 (1).

  3. 0, 1, 1, 0 (2: 1 mark for two correct).

  4. X = (A AND B) OR NOT C (2).

  5. X = A AND NOT B (2).

Finished this subtopic? Track it on your subject page.