Cambridge IGCSE · Topic 10 (1-2)
IGCSE Computer Science 0478 / Topic 10 / IGCSE

Six gates, one output.

Every calculation a processor makes comes down to tiny circuits called logic gates. Each gate takes binary inputs and gives a single binary output by a fixed rule. Learn the six symbols, the six rules and the truth table for each.

The key idea

A logic gate takes one or more binary inputs (0 or 1) and produces one binary output. NOT has one input and inverts it. AND gives 1 only if both inputs are 1; OR gives 1 if at least one input is 1; XOR (also written EOR) gives 1 if exactly one input is 1. NAND and NOR are AND and OR with the output inverted, which the small circle on their symbols shows. A truth table lists the output for every possible combination of inputs.

NOT A X X = NOT A AND A B X X = A AND B OR A B X X = A OR B NAND A B X X = A NAND B NOR A B X X = A NOR B XOR A B X X = A XOR B
Fig. 1: the standard symbols for the six logic gates
Section 01

NOT, AND and OR.

Pick a gate in the lab and click its input switches. The output lamp lights for 1. Then click each row of the truth table to check every combination.

ANOT A
01
10
ABA AND BA OR B
0000
0101
1001
1111
Examiner trap

Draw the shapes carefully: an AND gate has a straight back, an OR gate a curved back. A NOT gate needs its circle; a triangle on its own is not a NOT gate.

Section 02

NAND and NOR: the inverted gates.

NAND means NOT AND and NOR means NOT OR. Work out AND or OR first, then flip every answer. The small circle at the output of the symbol is the inversion.

ABA AND BA NAND BA OR BA NOR B
000101
010110
100110
111010
Worked example Reading a gate
A NOR gate has inputs A = 0 and B = 1. What is the output?
  1. Work out OR first: 0 OR 1 = 1.
  2. NOR inverts this: NOT 1 = 0.
Answer: 0
Your turn
A NAND gate has inputs A = 1 and B = 0. What is the output?
Stage 1 · Learn

Check what the sim just showed you

Four quick checks. Each correct answer earns XP and records this skill on your profile.

Quick check+10 XP

Which gate gives an output of 1 only when both of its inputs are 0?

Quick check+10 XP

In the lab, an XOR gate has both input switches on. What does the output show?

Quick check+10 XP

What does the small circle on the output of a NAND gate symbol show?

Quick check+10 XP

Which gate symbol has a flat back and a semicircular front, with no circle?

Section 03

XOR: exactly one.

XOR (exclusive OR, also written EOR) is like OR, except that it gives 0 when both inputs are 1. Its symbol is the OR shape with an extra curved line behind it. Use the lab to compare OR and XOR row by row.

ABA OR BA XOR B
0000
0111
1011
1110
Examiner trap

Learn the six output columns by heart in the order 00, 01, 10, 11: AND 0001, OR 0111, NAND 1110, NOR 1000, XOR 0110. Mixing up OR and XOR in the last row is the most common slip.

Stage 2 · Exam

Exam-style questions

Unlocks once the four checks above are done. Worth more XP, written to IGCSE Paper 1 standard.

Finish the four checks above to unlock the exam questions
Exam style+20 XP

For inputs (A, B) in the order 00, 01, 10, 11, which output column belongs to a NAND gate?

Exam style+20 XP

A gate has two inputs. Its output is 1 when the inputs are different and 0 when they are the same. Which gate is it?

Exam style+20 XP

Which logic gate has only one input?

Exam style+20 XP

An OR gate has inputs A = 1 and B = 1. A NOR gate is given the same inputs. What are the two outputs?

Skill unlocked

The six logic gates, mastered.

This skill is now recorded on your profile. Keep the chain going.

-Rank -Level -Score -Topics
Go deeper · practice
Six original Cambridge-style questions
The symbols, functions and truth tables of NOT, AND, OR, NAND, NOR and XOR.