Module 4 · Yes, No, And, Or

Can you tell what’s inside a circuit without opening it?

Lesson 4.3 · The Box Marked ?

Jenny · Mark · Rob

Three cereal boxes. Three mystery gates.

Jenny hides each gate under a cereal box with a question mark on it.

Two switches stick out the front, the bulb sits on top. The challenge: flip the switches, watch the bulb, name the gate.

Mark says that’s impossible without looking. Rob says that’s exactly what Claude Shannon would have done.

The short answer

Yes. Try every combination of inputs, write down every output, and the pattern names the gate. Boole wrote the logic as algebra, Shannon wired it into switches, and Jenny hid it under cereal boxes. Same logic all three times.

Try it yourself

Each gate is hidden. Test it, then name it.

Mystery box one.

?
Light off

Flip the switches a few ways first, then guess.

What you just did has a name

Boolean logic

Boolean logic is a way of reasoning with only true and false, joined by AND, OR and NOT.

George Boole wrote it down as algebra in 1854, long before electronics.

In 1937 Claude Shannon showed that switches can carry it out.

That’s why a circuit can be described completely by its truth table: try every input, record every output, and you know the logic, no matter what’s inside the box.

A few more things

What, not how

Two circuits wired completely differently can have the same truth table. If they do, they’re the same gate as far as the rest of the computer cares.

How chips get tested

Chip makers test parts by feeding in inputs and checking the outputs against what the truth table says. They can’t look at every transistor, so they test behavior.

Search engines use it too

Typing “cats AND dogs” or “cats -dogs” into some search tools is Boolean logic. AND narrows, OR widens, NOT excludes.

Go deeper

The longer version, if you want it.

From relays to transistors

Shannon’s switches were relays: little electromagnets that pull a metal arm to close a circuit, with an audible click. Early computers were built from thousands of them, and you could hear them think.

Vacuum tubes replaced relays, transistors replaced tubes, and the logic never changed. A modern processor runs exactly the algebra Boole wrote down and Shannon wired up, just on switches you’d need a microscope to see.

Quick check

You flip both switches off and the light comes on. What would you need to do to be sure what gate it is?

Let’s take it slower

Think of a vending machine you can’t open. You can still figure out its rules: put in a dollar and press B4, get chips. Press B4 with no money, get nothing. Try every combination of “money or not” and “button or not” and you know how it decides. That’s a truth table, and it’s how you name a mystery gate.

More examples

1

The light switch at the top of the stairs

Two switches, one light, and flipping either one changes it. Try every combination and you’ll find it behaves like XOR.

2

Your game controller combo

A special move fires when you hold one button AND press another, but NOT if a third is down. Gamers work out these truth tables by trying every combination.

Back to the question

So can you tell what’s inside without opening it?

Show the answer

Yes. Try every combination of inputs, write down every output, and the pattern names the gate. Boole wrote the logic as algebra, Shannon wired it into switches, and Jenny hid it under cereal boxes. Same logic all three times.

One last question

Build the steps for naming a mystery gate.

Tap the pieces in order. Tap one again to take it back.

…
Talk Card

Talk Card · 4.3

You don’t need to open a circuit to know what it does. Try every input, write down every output, and you’ve got it.

How Computers Work · pettigrewlab.com/learn

Next lesson