← Back to subjects
0
Cambridge IGCSE Computer Science (0478) · Boolean logic
Mini-Lesson

Boolean logic

Inside every processor, tiny logic gates make decisions using just 1 (true) and 0 (false). This mini-lesson covers the six gates — AND, OR, NOT, NAND, NOR, XOR — their truth tables, and how to read and build logic circuits and Boolean expressions.

A B gate X every input and output is either 0 or 1

Work through each screen, answer the questions as you go, and collect ⭐ stars. Double-check every truth-table row! Press Start when ready.

Gates · AND, OR, NOT

AND, OR and NOT

  • AND — output is 1 only when BOTH inputs are 1.
  • OR — output is 1 when AT LEAST ONE input is 1.
  • NOT — has one input; it inverts it (0→1, 1→0).
AND ABX 000 010 100 111 OR ABX 000 011 101 111 NOT AX 01 10 AND needs both · OR needs at least one · NOT flips the bit
Learn these three first — the others are built from them.
Quick check

AND gate output

?An AND gate has inputs A = 1 and B = 0. What is the output?
Gates · NAND, NOR, XOR

NAND, NOR and XOR

  • NAND = NOT AND — the opposite of AND. Output is 0 only when both inputs are 1, otherwise 1.
  • NOR = NOT OR — the opposite of OR. Output is 1 only when both inputs are 0.
  • XOR (exclusive OR) — output is 1 only when the two inputs are DIFFERENT.
NAND ABX 001 011 101 110 NOR ABX 001 010 100 110 XOR ABX 000 011 101 110 NAND = not AND · NOR = not OR · XOR = "one or the other, not both"
NAND and NOR are just AND and OR with the output flipped.
Quick check

XOR gate output

?An XOR gate has inputs A = 1 and B = 1. What is the output?
Quick check

NOR gate output

?For which single set of inputs does a NOR gate output 1?
Match it

Match each rule to its gate

Tap a rule on the left, then the gate on the right.

Rule
Gate
Logic circuits & expressions

Circuits & Boolean expressions

Gates are joined into logic circuits. We can write the same logic as a Boolean expression using the operators AND, OR, NOT. Work from the inputs, through each gate, to the output X.

A B C AND NOT OR X X = (A AND B) OR (NOT C)
This circuit gives the Boolean expression X = (A AND B) OR (NOT C).
Worked example — complete the truth table for X = (A AND B) OR (NOT C)

If A=1, B=1, C=1: (1 AND 1)=1, so X = 1 OR (NOT 1) = 1 OR 0 = 1.

If A=0, B=1, C=1: (0 AND 1)=0, X = 0 OR (NOT 1) = 0 OR 0 = 0.

Quick check

Read the circuit

?For X = (A AND B) OR (NOT C), what is X when A = 0, B = 1, C = 0?
Quick check

Another expression

?For X = A XOR (B AND C), what is X when A = 1, B = 1, C = 1?
Quick check

Naming a gate

?A gate outputs 1 for the input pairs (0,0), (0,1) and (1,0), but outputs 0 for (1,1). Which gate is it?
Recap

The big ideas to know

AND = 1 only when both inputs are 1

OR = 1 when at least one input is 1

NOT = inverts a single input

NAND = NOT AND (0 only when both are 1) · NOR = NOT OR (1 only when both are 0)

XOR = 1 only when the inputs are different

Circuits & expressions: trace input → gate → output; write as (A AND B) OR (NOT C) etc.

You’ve covered the whole of Boolean logic. Press Finish to see your score.

🏆

Mini-lesson complete!

⭐⭐⭐

You’ve worked through Boolean logic for Cambridge IGCSE Computer Science. 🎉

Your stars: 0 / 0

Next: test yourself in the Evaluate stage Confidence Quiz, then lock it in with Verify.

📣 Smashed it? Share your score

Challenge a mate to beat your stars, or show a parent how you got on.

→ Back to all subjects