Binary-Coded Decimal — Where Numbers Become Art
In BCD, each decimal digit is represented by its own four-bit binary sequence. The number 9 becomes 1001. The number 42 becomes 0100 0010. Simple. Precise. Beautiful.
Each digit maps to exactly four bits. No ambiguity, no approximation.
BCD preserves the decimal structure humans understand naturally.
Financial systems rely on BCD to avoid floating-point rounding errors.
The conversion is mechanical. Elegant. A machine could learn it in one clock cycle.
BCD addition requires a correction step — when a nibble exceeds 1001 (9), add 0110 (6) to carry into the next decimal place. The error becomes the method.
Multi-digit numbers simply chain their nibbles. Each decimal digit occupies its own four-bit lane, independent of its neighbors. The number 42 is not stored as binary 101010 — it is stored as 0100 0010, preserving its decimal identity.
When the sum exceeds the nibble boundary, bits cascade. The carry propagates. For a fraction of a cycle, the data is neither here nor there — it exists in the space between valid states.
When 7 + 8 yields 1111 (15 in binary), the result exceeds the valid BCD range. Add 0110 — the six forbidden states — and the carry propagates upward, splitting the answer into two valid nibbles: 0001 0101. The error corrects itself.
In BCD, the bit patterns 1010 through 1111 have no meaning. They are the void between valid encodings — six ghost states that exist in the hardware but represent nothing. When a circuit encounters one, it must correct or crash.
The glitch resolves. The carry completes. Every bit finds its place. The stream continues — because data never stops, and neither does the count.