Combinations of binary digits for decimal numbers

digital-logic

  1. Four bits are required to represent the ten decimal digits, and since there
    are 2^4 combinations of four binary digits, six combinations are not used and the code is
    said to contain redundancy.

  2. The four binary digits can be allocated to ten decimal digits in a purely arbitrary
    manner and it is possible to generate 2.9 • 10^10 four-bit codes, only a few of which
    have any practical application.

Can anyone explain the second point?

Best Answer

The mapping ("0000" => '0' decimal, "0001" => 1, "0010" => 2 ... "1001" => '9' decimal) is one possible allocation of binary codes to decimal.

("0000" => 0, "0001" => 1, "0011" => 2, ...) is another, a Gray code.

("1010" => 0, "0010" => 1, "1111" => 2, ...) is another, randomly generated. The mapping doesn't have to be in order, it's just much more convenient that way.

There are 2.9 • 10^10 such mappings from (all the 16 possible 4-bit codes) to (10 decimal digits).