Teachers' Portal  /  A-Level Computer Science 9618  /  Hardware  /  Logic gates
Lesson pack · A-Level Computer Science 9618 · 3.2 · AS Level

Logic gates

Six gates, one output. Every operation inside a processor is built from logic gates: tiny circuits that take binary inputs and give one binary output by a fixed rule.

Student lesson Lab, full screen
At a glance

The shape of the lesson

Topic
Hardware
Syllabus reference
Cambridge International AS and A Level Computer Science 9618, 3.2
Level
AS Level
Duration
45 minutes, lab-led; stretches to a 60 minute block (see the contingency notes)
Position in topic
Lesson 4 of 5 in Hardware; follows Embedded systems, monitoring and control; leads into Logic circuits, truth tables and expressions
Central model
Fig. 1: the standard symbols for the six logic gates used in 9618
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 switch its inputs on and off.
  • NAND and NOR: inverted outputs: NAND means NOT AND, and NOR means NOT OR.
  • XOR: inputs different: XOR (exclusive OR, also written EOR) is like OR, except that it outputs 0 when both inputs are 1.
Key points to leave on the board
  • AND needs both inputs 1; OR needs at least one; XOR needs them to be different.
  • 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.
  • 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 binary inputs (0 or 1) and produces one binary output. NOT has one input and inverts it; in 9618 every other gate has exactly two inputs. AND outputs 1 only if both inputs are 1; OR outputs 1 if at least one input is 1; XOR (EOR) outputs 1 if the inputs are different. NAND and NOR are AND and OR with the output inverted, shown by a small circle on the symbol. A truth table lists the output for every combination of inputs: 2 rows for one input, 4 for two, 8 for three.

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 used in 9618
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 operation inside a processor is built from logic gates: tiny circuits that take binary inputs and give one binary output by a fixed rule. 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 switch its inputs on and off. 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: inverted outputsNAND 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: Both inputs of a NAND gate are connected to the same input A. Complete the outputs for A = 0 and A = 1, and name the single gate this behaves like.Pairs
21 to 30 minTeach and check: XOR: inputs differentXOR (exclusive OR, also written EOR) is like OR, except that it outputs 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, 16 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: inputs different, 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: AND has a straight back, OR a curved back.A NOT gate must have its circle; a triangle alone is a buffer, not a NOT gate.
Learn the output columns in the order 00, 01, 10, 11: AND 0001, OR 0111, NAND 1110, NOR 1000, XOR 0110.Writing rows in binary counting order means you never miss a combination.
Worksheet

Logic gates: worksheet

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

NameClassDate
Q1 · recall[3 marks]

Define the function of each gate: (a) NAND, (b) NOR, (c) XOR.

Q2 · apply[4 marks]

Complete the truth table for X = A NOR B.

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

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

Q4 · analysis[2 marks]

A two-input gate gives an output of 0 for exactly one combination of inputs, A = 1 and B = 1. Identify the gate and justify your answer.

Q5 · explain[2 marks]

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

Q6 · apply[2 marks]

Both inputs of a NOR gate are connected to the same signal P. Complete the outputs for P = 0 and P = 1, and state which gate the arrangement is equivalent to.

Answer key and marking notes
Q1 · 3 marks
  • (a) NAND: the output is 0 only when both inputs are 1; otherwise 1 (the inverse of AND).
  • (b) NOR: the output is 1 only when both inputs are 0; otherwise 0 (the inverse of OR).
  • (c) XOR: the output is 1 when the two inputs are different; 0 when they are the same.
Q2 · 4 marks
  • 0, 0 gives 1.
  • 0, 1 gives 0.
  • 1, 0 gives 0.
  • 1, 1 gives 0.
Q3 · 3 marks
  • (a) NOT: a triangle with a small circle at the output.
  • (b) NAND: the AND 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.
Q4 · 2 marks
  • NAND.
  • AND outputs 1 only for 1, 1; NAND inverts every output, so it is 0 only for 1, 1.
Q5 · 2 marks
  • Both output 0 when both inputs are 0, and 1 when exactly one input is 1.
  • When both inputs are 1, OR outputs 1 but XOR outputs 0.
Q6 · 2 marks
  • P = 0: 0 NOR 0 = 1; P = 1: 1 NOR 1 = 0.
  • It is equivalent to a NOT gate.
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 two-input gate outputs 1 only when both inputs are 0?

  • ANOR
  • BNAND
  • CXOR
  • DAND
Q21 mark

A two-input gate gives X = 0 when A = 0 and B = 0, and also X = 0 when A = 1 and B = 1. Which gate is it?

  • AXOR
  • BAND
  • COR
  • DNAND
Q31 mark

How many rows, not counting the heading, does a truth table need for a circuit with three inputs?

  • A8
  • B6
  • C9
  • D3
Q41 mark

A two-input gate's truth table, with rows in the order AB = 00, 01, 10, 11, has the output column 1, 1, 1, 0. Which gate is it?

  • ANAND
  • BNOR
  • CXOR
  • DAND
Q51 mark

Both inputs of a NAND gate are connected to the same signal, A. How does the gate behave?

  • AAs a NOT gate: X = NOT A
  • BAs an AND gate: X = A
  • CAs an OR gate: X = A
  • DIts output is always 1
Q61 mark

For X = NOT (A XOR B), when is X = 1?

  • AWhen A and B are the same
  • BWhen A and B are different
  • COnly when A and B are both 1
  • DWhen at least one of A and B is 0
Quiz key
Q1: A

NOR is OR with the output inverted: OR gives 0 only for inputs 0, 0, so NOR gives 1 only for 0, 0. NAND outputs 0 only when both inputs are 1, so it gives 1 for three rows. XOR outputs 1 when the inputs differ, and 0 for 0, 0. AND outputs 1 only when both inputs are 1.

Q2: A

XOR outputs 0 whenever the inputs are the same, so it gives 0 for both 0, 0 and 1, 1. AND gives 1 for 1, 1; OR gives 1 for 1, 1; NAND gives 1 for 0, 0. Each of those fails one of the two rows.

Q3: A

Each input can be 0 or 1, so three inputs give 2 × 2 × 2 = 23 = 8 combinations, from 000 to 111. 6 multiplies 3 by 2 instead of raising 2 to the power 3. 9 is 32, which reverses base and power. 3 gives one row per input.

Q4: A

The output is 0 only when both inputs are 1: that is AND with the output inverted, which is NAND. NOR would give 1, 0, 0, 0. XOR would give 0, 1, 1, 0. AND would give 0, 0, 0, 1, the exact inverse of the table.

Q5: A

With A = 0 the inputs are 0, 0 and NAND outputs 1; with A = 1 the inputs are 1, 1 and NAND outputs 0. The output is always the inverse of A, so the gate acts as NOT. X = A ignores the inverting circle, which is how AND or OR with tied inputs would behave. The output is not always 1: it is 0 when A = 1.

Q6: A

A XOR B is 1 when the inputs differ, so NOT (A XOR B) is 1 when they are the same: 0, 0 or 1, 1. When they differ, X = 0, which is plain XOR. "Only when both are 1" misses the 0, 0 row (that is AND). "At least one is 0" describes NAND.

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.
Previous lessonEmbedded systems, monitoring and control