Computers don’t think in infinity.
They think in fixed-size memory: i.e., a limited number of bits.
That single constraint completely changes how numbers behave.
The Core Idea
A computer with n bits can represent only:
0 → (2ⁿ − 1)
For example, in a 4-bit system:
2⁴ = 16 possible values → 0 to 15
No negative value, no infinity, and nothing beyond the limit.
Numbers Don’t Go Out of Range — They Wrap Around
Instead of a straight number line, computers operate like a loop:
… → 13 → 14 → 15 → 0 → 1 → …
So:
15 + 1 = 0 (overflow)
This behavior is called modular arithmetic.
Then, How Do We Represent Negative Numbers?
The equation to represent it is as follows :
-x = 2ⁿ − x
And this comes directly from the circular nature of numbers.
Example: Representing “-3“ in 4 Bits
It cannot go below 0. So the computer wraps around backwards.
Using the formula:
-3 = 2⁴ − 3
-3 = 16 − 3
-3 = 13
So in a 4-bit system :
-3 is represented as 13
⚠ Important:
This does not mean -3 equals 13.
It means:
13 behaves like -3 inside a 4-bit system.
Why This Works (The Circular Insight)
Imagine numbers placed on a circle.
Moving forward:
0 → 1 → 2 → … → 13
Moving backward:
0 → 15 → 14 → 13
Both paths land at 13.
So:
+13 ≡ -3 (mod 16)
Some math to explain above equation :
-3 and 13 behave the same when you work modulo 16.
step 1 : (13 mod 16) = 13
We want a positive remainder between 0 and 15
step 2 : (−3 mod 16) = (16−3) = 13Rule :
a≡b (mod n) means (a — b) is divisible by nTherefore :
1- Modulo = wrap into range
2- Negative numbers = wrap from the other side
So instead of storing -3, the computer finds a number that will cancel out 3 and bring the result back to 0 (within its range) in a 4-bit system, so the numbers will wrap around after 16:
3 + 13 = 16 → 0 (wrap)
And the computer stores 13 instead of −3, because it behaves the same way.
In binary:
13 = 1101 ( 1101 is how a computer represents −3 (in a 4-bit system) )
The Deep Insight
In a fixed-size system:
Moving forward with (2ⁿ − x) steps
is the same as moving backward x steps.
That’s why:
-x = 2ⁿ − x
Final Conclusion
Computers don’t store negative numbers directly.
They store a value that lands in the same position
When the number system wraps around.
That’s why:
Negative numbers = positions on a circle, not points on a line.