How do binary numbers work?
Explore the drawing, then read the explanation and its limits.
Loading the drawing…
Controls become available when the drawing is ready.
Playback time is illustrative, not a real-world rate. Labels off hides annotations; the facts and limits below stay visible.
Parts
Hover or focus to highlight; tap to pin or release.
Explanation
Binary notation uses digits that are either zero or one. In this eight-bit example, the positions have weights of 128, 64, 32, 16, 8, 4, 2 and 1, from left to right. To find the value, add the weights whose bits are one. Leading zeroes stay visible so every position can be compared.
For example, 00101010 has ones at the positions worth 32, 8 and 2. Their sum is 42. The same value is hexadecimal 2A, commonly written 0x2A. A hexadecimal digit groups four bits together. The letter A means ten; the prefix 0x signals hexadecimal notation and is not another digit in the value.
The animation counts within an unsigned byte. After 255 it wraps back to zero. Its pace is chosen for demonstration and is not a processor clock speed. This view explains number notation, not the order of bytes in computer memory. Signed numbers and floating-point representations are outside this particular model.
Source lines for every paragraph (JSON)Facts and simplifications
The facts below use the library’s ledgers and their stated simplifications. References are inherited from the library’s offline ledgers; external sources have not been newly checked.
Basis and source status · docs/hardware/FACTS-HARDWARE.md
Based on the hardware fact ledger’s digital-design and computer-systems references. This unsigned eight-bit model wraps after 255; signed numbers, floating point and memory byte order are outside its scope.
Source: docs/hardware/FACTS-HARDWARE.md, lines 22–23, 151–157.
Ledger line 151: “Binary, bytes & hexadecimal”; “An unsigned byte \| leftmost bit has the greatest weight”
docs/hardware/FACTS-HARDWARE.md:151 | “Binary, bytes & hexadecimal”; “An unsigned byte \| leftmost bit has the greatest weight” | The picture uses unsigned eight-bit positional notation, most-significant bit at left. | DD/CS, number representation. **Scope:** this is notation, not byte order in memory. No signed/two's-complement or floating-point interpretation. |
Ledger line 152: Place weights 128, 64, 32, 16, 8, 4, 2, 1; each bit 0 or 1
docs/hardware/FACTS-HARDWARE.md:152 | Place weights 128, 64, 32, 16, 8, 4, 2, 1; each bit 0 or 1 | An unsigned byte's value is the sum of the active powers of two. | DD/CS. **Exact:** weights are 2^7 through 2^0. Leading zero bits are retained. |
Ledger line 153: “Decimal 42 = hexadecimal 0x2A”; bits 00101010; “2 = 2”, “A = 10”; “32 + 8 + 2 = 42”
docs/hardware/FACTS-HARDWARE.md:153 | “Decimal 42 = hexadecimal 0x2A”; bits 00101010; “2 = 2”, “A = 10”; “32 + 8 + 2 = 42” | Equivalent representations of 42. | Exact base conversion, checked. `0x` is a common programming notation for a hexadecimal literal; it is not an extra digit. |
Ledger line 154: “Decimal 175 = hexadecimal 0xAF”; bits 10101111; “A = 10”, “F = 15”; “128 + 32 + 8 + 4 + 2 + 1 = 175”
docs/hardware/FACTS-HARDWARE.md:154 | “Decimal 175 = hexadecimal 0xAF”; bits 10101111; “A = 10”, “F = 15”; “128 + 32 + 8 + 4 + 2 + 1 = 175” | Equivalent representations of 175. | Exact base conversion, checked. |
Ledger line 155: Two four-bit brackets; dynamic digit/decimal captions and weighted sums
docs/hardware/FACTS-HARDWARE.md:155 | Two four-bit brackets; dynamic digit/decimal captions and weighted sums | Each group of four bits maps to one hex digit. | DD/CS. The high nibble contributes 16×its digit value, low nibble contributes its digit value. All 256 supported bytes checked both ways. Zero uses “0 = 0” for its empty weighted sum. |
Ledger line 156: “8 bits = 1 byte \| 4 bits = 1 hex digit \| A to F mean 10 to 15”
docs/hardware/FACTS-HARDWARE.md:156 | “8 bits = 1 byte \| 4 bits = 1 hex digit \| A to F mean 10 to 15” | Modern byte convention and hexadecimal digit values. | DD/CS. **Exact in the stated eight-bit model**; not a claim about every historical use of the word byte. A=10, B=11, C=12, D=13, E=14, F=15. |
Ledger line 157: Time-driven count, wrapping 255 to 0
docs/hardware/FACTS-HARDWARE.md:157 | Time-driven count, wrapping 255 to 0 | The optional counter is an unsigned eight-bit modulo-256 model. | DD, finite-width representation. **Editorial cadence:** `rate` is demonstration counts per second, not a processor clock. Bits change discretely, without fractional intermediate values. |