| ISSUE 93/456 · COMPUTER SCIENCE |
~4 MIN |
FOUNDATION / CS · REPRESENTING NUMBERS · READING DATE 2027-01-02 · JANUARY 2027 — MOTION AND COMPUTING FOUNDATIONS
Why does 1010 mean ten to a computer?
START HERE
The digit 2 means different amounts in the numbers 2, 20 and 200. Binary notation writes whole numbers using only two digits, 0 and 1, with each position worth twice the position to its right. The symbols look unfamiliar, but the job is the same as ordinary place value: record an amount using weighted positions.
|
/ WHY NOW
You do not need to imagine a computer counting enormous strings one mark at a time. A short pattern of on-or-off choices can stand for a much larger number because position carries information.
|
/ THE IDEA
In everyday decimal notation, successive places are worth one, ten, one hundred and so on. In unsigned binary notation they are worth one, two, four, eight and so on. Unsigned means we are representing zero and positive whole numbers here, not using any position to encode a negative sign. A bit is one stored choice between two alternatives, read as 0 or 1. For this number format, 1 includes a position’s weight and 0 leaves it out. The electronics storing a bit are not literally little written digits; the digits describe how we interpret their distinguishable conditions.
THE FORMAL IDEA
value = b₃×8 + b₂×4 + b₁×2 + b₀×1
| b₃ through b₀ are four binary digits, each either 0 or 1. | | The small labels identify positions; b₀ is the rightmost. The weights are powers of two, starting with 2⁰ = 1. |
|
RUN THE TINY EXAMPLE
Change one thing. Predict what happens.
Toy four-bit counter: 1010 = 1×8 + 0×4 + 1×2 + 0×1 = 10. Change only the rightmost digit: 1011 = 8 + 2 + 1 = 11. Change the leftmost digit instead: 0010 = 2. Four positions provide 2×2×2×2 = 16 patterns, representing 0 through 15.
|
Flipping one bit does not have a fixed numerical effect. It changes the value by that bit’s positional weight. The leftmost flip changed our counter by eight; the rightmost changed it by one. That gives a concrete reason why not all changed bits are equally significant.
/ SO WHAT?
When a four-bit counter reaches 1111, adding one needs a fifth position: 10000. If the storage remains four bits, the program needs a rule for that excess, such as reporting an error or wrapping. Merely knowing that the storage contains bits does not tell you which rule was chosen.
ONE CAVEAT |
| The same bit pattern can represent text, colour, a signed number or something else under another encoding. This calculation applies only after choosing unsigned whole-number place value. |
KEEP THIS
A binary digit changes an amount according to its position, and adding a position doubles the number of available patterns.
|
NEXT: Why the same push moves an empty trolley more
|