09.12.2012 Views

DIGITAL DESIGN

DIGITAL DESIGN

DIGITAL DESIGN

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Section 2.10 Binary Codes for Decimal Numbers 45<br />

DO NOT COPY<br />

Table 2-9 Decimal codes.<br />

Decimal digit BCD (8421) 2421 Excess-3 Biquinary 1-out-of-10<br />

0 0000 0000 0011 0100001 1000000000<br />

DO NOT COPY<br />

1 0001 0001 0100 0100010 0100000000<br />

2 0010 0010 0101 0100100 0010000000<br />

3 0011 0011 0110 0101000 0001000000<br />

4 0100 0100 0111 0110000 0000100000<br />

DO<br />

5 0101<br />

NOT<br />

1011 1000 1000001<br />

COPY<br />

0000010000<br />

6 0110 1100 1001 1000010 0000001000<br />

7 0111 1101 1010 1000100 0000000100<br />

8 1000 1110 1011 1001000 0000000010<br />

DO<br />

9 1001<br />

NOT<br />

1111 1100 1010000<br />

COPY<br />

0000000001<br />

Unused code words<br />

1010 0101 0000 0000000 0000000000<br />

1011 0110 0001 0000001 0000000011<br />

DO NOT COPY<br />

1100 0111 0010 0000010 0000000101<br />

1101 1000 1101 0000011 0000000110<br />

1110 1001 1110 0000101 0000000111<br />

1111 1010 1111 ⋅⋅⋅ ⋅⋅⋅<br />

DO NOT COPY<br />

tions, 0000 through 1001. The code words 1010 through 1111 are not used.<br />

Conversions between BCD and decimal representations are trivial, a direct substitution<br />

of four bits for each decimal digit. Some computer programs place two<br />

BCD<br />

DO<br />

digits in one 8-bit byte<br />

NOT<br />

in packed-BCD representation; thus,<br />

COPY<br />

one byte may packed-BCD<br />

represent the values from 0 to 99 as opposed to 0 to 255 for a normal unsigned 8- representation<br />

bit binary number. BCD numbers with any desired number of digits may be<br />

obtained by using one byte for each two digits.<br />

As with binary numbers, there are many possible representations of negative<br />

DO<br />

BCD numbers. Signed BCD<br />

NOT<br />

numbers have one extra digit<br />

COPY<br />

position for the<br />

BINOMIAL The number of different ways to choose m items from a set of n items is given by<br />

COEFFICIENTS<br />

DO<br />

a<br />

NOT<br />

binomial coefficient, denoted ⎛n⎞ COPY<br />

, whose value is -----------------------------n!<br />

. For a 4-bit<br />

⎝m⎠ decimal code, there are ⎛16⎞ m! ⋅ ( n – m! )<br />

different ways to choose 10 out of 16 4-bit code<br />

⎝10⎠ words, and 10! ways to assign each different choice to the 10 digits. So there are<br />

16!<br />

---------------- ⋅ 10! or 29,059,430,400 different 4-bit decimal codes.<br />

10! ⋅ 6!<br />

Copyright © 1999 by John F. Wakerly Copying Prohibited

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!