NewThe ManyPI MCP Server is now live

Introduction to logic gates

A 45-minute lesson from switches and lamps to the half adder, with the logic gates sandbox on every learner's screen.

Lesson plan45 minLower secondary +2CC BY 4.0

What you will learn

  • Describe AND, OR and NOT with switches and a lamp
  • Fill in a truth table
  • Build a half adder from two gates

Every learner needs a browser with the logic gates sandbox open. It starts with two switches, an AND gate and a lamp.

Running the lesson

45 min
  1. 5 min

    Flip the switches together: when does the lamp light? Write the four cases on the board. That is a truth table.

  2. 10 min

    Swap the AND gate for OR, then NOT. Learners predict each truth table before trying it.

  3. 10 min

    XOR: the hallway light with a switch at each end. Who can build it?

  4. 15 min

    Half adder: load the example. Why is the second lamp called the carry? Relate it to adding 1 + 1 in binary.

  5. 5 min

    The logic gates exercise as a quick check, with a class link if you want the results.

Questions to ask

  • Why does the truth table have four rows for two switches? How many for three?

  • Which gate would you use for "the alarm sounds if the door or the window is open"?

  • A NAND gate alone can build every other gate. Who can build NOT from a NAND?

Answers
  • Each switch has two states, so two switches give 2 × 2 = 4 combinations; three give 8.

  • OR: one open is enough.

  • Connect both inputs of the NAND to the same switch: 1 NAND 1 = 0 and 0 NAND 0 = 1.

Reuse this material

CC BY 4.0

You may copy, adapt and share it, also commercially, as long as you credit ManyPI and link back.

"Introduction to logic gates" by ManyPI (https://manypi.com/edu/logic-gates-lesson), licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)