From switches to circuits — build a computer from scratch
Interactive companion to Issue 2: Building the First Brains
Click the switches to toggle inputs. Watch the output change instantly.
Two gates, one addition. This is how computers add.
A single XOR gate computes the sum bit, and a single AND gate computes the carry bit. Toggle A and B to add two single-bit numbers.
Add a carry-in and you can chain adders together.
A full-adder takes three inputs: A, B, and a Carry-In from the previous column. It produces a Sum and a Carry-Out, which feeds into the next column.
Toggle any bit. Watch the result ripple through four full-adders.
Each column feeds its carry-out into the next column's carry-in, just like carrying in decimal addition. Toggle the bits below to add two 4-bit numbers.