Coding activity
Boolean Logic Gates
Play the Yes or No game! Learn about TRUE and FALSE using real-life questions. Hold up green (yes/true) and red (no/false) cards to answer fun questions.
Materials and setup
- cards with TRUE/FALSE
- paper gates
- markers
- paper
How this changes by age
Pre-K (ages 3–4)
Play the Yes or No game! Learn about TRUE and FALSE using real-life questions. Hold up green (yes/true) and red (no/false) cards to answer fun questions.
Steps
- Make two cards: green (TRUE/YES) and red (FALSE/NO).
- Ask questions: 'Is the sky blue?' Child holds up green. 'Do fish fly?' Child holds up red.
- Play 10 rounds with silly and serious questions.
- Combine: 'Is the sky blue AND do you have two eyes?' BOTH must be true for green card.
- Discuss: 'Computers think in yes or no, true or false. That is how they make decisions!'
- Tell a grown-up one thing that surprised you.
Learning objectives
- Evaluate statements as true or false
- Use physical cards to represent Boolean values
- Begin to understand AND logic by combining two true/false statements
Kindergarten (ages 5–6)
Build logic gates with cards! Learn AND, OR, and NOT. Two inputs go in, one answer comes out. Use TRUE and FALSE cards to test every combination and discover how computers make decisions.
Steps
- Create input cards: TRUE (green) and FALSE (red). Draw an AND gate box on paper.
- AND gate: Both inputs must be TRUE for output to be TRUE. Test all 4 combinations: T+T=T, T+F=F, F+T=F, F+F=F.
- Draw an OR gate: At least one input must be TRUE for TRUE output. Test all 4 combinations.
- Draw a NOT gate: It flips! TRUE becomes FALSE, FALSE becomes TRUE.
- Real life AND: 'IF it is sunny AND you finished homework, THEN you can go outside.' What if only one is true?
- Tell a grown-up one thing that surprised you.
Learning objectives
- Demonstrate how AND, OR, and NOT gates process two inputs into one output
- Test all input combinations for each gate type and record results
- Connect logic gates to real-life decision-making scenarios
Early elementary (ages 6–8)
Build a logic gate circuit on paper! Chain AND, OR, and NOT gates together to create complex decisions. Fill out truth tables and design a gate combination that solves a real-world problem.
Steps
- Review AND, OR, NOT gates. For each, create a complete truth table showing all input/output combinations.
- Chain two gates: take the output of an AND gate and feed it into a NOT gate. This creates a NAND gate. Build its truth table.
- Design a 'Should I bring an umbrella?' circuit: Input 1 = 'Is it cloudy?' Input 2 = 'Did the forecast say rain?' Use an OR gate (bring umbrella if EITHER is true).
- Add complexity: Input 3 = 'Am I driving?' Use AND with NOT: bring umbrella IF (cloudy OR forecast rain) AND NOT driving.
- Draw the full circuit diagram with labeled gates and inputs. Trace through 3 different scenarios to verify it works.
- Challenge: design a circuit for 'Should I study or play?' with 3 inputs of your choosing.
- In one sentence, tell a parent or sibling what surprised you today.
Learning objectives
- Create complete truth tables for basic and combined logic gates
- Chain multiple gates to build complex decision circuits
- Apply logic gate thinking to model real-world decision processes
Upper elementary (ages 8–10)
Master Boolean algebra and digital logic. Build a half-adder circuit that adds binary numbers, explore how computers use millions of logic gates to compute, and design your own logic puzzle for others to solve.
Steps
- Review: AND, OR, NOT, NAND, NOR, XOR (exclusive OR — true when inputs differ). Build truth tables for XOR and NAND.
- Binary addition: 0+0=0, 0+1=1, 1+0=1, 1+1=10 (carry). A half-adder uses XOR for the sum bit and AND for the carry bit. Draw the circuit.
- Test your half-adder with all 4 input combinations. Verify the output matches binary addition.
- Boolean algebra: simplify expressions. A AND (A OR B) = A. NOT (NOT A) = A. Practice 5 simplification problems.
- Design a logic puzzle: create a scenario with 4 binary inputs and a specific output pattern. Draw the gate circuit. Give it to someone else to solve — can they figure out your truth table?
- Discuss: 'A modern CPU has billions of logic gates. Everything your computer does — math, graphics, internet — is built from these simple TRUE/FALSE gates.'
- In one sentence, tell a parent or sibling what surprised you today.
Learning objectives
- Build and verify a half-adder circuit that performs binary addition
- Apply Boolean algebra to simplify logical expressions
- Design original logic circuits and puzzles using multiple gate types
Safety and evidence note
Read the full activity before beginning. An adult should supervise tools, heat, food, outdoor work, movement, and experiments as appropriate. Completion records that the activity was done; the child’s explanation, work sample, photo, or demonstration is stronger evidence of learning than a completion check alone.
Related coding activities
AI Explorers
Train a pretend 'robot brain'! Show it 5 cat pictures and 5 dog pictures, then test if it can guess a new one.
Algorithm Art
Follow step-by-step drawing instructions to create a picture. The instructions are your algorithm! Each step adds one shape or line.
API Restaurant
Play restaurant! The customer tells the waiter what they want, the waiter tells the kitchen, and the kitchen makes it. The waiter is the messenger — just like how computers talk to each other!
App Design Workshop
Design your dream app! Draw what you'd see on a phone screen. What would your app do? What buttons would it have?