How Computers Add Numbers
Every time your computer adds two numbers, it uses an Arithmetic Logic Unit (ALU) — a circuit built from simple logic gates. Each gate performs a tiny boolean operation (AND, OR, XOR), and by combining them, the ALU can add, subtract, and perform bitwise operations on binary numbers.
In Simple Terms
Binary addition works just like decimal addition, but with only two digits: 0 and 1. When you add 1 + 1, you get 10 in binary (that's 2 in decimal) — the "1" carries over to the next column, exactly like carrying in regular addition. A full adder is a small circuit that adds two bits plus a carry-in, producing a sum bit and a carry-out. Chain several together and you get a ripple carry adder that can add multi-bit numbers.
Logic Gates Used
Inside a Full Adder
Each full adder uses 2 XOR gates, 2 AND gates, and 1 OR gate:
- Sum = A XOR B XOR Carry-in
- Carry-out = (A AND B) OR (Carry-in AND (A XOR B))
The carry-out of each full adder feeds into the carry-in of the next, creating a "ripple" effect — hence the name ripple carry adder. Use the simulator below to watch this propagation in action.