Four full adders in a chain — add two nibbles and watch the carry ripple. A ready-made arithmetic circuit you can open in the TorchAnvil simulator.
The full adder takes three input bits — A, B,
and a carry-in — and produces a Sum bit plus a Cout. On its own
it handles a single column of binary addition. Chain four of them
together, feeding each stage's Cout into the next stage's Cin,
and you've built a 4-bit ripple-carry adder: a circuit that adds
two nibbles and produces a 5-bit result (four sum bits plus the final
carry).
This is the same structure sitting inside every CPU's arithmetic unit. Scale it up to 8, 16, 32, or 64 bits and you can add any integer your programming language knows about.
Read the circuit column by column. From the levers on the left, each
bit i feeds its own full adder:
A_i XOR B_i (partial sum), A_i AND B_i (partial
carry).C_i (the carry in from
bit i-1) in another XOR to make the final S_i, and in an AND to
make the second partial carry.C_{i+1}, the carry ripple
out to bit i+1.Bit 0's carry-in is the Cin lever (set it low for plain addition, or high if you want to add one as well). Bit 3's carry-out becomes the final Cout lamp — bit 4 of the 5-bit result.
The name is literal. When you flip a lever in the bottom-right, bit 0 updates, which recomputes its carry, which updates bit 1, whose carry then updates bit 2, and so on. In real silicon this is the adder's critical path: the carry has to cross every bit before the result settles. At four bits nobody notices; at 64 bits with billions of cycles per second, engineers switch to fancier designs like carry-lookahead, carry-select, or Kogge-Stone adders. But every one of them is just an optimization of what you're looking at.
The result is a 5-bit number: Cout S3 S2 S1 S0, with S0 on the
least-significant end. For example:
0011 (3), B = 0001 (1), Cin = 0 → result 00100 = 4. S2 lights.1111 (15), B = 0001 (1), Cin = 0 → result 10000 = 16.
Every Sum lamp goes dark, Cout lights — the carry rippled through all
four bits in one shot.1111 (15), B = 1111 (15), Cin = 1 → result 11111 = 31.
Every lamp lights.0101 (5) and B = 0011 (3). The result should be 01000
(8) — S3 lights, everything else dark.0000, then flip Cin on. The entire
"adding zero plus zero plus one" cascade fires and S0 lights. Flip
A0 on too; S0 goes dark and S1 lights. You just watched 0 + 1 + 1 = 10.1111 and sweep B upward from 0000. Each additional 1 on
B sends the carry further left, lighting a new bit each time, until
at B = 0001 you flip the whole result over to 16.