The AND Gate: Two Switches and a Lamp

Before level 3 the game offers a short interactive intro: you flip switches and formulate the AND rule yourself. This page tells the same story in text.

Experiment: two switches and a lamp

The circuit has two switches, A and B, and a lamp Q. Toggle them and watch when exactly Q lights up. Going through all four combinations gives the answer: the lamp is on only when A=1 and B=1; in the other three cases it stays dark.

That is the AND rule: the output is 1 only when every input is 1.

The AND rule as a table

What you checked by clicking is written as rows. Columns A and B are the inputs, Q is the output:

ABQ
000
010
100
111

Transfer: a chain of two ANDs

Then the intro complicates the circuit: two AND gates are chained, and there are three inputs. Before clicking, guess when Q will light up. The answer: only when all three are on. The first AND demands A and B, the second adds C on top of their one.

Where it is used

An AND gate is about simultaneous conditions. A washing machine heats water only when the door is closed AND the start button is pressed. In a processor, this is how "if both conditions hold" checks work. AND is also access control: a system fires only when both keys are turned.

Take the intro in the game · Level 3 guide · All intros