Teachers' Portal  /  IGCSE Computer Science 0478  /  Boolean logic  /  The six logic gates
Lesson pack · IGCSE Computer Science 0478 · 10 (1-2) · IGCSE

The six logic gates

Six gates, one output. Every calculation a processor makes comes down to tiny circuits called logic gates.

Student lesson Lab, full screen
At a glance

The shape of the lesson

Topic
Boolean logic
Syllabus reference
Cambridge IGCSE Computer Science 0478, 10 (1-2)
Level
IGCSE
Duration
45 minutes, lab-led; stretches to a 60 minute block (see the contingency notes)
Position in topic
Lesson 1 of 4 in Boolean logic; leads into Drawing logic circuits
Central model
Fig. 1: the standard symbols for the six logic gates
Cooperative structure
Assessment
Stage 1 check and the exam-style plenary from the student lesson, plus the worksheet as the exit task
Learning objectives

By the end of the lesson, learners can

Section by section
  • NOT, AND and OR: Pick a gate in the lab and click its input switches.
  • NAND and NOR: the inverted gates: NAND means NOT AND and NOR means NOT OR.
  • XOR: exactly one: XOR (exclusive OR, also written EOR) is like OR, except that it gives 0 when both inputs are 1.
Key points to leave on the board
  • AND needs both inputs to be 1; OR needs at least one; XOR needs exactly one.
  • NAND and NOR are AND and OR with every output inverted.
  • Symbols: flat back = AND family; curved back = OR family; extra curve = XOR; circle = inverted output.
  • Rows: list inputs in binary counting order 00, 01, 10, 11 so none is missed.
The core visual model

One picture every idea returns to

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
Lesson sequence

Forty-five minutes, phase by phase

TimePhaseWhat happens in the roomGrouping
0 to 5 minHook: predictOpen with the question in the title, Six gates, one output.. Every calculation a processor makes comes down to tiny circuits called logic gates. Put the figure on the board: it is the one picture every idea in the lesson returns to.Whole class, then pairs
5 to 13 minTeach and check: NOT, AND and ORPick a gate in the lab and click its input switches. Project tab 1 of the lab (The six logic gates) and let a student drive it while the class predicts.Whole class, then pairs
13 to 21 minTeach and check: NAND and NOR: the inverted gatesNAND means NOT AND and NOR means NOT OR. Model the worked example Reading a gate on the board, one line at a time. Your turn: A NAND gate has inputs A = 1 and B = 0. What is the output?Pairs
21 to 30 minTeach and check: XOR: exactly oneXOR (exclusive OR, also written EOR) is like OR, except that it gives 0 when both inputs are 1. Project tab 1 of the lab (Comparing OR and XOR) and let a student drive it while the class predicts.Jigsaw
30 to 36 minCheckThe four Stage 1 questions from the student lesson, answered on mini whiteboards or by show of fingers. Re-teach the one most get wrong.Individual, then whole class
36 to 43 minPlenaryThe exam-style questions from Stage 2, one at a time: thirty seconds alone, then a random call. The feedback lines in the key give the examiner's wording.Individual, random call
43 to 45 minExit and homeworkSet the worksheet below (6 questions, 15 marks). Learners self-assess against the objectives before they leave.Individual
Timing and contingency

Protect the parts that carry the learning

The sequence carries about fifty minutes of material, so the lab is driven by one student while the class predicts rather than explored freely. Times are a guide.

Protected: the check at 30 minutes. It is the only individual read on whether the key idea landed, and it is not cut.

Cut first if the build overruns: the last check in XOR: exactly one, never the check or the plenary.

In a 60 minute block: run worksheet questions 1 to 3 in class as a Rally Coach set and model both the hardest worked example and its check live.

Running the cooperative task

Jigsaw

Split the content into expert pieces. Expert groups master one piece each, then regroup so every home team has one expert per piece, and each expert teaches their piece to the team.

The full structure, with its variations and the other twelve, is on the cooperative-learning page.

Examiner traps to pre-empt

What to head off, and how

Trap learners fall intoTeaching move that pre-empts it
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.
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.
Worksheet

The six logic gates: worksheet

6 questions, 15 marks. Written in the style of the papers; no past paper question is reproduced.

NameClassDate
Q1 · recall[2 marks]

State the output of each gate when both of its inputs are 1: (a) AND, (b) NAND, (c) XOR, (d) NOR.

Q2 · explain[2 marks]

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

Q3 · apply[4 marks]

Complete the truth table for a NOR gate.

ABX
00
01
10
11
Q4 · recall[3 marks]

Describe the standard symbol for each of these gates: (a) NOT, (b) NAND, (c) XOR.

Q5 · analysis[2 marks]

A gate has two inputs. Its output is 0 for exactly one combination of inputs: A = 1, B = 1. Identify the gate and give a reason.

Q6 · apply[2 marks]

