← Play logic for baby

Logic gates, one switch at a time.

Logic for baby is an interactive beginner's playground for six fixed circuits: WIRE, NOT, OR, AND, XOR and a simple memory latch. Tap an input switch and watch the output light. It is a teaching model, not an electronic circuit design or timing simulator.

In the tables below, 0 means off and 1 means on. A and B are inputs; the light shows the output.

WIRE

The output follows input A.

WIRE truth table
AOutput
00
11

NOT

The output is the opposite of input A.

NOT truth table
AOutput
01
10

OR

The output is on when at least one input is on.

OR truth table
ABOutput
000
011
101
111

AND

The output is on only when both inputs are on.

AND truth table
ABOutput
000
010
100
111

XOR

The output is on when exactly one input is on. Unlike OR, two on inputs produce an off output.

XOR truth table
ABOutput
000
011
101
110

LATCH

This demonstration remembers one bit. Tap SET (+) to turn the output on. It stays on until RESET (−) is tapped. The most recently tapped button wins. Switching to a different circuit or using the top reset control clears the memory.

This is a simplified sequential-button memory demonstration, not a complete SR-latch simulation. It does not model simultaneous SET/RESET signals, invalid states, propagation delay or metastability.

Memory actions
ActionNext output
SET1
RESET0
No actionPrevious value

How to explore

Use the arrows, the six navigation dots or the left/right keyboard keys to change circuits. On a touchscreen, swipe horizontally over the board away from the buttons. Tap ? for a short explanation. The reset control clears the current circuit.

On a portrait screen the output light sits above the inputs. In landscape, inputs sit on the left and the output on the right. The logical result stays the same.

Try this comparison

Turn both A and B on in OR, then repeat in XOR. OR lights up; XOR stays off. Next try AND with just one input on: the light stays off until the second input is also on.

Try the circuits →