A switch has two states that are easy to tell apart: off (0) and on (1). Wire two switches in a line and the lamp lights only when both are on: an AND gate. Side by side, either one will do: an OR gate. Gates like these, made of tiny electronic switches, combine bits to do every calculation, which is why computers are built on binary.
A computer chip holds billions of tiny switches and nothing else. How can switches add up numbers?
Put to work in:Combining gates(Digital systems › From gates to a processor)
In the binary lessons, each bit was a card face up or face down. Inside a computer, a bit is a tiny electronic switch: off (0) or on (1). Two states are easy to tell apart, even when the signal is a little weak or noisy. Switches can also be wired together so that some bits control other bits. That is how a computer calculates.
Predict: Read the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
Try: Try it on the board and compare the result with your prediction.
Investigate: Work out why it happens, one step at a time.
Modify: Change the problem on purpose and see what happens.
Practise: A few on your own, to check you have it.
Make: Make your own problem using what you have learned. Expect a few tries; that is normal.
Make your prediction first. Help opens once you've locked it in.
PredictRead the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
Two switches in a line
TryTry it on the board and compare the result with your prediction.
Try: every combination
Was your prediction right? Look at the truth table: one row in four lights the lamp.
Try it yourselfYour edits are saved in this browser.
Click the switches to try all four combinations of A and B. When does the lamp light?
Use the board. This ticks when you get there.
InvestigateWork out why it happens, one step at a time.
Worked example: AND and OR
Worked exampleBefore each step, say what you think comes next.
AND:00→0,01→0,10→0,11→1Switches in a line: the output is 1 only when both inputs are 1.
OR:00→0,01→1,10→1,11→1Switches side by side: the output is 1 when at least one input is 1.
NOT:0→1,1→0One input, flipped.
switch: 2 states→bitsEach switch is a bit: off 0, on 1.
gates→adding, comparing, storingWired together, gates do every calculation. So binary is the natural choice.
Now read an OR gate.
Sam fills in the OR gate's truth table. Click the line where it first goes wrong.
ModifyChange the problem on purpose and see what happens.
Vary: change the gate
Try it yourselfYour edits are saved in this browser.
Switch the gate to OR. Turn on only A. What is the output?
Use the board. This ticks when you get there.
Keep OR and turn B on too.
Use the board. This ticks when you get there.
Switch to NOT. Turn A off. What comes out?
Use the board. This ticks when you get there.
Switch back to AND and make the output 1.
Use the board. This ticks when you get there.
PractiseA few on your own, to check you have it.
Gates
Review: what number is **110** in binary?
MakeMake your own problem using what you have learned. Expect a few tries; that is normal.
Add two bits
Stretch: which inputs give the answer 01? Why are there two ways?
Try it yourselfYour edits are saved in this browser.
Need a hint?
The adder shows A + B as a two-bit binary number: carry, then sum.
Another hint
10 in binary is 2. Which inputs add to 2?
Another hint
Turn both switches on.
This circuit adds two bits: the sum is A XOR B and the carry is A AND B. Set the switches so the answer is 10 in binary (2).
Use the board. This ticks when you get there.
For teachers
Students try every combination of two switches in a circuit to build AND and OR truth tables, use NOT, then add two bits with a half adder, to explain why digital systems are built on binary (AC9TDI8K04 node 3). About 40 minutes.
Try the boards yourself. A torch, a battery and two real switches (or a breadboard) make the Try concrete in a minute.
The one idea (the kit's chain for this node): electronic components have two reliable states → those states are 0 and 1 → gates combine them → so binary is the foundation of all computing. The half adder in Make shows gates doing the binary addition students know from lesson 5.
Simplifications: real gates are made of transistors, not mechanical switches; the circuit view is an analogy that holds for AND and OR.
Running the lesson
Predict: students who chose "yes" picture parallel wiring. Ask them to trace the current.
Try: have students fill a paper truth table as the board's fills.
Worked example: before the OR line, ask what changes when the switches sit side by side.
Vary: ask why AND has only one row that gives 1.
Make: connect to 1 + 1 = 10 in binary and to carrying in base 10.
The hard part (on purpose)
Students read OR as everyday English (one or the other, not both). Point at the circuit: with both switches on, is there still a path for the current?
When students get stuck
A student writes 1 OR 1 = 0 (Sam's mistake). Ask: With both switches on side by side, can the current reach the lamp? Fix: Yes: OR means at least one. One but not both is XOR.
A student thinks gates add (1 AND 1 = 2). Ask: How many states can the output wire have? Fix: One bit: 0 or 1. Adding takes several gates, as in the half adder.
Stretch and support
Stretch: A full adder adds three bits (two numbers and a carry in). Sketch how two half adders and an OR gate could make one.
Support: Keep the three truth tables on the board for the whole lesson.
Where it leads
Next: Bits all the way down (tracing text and colours to binary).
Code links: and, or and not in Python and MakeCode conditions are these gates; the Robotics course uses them to combine sensor readings.
What each step is for
two switches in a line: Committing to whether the lamp lights with one of two switches in a line tests the new move: in series, the output is 1 only when both inputs are 1 (AND).
Try: every combination: Trying all four combinations on the circuit settles the prediction and fills the truth table: only 1 and 1 lights the lamp.
Worked example: AND and OR: Building the AND and OR truth tables row by row, then the chain from two states to computing, models the new move. Sam reads OR as one or the other but not both, the misconception planted after the method.
Vary: change the gate: Each task changes one thing: the gate (AND to OR), the inputs (one on, both on), then NOT's single input, then the only row that lights AND.
gates: Outputs of AND, OR and NOT for given inputs, choosing a gate for a real rule, and a review of binary from lesson 5.
add two bits: Making a half adder show 1 + 1 = 10 reverses the process: students choose the inputs for a wanted output, and see gates doing binary addition.