Math Inside Computers
Teens & adults Computing Binary
Every computer on Earth — phone, game console, spacecraft — does all of its math in binary: place value with two digits instead of ten. Once you know place value from our bases page, you already understand the whole trick. This page is where arithmetic meets the machine.
Binary: place value with two digits
A single binary digit is a bit. Eight bits make a byte — one byte counts 0 to 255, which is why 255 keeps appearing in tech (colors, old game stats, network addresses).
Why computers chose binary
Not because binary is elegant — because electronics are reliable at two states (current flowing / not flowing). Claude Shannon proved in 1937–48 that binary arithmetic and true/false logic are the same mathematics, so circuits can "reason":
- Shannon, C. E. (1948). A mathematical theory of communication. Bell System Technical Journal, 27(3–4). doi:10.1002/j.1538-7305.1948.tb01338.x — information theory's founding paper, on IEEE Xplore.
The famous surprise: 0.1 + 0.2 ≠ 0.3
Type 0.1 + 0.2 into almost any programming language and
you'll get 0.30000000000000004. Not a bug — math. Decimal
0.1 is a repeating fraction in binary (like 1/3 is 0.333… in decimal),
so the computer stores the nearest value it can, and the rounding
shows. Every computer handles this identically because they all follow
one standard:
- IEEE (2019). IEEE Standard for Floating-Point Arithmetic (IEEE 754-2019). IEEE, pp. 1–84. doi:10.1109/IEEESTD.2019.8766229 — the international standard every chip follows.
- Goldberg, D. (1991). What every computer scientist should know about floating-point arithmetic. ACM Computing Surveys, 23(1), 5–48. doi:10.1145/103162.103163 — the canonical tutorial, in the ACM Digital Library.
- Wing, J. M. (2006). Computational thinking. Communications of the ACM, 49(3), 33–35. doi:10.1145/1118178.1118215
- Convert 1010 binary to decimal (8 + 2 = 10)
- How many values fit in 4 bits? (2⁴ = 16)
- Is 0.5 exact in binary? (yes — it's 2⁻¹)