Designing Code Converters: Binary, BCD, Gray, and Excess-3

Converting between number code systems — binary, BCD, Gray code, Excess-3 — is a recurring category of digital design problem, and every conversion follows the same pattern: each output bit is its own independent Boolean function of the input bits, minimized separately. BCD-to-Gray is covered in full in the worked example; this covers BCD-to-Excess-3 as a second, equally verified case.

What Excess-3 code is

Excess-3 represents a decimal digit as its binary value plus 3 — digit 0 becomes binary 3 (0011), digit 9 becomes binary 12 (1100). It was historically used because it makes certain arithmetic operations (like nines' complement) simpler in BCD arithmetic circuits — the "plus 3" offset isn't arbitrary, it shifts the valid digit range so useful symmetries appear in the resulting bit patterns.

DigitBCDExcess-3
000000011
100010100
200100101
300110110
401000111
501011000
601101001
701111010
810001011
910011100

All four output bits, minimized and verified

E3 = BD + BC + A
E2 = B′D + B′C + BC′D′ + A
E1 = C′D′ + CD
E0 = D′

E0 stands out — a single literal. The least significant Excess-3 bit is simply the complement of the least significant BCD bit, for every valid digit, no exceptions. That's a direct, verifiable consequence of adding an odd number (3) to any value: it always flips the least significant bit. Worth noticing on sight for any "add an odd constant" code conversion, not just this one.

Same technique, different output table

Whether the target is Gray code, Excess-3, or any other code conversion, the process is identical: build the truth table for each output bit against the input bits, apply don't-cares for any input codes guaranteed never to occur (as covered generally in Handling Don't-Care Conditions in K-Maps), and minimize each bit independently. Nothing about the specific target code changes the method — only the resulting truth tables differ.

Try a code conversion of your own directly on the Truth Table to K-Map converter.

Try it on the solver

Work through the examples above directly — enter the same minterms or expression into the live tool.

Open the K-Map Solver