Math Fundamentals18 sections · 814 units
Open in Course

Binary Addition

Arithmetic in base-2

Adding binary numbers works like decimal addition: align digits, add column by column, carry when the sum exceeds the base.

Rules: 0+0=00 + 0 = 0, 0+1=10 + 1 = 1, 1+0=11 + 0 = 1, 1+1=101 + 1 = 10 (write 0, carry 1). Example: 1011+11011011 + 1101. Rightmost: 1+1=101+1=10 (write 0, carry 1). Next: 1+0+1=101+0+1=10 (write 0, carry 1). Next: 0+1+1=100+1+1=10 (write 0, carry 1). Leftmost: 1+1+1=111+1+1=11 (write 11). Result: 1100011000.

Binary addition is how CPUs perform arithmetic. Every addition in your code becomes a series of binary additions at the hardware level. Understanding this helps you debug overflow bugs and optimize bit manipulations.