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.
| A | Output |
|---|---|
| 0 | 0 |
| 1 | 1 |
NOT
The output is the opposite of input A.
| A | Output |
|---|---|
| 0 | 1 |
| 1 | 0 |
OR
The output is on when at least one input is on.
| A | B | Output |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
AND
The output is on only when both inputs are on.
| A | B | Output |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
XOR
The output is on when exactly one input is on. Unlike OR, two on inputs produce an off output.
| A | B | Output |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
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.
| Action | Next output |
|---|---|
| SET | 1 |
| RESET | 0 |
| No action | Previous 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 →