Binary Subtraction
What you'll learn: How to subtract binary numbers using the borrowing method, just like you do with decimal numbers.
The Core Idea
Binary subtraction works exactly like the subtraction you learned in elementary school, but with only two digits: 0 and 1. When you can't subtract a larger digit from a smaller one, you "borrow" from the next column to the left—just like borrowing 10 in decimal, except here you borrow 2 (which is 10 in binary).
The Borrowing Rules
When subtracting binary numbers column by column (right to left):
- 0 - 0 = 0 (simple)
- 1 - 0 = 1 (simple)
- 1 - 1 = 0 (simple)
- 0 - 1 = ? (need to borrow!)
When you need to subtract 1 from 0, borrow from the next column. The 0 becomes 10 in binary (which equals 2 in decimal), so 10 - 1 = 1.
Example in Action
Let's subtract 101 (5) - 011 (3):
¹⁰¹ (cross out, becomes 100 after borrowing)
₁₀₁ (rightmost 0 becomes 10 after borrow)
- 011
-----
010 (result = 2 in decimal)
Step-by-step:
- Rightmost: 1 - 1 = 0
- Middle: 0 - 1 requires borrowing. Borrow from left column. Now it's 10 - 1 = 1
- Leftmost: After lending, 1 becomes 0. So 0 - 0 = 0
Connection to Addition
Here's the beautiful part: subtraction is actually just adding the opposite! A - B can be rewritten as A + (-B). Computers use this trick extensively with something called "two's complement" (you'll learn this later), which turns all subtraction into addition problems.
Key Takeaway: Binary subtraction uses borrowing just like decimal subtraction, borrowing 2 (10 in binary) instead of 10, and computers often convert subtraction into addition behind the scenes.