Presentation is loading. Please wait.

Presentation is loading. Please wait.

2.3 Binary Codes for Decimal Numbers ReturnNext Code: A set of n-bit strings in which different bit strings represent different numbers or other things.

Similar presentations


Presentation on theme: "2.3 Binary Codes for Decimal Numbers ReturnNext Code: A set of n-bit strings in which different bit strings represent different numbers or other things."— Presentation transcript:

1 2.3 Binary Codes for Decimal Numbers ReturnNext Code: A set of n-bit strings in which different bit strings represent different numbers or other things is called a code. Code Word: A particular combination of n bit-values is called a code word. BCD: Binary-coded decimal (BCD) which encodes the digits 0 through 9 by their 4- bit unsigned binary representations

2 NextBackReturn DD84212421Ex-3Biquinary1-out-of-10 00000 001101000011000000000 10001 010001000100100000000 20010 010101001000010000000 30011 011001010000001000000 40100 011101100000000100000 501011011100010000010000010000 601101100100110000100000001000 701111101101010001000000000100 810001110101110010000000000010 910011111110010100000000000001 2.3 Binary Codes for Decimal Numbers

3 NextBackReturn Unused code words (Pseudo Code) 10100101000000000000000000000 10110110000100000010000000011 11000111001000000100000000101 11011000110100000110000000110 11101001111000001010000000111 111110101111 …… 2.3 Binary Codes for Decimal Numbers

4 NextBackReturn Examples: 1. (1001) 8421BCD =( ? ) 10 (1001) 8421BCD =1  8+0  4+0  2+1  1=(9) 10 2. (1011) 2421BCD =( ? ) 10 (1011) 2421BCD =1  2+0  4+1  2+1  1=(5) 10 Weighted Code: 8421 code and 2421 code are weighted codes. The weights for the BCD bits are 8,4,2,1 and 2,4,2,1. 2.3 Binary Codes for Decimal Numbers

5 (1011) 242 complement = (0100), it ’ s a 2421 code word for decimal digit 4. NextBackReturn Self-Complementing Code: The 2421 code and the excess-3 have the advantage that they are self-complementing. But excess-3 code is not weighted. Example: What is the 9s ’ complement code of (1011) 2421 ? Is the complement code a 2421 code word? 2.3 Binary Codes for Decimal Numbers

6 NextBackReturn The biquinary code and 1-out-of-10 code use more than the minimum number of bits in a code. The potential advantage is an error-detecting property. Example: Any errors can be detected in the following codes? (1011000) biquinary, (0001000) biquinary, (1010000000) 1-out-of-10 2.3 Binary Codes for Decimal Numbers

7 BackReturn Packed- BCD Representation: Each decimal digit is represented four bits. So one 8-bit byte may represent the value from 0~99; 12 bits may represent the value from 0~999; and so on. Example: (10010100) 8421 =( ? ) 10 (10010100) 8421 =(94) 10 2.3 Binary Codes for Decimal Numbers


Download ppt "2.3 Binary Codes for Decimal Numbers ReturnNext Code: A set of n-bit strings in which different bit strings represent different numbers or other things."

Similar presentations


Ads by Google