Chen–Ho encoding is an efficient alternate system of binary encoding for decimal digits.
The traditional system of binary encoding for decimal digits, known as binary-coded decimal (BCD), uses four bits to encode each digit, resulting in significant wastage of binary data bandwidth (since four bits can store 16 states and are being used to store only 10).
The concepts behind Chen–Ho encoding were first introduced in a memo from Tien Chi Chen to Irving T. Ho in 1971. Both men were working for IBM at the time, although in different locations. Tien Chi Chen also consulted with Frank C. Tung to verify the results of his theories independently.
Tien Chi Chen noted that the digits zero through seven were simply encoded using three binary digits. He also postulated that one could use a flag to identify a different encoding for the digits eight and nine, which would be encoded using a single bit.
In practice, a series of boolean transformations are applied to the stream of input bits, compressing BCD encoded digits from 12 bits per three digits to 10 bits per three digits. Reversed transformations are used to decode the resulting coded stream to BCD. Equivalent results can also be achieved by the use of a look-up table.
The final version of Chen–Ho encoding was published in 1975 in the journal Communications of the Association for Computing Machinery (CACM). This version included several refinements, primarily related to the application of the encoding system. It constitutes a Huffman-like prefix code.
Chen–Ho encoding is limited to encoding sets of three decimal digits into groups of 10 bits (so called declets). Of the 1024 states possible by using 10 bits, it leaves only 24 states unused (with don't care bits typically set to 0 on write and ignored on read). With only 0.34% wastage it gives a 20% more efficient encoding than BCD with one digit in 4 bits.