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- 5 min
Flip the switches together: when does the lamp light? Write the four cases on the board. That is a truth table.
- 10 min
Swap the AND gate for OR, then NOT. Learners predict each truth table before trying it.
- 10 min
XOR: the hallway light with a switch at each end. Who can build it?
- 15 min
Half adder: load the example. Why is the second lamp called the carry? Relate it to adding 1 + 1 in binary.
- 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.
