Lesson 3: Making Decisions with Switches — NOT, AND, and OR Logic Gates
Time: 50 minutes
Unit: Binary, Pixels, Logic Gates, and Packet Switching | Previous: Lesson 2 | Next: Lesson 4
Goal
Complete truth tables for NOT, AND, and OR logic gates, model series and parallel switch paths, and trace the output of a 2-gate combination circuit for all four input pairs.
Materials
- Chalk or masking tape on the classroom floor to draw two circuit pathways (Series Path and Parallel Path).
- Index cards labeled
0 (OPEN / FALSE) and 1 (CLOSED / TRUE) for student gatekeepers.
- Student notebooks or worksheet tables for truth tables.
Steps
1. Opening (5 min): How Do 0s and 1s Make Decisions?
Ask the class:
- "Lessons 1 and 2 showed how 0s and 1s store numbers, letters, and pictures. But how does a computer actually decide something — like turning on a terrarium misting sprayer only when the soil is dry AND the lid is closed?"
- Explain that inside a processor chip, billions of microscopic electronic switches (logic gates) take 0/1 inputs and produce a 0/1 output according to three fundamental rules: NOT, AND, and OR.
2. Main Activity Part A (15 min): Acting Out the Three Fundamental Logic Gates
Select student volunteers to act as Switch Gatekeepers along chalk paths drawn on the floor (or trace the paths at desks using a tabletop diagram, paper switch cards, or pointing so standing/walking is optional):
- 1 = Gate Closed (Bridge Down / True): The messenger can walk across.
- 0 = Gate Open (Bridge Up / False): The path is blocked.
1. The NOT Gate (Inverter) — 1 Input
Flips the input bit to its opposite:
Input A |
Output NOT A |
0 |
1 |
1 |
0 |
Everyday example: A refrigerator interior light switch that turns the bulb ON (1) when the door is NOT closed (0).
2. The AND Gate (Series Path) — 2 Inputs
Draw two switches A and B in a single straight line (in series). To walk from the battery to the lightbulb, the messenger must cross both A and B:
Input A |
Input B |
Output A AND B |
0 |
0 |
0 |
0 |
1 |
0 |
1 |
0 |
0 |
1 |
1 |
1 |
Rule: A AND B outputs 1 only when both inputs are 1.
3. The OR Gate (Parallel Path) — 2 Inputs
Draw a path that splits into two side-by-side branches (Switch A on the top branch, Switch B on the bottom branch) and rejoins before the lightbulb. The messenger can reach the lightbulb if either A is closed, or B is closed, or both:
Input A |
Input B |
Output A OR B |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
1 |
1 |
1 |
Rule: A OR B outputs 1 whenever at least one input is 1.
3. Main Activity Part B (15 min): Combining Gates in a Terrarium Controller
Connect to the Grade 6 Science unit (Fungi and Decomposition): suppose your class is modeling an ideal Boolean simulation of a mushroom decomposition terrarium controller with three idealized binary inputs:
- D (Dry): 1 if humidity is too low, 0 if moist enough.
- L (Lid Closed): 1 if the terrarium lid is safely closed, 0 if open.
- M (Manual Override Button): 1 if a student presses the test-spray button, 0 otherwise.
Worked Example: Tracing (D AND L) OR M
Let's trace when the Sprayer (S) turns ON (S = 1) for different sensor readings by adding an intermediate column X = (D AND L) first:
D (Dry) |
L (Lid) |
M (Manual) |
Step 1: X = D AND L |
Step 2: S = X OR M |
1 |
0 |
0 |
1 AND 0 = 0 |
0 OR 0 = 0 (OFF — lid is open!) |
1 |
1 |
0 |
1 AND 1 = 1 |
1 OR 0 = 1 (ON — dry and lid closed) |
0 |
0 |
1 |
0 AND 0 = 0 |
0 OR 1 = 1 (ON — manual button pressed) |
4. Discussion & Student Practice (15 min)
Practice Tasks (3.1 – 3.8)
- Task 3.1: Evaluate
1 AND 0, 1 OR 0, and NOT 0.
- Task 3.2: Evaluate
(1 OR 0) AND (NOT 1). Show the intermediate value of each parentheses group first.
- Task 3.3: Complete all 4 rows of the truth table for the circuit
Output = (NOT A) AND B (where (A, B) takes values (0,0), (0,1), (1,0), (1,1)).
- Task 3.4: Complete all 4 rows of the truth table for the circuit
Output = NOT (A OR B).
- Task 3.5 (Safety Bug Analysis in Our Boolean Simulation): In the simulated mushroom terrarium controller
S = (D AND L) OR M, notice Row 3 of the worked example (D=0, L=0, M=1): if the lid is open (L = 0) and someone presses the Manual button (M = 1), the sprayer output is still 1! Rewrite the Boolean formula using D, L, and M so that in this ideal logic model the sprayer output is 1 when dry or when the manual button is pressed, but ONLY if the lid input L is closed (L = 1).
- Task 3.6 (Comparing Circuits): Compute all 4 rows of
(NOT A) AND (NOT B) and compare the output column to Task 3.4 (NOT (A OR B)). What do you discover?
- Task 3.7 (Bitwise Masking): Computers often apply an
AND gate to two 4-bit numbers column by column. Compute 1101 AND 0110 bit by bit.
- Task 3.8 (Ratio of True Outputs): Out of the
4 possible input rows in a 2-input truth table (00, 01, 10, 11), what is the ratio of 1 (TRUE) outputs to total rows for an AND gate vs. an OR gate?
Complete Answer Key (Tasks 3.1 – 3.8)
- Answer 3.1:
1 AND 0 = 0; 1 OR 0 = 1; NOT 0 = 1.
- Answer 3.2: First group:
(1 OR 0) = 1. Second group: (NOT 1) = 0. Final gate: 1 AND 0 = 0.
- Answer 3.3 (
(NOT A) AND B):
(0, 0): NOT 0 = 1 → 1 AND 0 = 0
(0, 1): NOT 0 = 1 → 1 AND 1 = 1
(1, 0): NOT 1 = 0 → 0 AND 0 = 0
(1, 1): NOT 1 = 0 → 0 AND 1 = 0
(Only row (0, 1) outputs 1.)
- Answer 3.4 (
NOT (A OR B)):
(0, 0): 0 OR 0 = 0 → NOT 0 = 1
(0, 1): 0 OR 1 = 1 → NOT 1 = 0
(1, 0): 1 OR 0 = 1 → NOT 1 = 0
(1, 1): 1 OR 1 = 1 → NOT 1 = 0
- Answer 3.5: Put
D OR M inside parentheses first, then require AND L: S = (D OR M) AND L. In this ideal Boolean model, whenever L = 0 (lid open), (D OR M) AND 0 = 0, so the logic output stays 0 while L = 0. (Note that in a real physical device, a stuck lid sensor or faulty valve could still cause a malfunction even when the Boolean formula is correct!)
- Answer 3.6: For
(NOT A) AND (NOT B): (0,0) -> 1 AND 1 = 1; (0,1) -> 1 AND 0 = 0; (1,0) -> 0 AND 1 = 0; (1,1) -> 0 AND 0 = 0. The output column (1, 0, 0, 0) is identical to NOT (A OR B) in Task 3.4! ("Neither A nor B is ON" means the exact same thing as "A is OFF and B is OFF".)
- Answer 3.7: Column by column from left to right:
1 AND 0 = 0, 1 AND 1 = 1, 0 AND 1 = 0, 1 AND 0 = 0 → 0100.
- Answer 3.8: An
AND gate outputs 1 in 1 : 4 (1 out of 4 rows, or 25%), whereas an OR gate outputs 1 in 3 : 4 (3 out of 4 rows, or 75%).
Vocabulary
- logic gate: A physical or digital switch circuit that takes one or more binary inputs (
0 or 1) and produces a single binary output according to a fixed rule.
- truth table: A complete table listing every possible combination of input bits and the resulting output bit.
- series circuit (
AND): Switches wired one after another along a single path so all switches must be closed (1) for current to flow.
- parallel circuit (
OR): Switches wired on side-by-side branches so closing any one branch (1) allows current to flow.
Differentiation
- Extra support: Have students physically write the
0 or 1 output above each gate wire on a printed circuit diagram before filling in the table row.
- Extra challenge: Introduce the Exclusive OR (
XOR) gate, which outputs 1 when A and B are different (01 or 10), and outputs 0 when both are the same (00 or 11). Ask students to build A XOR B using only AND, OR, and NOT gates: (A OR B) AND NOT (A AND B).
Safety
Keep floor pathways clear of backpacks and chairs during the human-circuit walkthrough.
Teacher notes
- Common misconception ("Everyday English OR vs. Logical OR"): In everyday conversation, "You can have soup OR salad" often means one or the other, not both (
XOR). Emphasize that in mathematics and computing, OR always means "at least one (including both)" (1 OR 1 = 1).