Understanding Binary Arithmetic: The Light Switch

Discover how binary arithmetic works through an engaging light switch analogy. Learn why computers think in 0s and 1s, and how addition works at the most fundamental level.

Author

Mr. Oz

Date

Read

5 mins

Level 1

A row of light switches demonstrating on/off states like binary digits

Author

Mr. Oz

Date

Read

5 mins

Share

Imagine a wall with light switches — each switch can only be ON or OFF. No dimmer, no halfway setting. Just two states: on or off. This is exactly how computers think!

Welcome to the world of binary arithmetic.

The Light Switch Analogy

Let's explore binary numbers through a wall of switches:

  • Each switch: Represents one binary digit (called a "bit")
  • OFF (down): Represents 0
  • ON (up): Represents 1
  • The row: A binary number made of multiple switches (bits)
[ON] [OFF] [ON] [ON] [OFF] → 1 0 1 1 0 (binary for 22)

Why Binary? Why Not Decimal?

Computers use binary because electronic components are most reliable in two states:

  • Voltage high or low: Easy to distinguish 0V vs 5V (or similar)
  • Magnetic polarity: North or south on hard drive platters
  • Light on or off: Fiber optic cables, optical drives
  • Charge present or absent: SSD memory cells

Ten distinct states (decimal) would be much harder to implement reliably. The electrical noise would cause constant errors!

Binary Addition: Adding Two Switch Rows

When we add two binary numbers, we work right to left (just like decimal). The rules are simple:

  • 0 + 0 = 0 (both switches off → result off)
  • 0 + 1 = 1 (one switch on → result on)
  • 1 + 0 = 1 (one switch on → result on)
  • 1 + 1 = 10 (both on → result off, carry to next position)

That last rule is key: when we add 1 + 1 in binary, we get 0 and carry 1 to the left. This is like adding 5 + 5 in decimal: we get 0 and carry 1.

A Visual Example: 11 + 1 = 100

Let's add the binary numbers 11 (which is 3 in decimal) and 1 (which is 1):

   1 1   (binary for 3)
 +   1   (binary for 1)
 ------
 1 0 0   (binary for 4)
 ↑ ↑ ↑
 │ │ └── 1 + 1 = 0, carry 1
 │ └──── 1 + 0 + carry(1) = 0, carry 1
 └────── 0 + 0 + carry(1) = 1
              

Notice how the carry ripples from right to left. This "carry propagation" is the heart of binary addition!

The "All Ones" Case

What happens when all switches are ON? Like 1111 (which is 15)?

Adding 1 creates a cascade of carries:

  • Rightmost: 1 + 1 = 0, carry 1
  • Second: 1 + carry(1) = 0, carry 1
  • Third: 1 + carry(1) = 0, carry 1
  • Fourth: 1 + carry(1) = 0, carry 1
  • New position: carry(1) = 1

Result: 10000 (16 in decimal). We needed an extra switch!

Place Values: Powers of 2

In decimal, each position is worth 10× more (ones, tens, hundreds...). In binary, each position is worth 2× more:

Position 4 3 2 1 0
Value 16 8 4 2 1
Power 2⁴ 2⁰

So 10110 = 16 + 0 + 4 + 2 + 0 = 22

Real-World Examples

  • Digital counters: Your microwave timer, digital clock — all binary underneath
  • IP addresses: 192.168.1.1 is just binary numbers separated by dots
  • Colors: RGB values (0-255) are 8-bit binary numbers
  • Text: Each character is stored as a binary number (ASCII/Unicode)

Key Takeaways

  • Binary means base-2: only 0 and 1, like switches being off or on
  • Computers use binary because electronic components are most reliable in two states
  • Addition rules: 0+0=0, 0+1=1, 1+1=10 (carry the 1)
  • Carry propagation is the key concept — carries ripple from right to left
  • Each position is worth 2× the previous (1, 2, 4, 8, 16, 32...)

All Levels