Wimzee Cambridge Academy
← All Revision Notes← IGCSE Computer Science

Boolean Logic

Revision Notes — IGCSE
CAIE IGCSE Computer Science (0478) • Topic 10 of 10 • Paper 1 & Paper 2
Mastered: 0 / 2

10.1 Logic Gates

Digital circuits are built from logic gates. Each gate takes one or more binary inputs and produces a single binary output. Boolean logic uses only two values: 1 (true) and 0 (false).

GateSymbol nameOutput is 1 when…
NOTInverterthe input is 0 (it inverts the input)
ANDConjunctionboth inputs are 1
ORDisjunctionat least one input is 1
NANDNOT ANDthe inputs are not both 1 (the inverse of AND)
NORNOT ORneither input is 1 (the inverse of OR)
XORExclusive ORthe inputs are different (one is 1 and the other is 0)

10.2 Truth Tables

A truth table lists every possible combination of inputs and the resulting output. For two inputs there are 2² = 4 rows; for three inputs there are 2³ = 8 rows. Always list the inputs in binary counting order (00, 01, 10, 11) so nothing is missed.

A B | AND | OR | NAND | NOR | XOR 0 0 | 0 | 0 | 1 | 1 | 0 0 1 | 0 | 1 | 1 | 0 | 1 1 0 | 0 | 1 | 1 | 0 | 1 1 1 | 1 | 1 | 0 | 0 | 0

Three-input example

Q = (A AND B) OR NOT C A B C | A AND B | NOT C | Q 0 0 0 | 0 | 1 | 1 0 0 1 | 0 | 0 | 0 0 1 0 | 0 | 1 | 1 0 1 1 | 0 | 0 | 0 1 0 0 | 0 | 1 | 1 1 0 1 | 0 | 0 | 0 1 1 0 | 1 | 1 | 1 1 1 1 | 1 | 0 | 1

10.3 From a Problem to a Circuit

Read the statement carefully and identify the conditions and how they are joined.

Example: An alarm sounds if the alarm is set AND (a window is open OR a door is open).

Let S = alarm set, W = window open, D = door open ALARM = S AND (W OR D) Circuit: W and D feed an OR gate; the output of that OR gate and S feed an AND gate; the AND output drives the alarm.

Exam trap

NAND and NOR are not the same as "AND with a NOT on one input". NAND inverts the output of the AND. Draw the gate, then the small circle on its output, to keep this clear.

Five-minute drill

  1. Write the truth table for a NOR gate.
  2. How many rows does a truth table with 4 inputs need?
  3. State the output of XOR when both inputs are 1.
  4. Write a Boolean expression for: the light is on if it is dark and the switch is on.
  5. Simplify: NOT (A AND B) using a single gate name.
Exam practice 1[4]

A car's warning light comes on if the seatbelt is not fastened AND the engine is running. (a) Write a Boolean expression. (b) Draw the truth table for the circuit.

Mark scheme
  • (a) Let S = seatbelt fastened, E = engine running: LIGHT = NOT S AND E (2).
  • (b) Truth table (2):
  • S E | NOT S | LIGHT: 0 0 → 1, 0; 0 1 → 1, 1; 1 0 → 0, 0; 1 1 → 0, 0.
Exam practice 2[5]

A security system unlocks a door when a valid code is entered (C) and a card is swiped (K), or when a manager overrides the system (M). Write the Boolean expression and complete the truth table.

Mark scheme
  • Expression: UNLOCK = (C AND K) OR M (2).
  • Truth table for C K M (3):
  • 0 0 0 → 0; 0 0 1 → 1; 0 1 0 → 0; 0 1 1 → 1; 1 0 0 → 0; 1 0 1 → 1; 1 1 0 → 1; 1 1 1 → 1.

Quick Reference

NOT = invert AND = both 1 OR = at least one 1 NAND = not both 1 NOR = neither 1 XOR = inputs different n inputs -> 2^n rows in the truth table Work out brackets first, then combine