Full adder
One bit of A, one bit of B, and a carry-in. XOR computes the sum bit; AND and OR compute the carry-out.
S = A ⊕ B ⊕ Cin
Choose two numbers. The circuit below is a chain of four full adders — each bit is summed locally, and the carry ripples toward the high bit.
Toggle any bit, or step the decimal value. Range is 0–15.
Result
The same sum written the way you would add binary on paper. Small digits are carries.
Least-significant bit on the right. Click a full adder to inspect its gates.
Five gates: two XOR, two AND, one OR.
One bit of A, one bit of B, and a carry-in. XOR computes the sum bit; AND and OR compute the carry-out.
S = A ⊕ B ⊕ Cin
A ∧ B generates a carry regardless of Cin. A ⊕ B propagates an incoming carry to the next bit.
Cout = (A ∧ B) ∨ (Cin ∧ (A ⊕ B))
Cout of bit i is Cin of bit i+1. The carry must travel the whole chain, which is why this adder is simple — and slow in silicon.
C0 = 0