Lab experiment
Boolean logic gates
Build digital circuits from fundamental logic gates. Drag gates onto the canvas, connect inputs to outputs with wires, and watch binary signals propagate in real time. From single gates to half-adders and latches.
NAND(a, b) = ¬(a ∧ b) — functionally complete
Gates
I/O
Preset circuits
Every digital computer, from a pocket calculator to a supercomputer, is built from logic gates. A logic gate takes one or more binary inputs (0 or 1) and produces a single binary output according to a fixed rule. The AND gate outputs 1 only when both inputs are 1. The OR gate outputs 1 when at least one input is 1. The NOT gate (inverter) flips its single input.
The NAND gate (NOT-AND) is particularly important because it is "functionally complete" — any Boolean function whatsoever can be implemented using only NAND gates. This means that in principle, an entire computer can be built from a single type of component. The XOR from NANDs preset demonstrates this: it constructs an exclusive-OR function using four NAND gates, proving that NAND alone suffices.
Combining gates yields circuits with emergent behavior. A half-adder, built from an XOR and an AND gate, adds two single-bit numbers and produces a sum and carry. Chain two half-adders and an OR gate together and you get a full adder that handles a carry input — the building block of all arithmetic circuitry. The SR latch, made from two cross-coupled NOR gates, demonstrates memory: it can "remember" a bit of information, forming the basis of all computer storage.
Claude Shannon's 1937 master's thesis showed that Boolean algebra could be used to analyze and design switching circuits, founding the field of digital circuit design. Today, a modern processor contains billions of logic gates etched into silicon, each one performing the same simple operations you can explore here. The staggering complexity of modern computing emerges entirely from these humble building blocks.