A NOT gate's output is connected to one input of an AND gate. The NOT gate's input is 0 and the AND gate's other input is 1. State the output of the NOT gate and of the AND gate.

Answer key and marking notes
Q1 · 2 marks
  • (a) 1 and (b) 0 (one mark for both).
  • (c) 0 and (d) 0 (one mark for both).
Q2 · 2 marks
  • Both give 1 when exactly one input is 1, and both give 0 when both inputs are 0.
  • When both inputs are 1, OR gives 1 but XOR gives 0.
Q3 · 4 marks
  • 0, 0 gives 1.
  • 0, 1 gives 0.
  • 1, 0 gives 0.
  • 1, 1 gives 0.
Q4 · 3 marks
  • (a) NOT: a triangle with a small circle at the output.
  • (b) NAND: the AND D shape (flat back, rounded front) with a small circle at the output.
  • (c) XOR: the OR shape (curved back, pointed front) with an extra curved line behind the back.
Q5 · 2 marks
  • NAND.
  • It is AND inverted: AND is 1 only for 1, 1, so NAND is 0 only for 1, 1.
Q6 · 2 marks
  • NOT gate output: NOT 0 = 1.
  • AND gate output: 1 AND 1 = 1.
Quiz

6 multiple-choice questions on this lesson

From the topic question bank. Assign them in the app for a marked score in your gradebook, or run the topic as a class game.

Q11 mark

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

  • AAND
  • BOR
  • CXOR
  • DNAND
Q21 mark

A two-input gate has the output column 1, 0, 0, 0 for the inputs A B = 00, 01, 10, 11. Which gate is it?

  • ANOR
  • BNAND
  • CAND
  • DXOR
Q31 mark

Which logic gate does this symbol represent?

A B X
  • AXOR
  • BOR
  • CNOR
  • DNAND
Q41 mark

For which inputs does an OR gate give an output of 1 but an XOR gate give an output of 0?

  • AA = 1, B = 1
  • BA = 0, B = 0
  • CA = 0, B = 1
  • DA = 1, B = 0
Q51 mark

Which arrangement of gates gives the same output as a single NOR gate for every pair of inputs A and B?

  • Aan OR gate with inputs A and B, followed by a NOT gate
  • Ban AND gate with inputs A and B, followed by a NOT gate
  • Ca NOT gate on each of A and B, then an OR gate
  • Dan XOR gate with inputs A and B, followed by a NOT gate
Q61 mark

Inputs A = 0 and B = 0 are applied in turn to an AND, OR, NAND, NOR and XOR gate. How many of these five gates output 1?

  • A2
  • B1
  • C3
  • D0
Quiz key
Q1: A

AND outputs 1 only for inputs 1 and 1. OR outputs 1 when at least one input is 1, so also for 0 1 and 1 0. XOR outputs 1 when exactly one input is 1, so it gives 0 for 1 and 1. NAND is AND with the output inverted, so it gives 0 for 1 and 1 and 1 for every other row.

Q2: A

The output is 1 only when both inputs are 0: that is NOT (A OR B), the NOR gate. NAND gives 1, 1, 1, 0 (it is 0 only when both inputs are 1). AND gives 0, 0, 0, 1. XOR gives 0, 1, 1, 0.

Q3: A

The curved OR-shaped body with an extra curved line behind it is the XOR gate. A plain OR gate has only one curve at the back. A NOR gate has the OR shape with a small circle at the output, not an extra curve. A NAND gate has the D-shaped AND body with a circle at the output.

Q4: A

With both inputs 1, OR gives 1 (at least one input is 1) but XOR gives 0 (it needs exactly one input to be 1). With both inputs 0, both gates give 0. With one input 1 and the other 0, both gates give 1, so they agree.

Q5: A

NOR is OR with its output inverted: X = NOT (A OR B), so an OR gate followed by a NOT gate behaves identically (1, 0, 0, 0). AND followed by NOT is NAND (1, 1, 1, 0). Inverting each input and then using OR also gives 1, 1, 1, 0, the same as NAND. XOR followed by NOT gives 1, 0, 0, 1, which differs from NOR in row 11.

Q6: A

With both inputs 0, AND, OR and XOR all output 0. NAND and NOR invert AND and OR, so they both output 1: two gates. Answering 1 misses one of the inverted gates. Answering 3 wrongly treats XOR as outputting 1 when the inputs are the same. Answering 0 forgets that the circle on NAND and NOR inverts the output.

Lab and demo

What to project

The student lesson embeds these tabs. Open them full screen on the projector; every slider has a drag handle on the stage.

Slides

Slides for this lesson

A projectable deck for every pack is on the way. Until then, present the student lesson full screen: its sections, figure and lab tabs follow the same order as the plan above.

Also for this topic

Everything else you can use

Original work by the TheLucidSTEM team. The worksheet items are written in the style of the papers; no past paper question is reproduced.