Codes in binary system BCD codes: for decimal digit; Gray code: for numbers in binary system; AsCII code: for characters; Key point Use n bits, we can make 2n different words; To make n code-words you must use log, n bits
Codes in binary system BCD codes: for decimal digit; Gray code: for numbers in binary system; ASCII code: for characters; Key point : Use n bits, we can make 2n different words; To make n code-words, you must use bits. log 2 n
BCD codes Binary codes for decimal digits Table 2-9) Decimal digit BCD(8421) 2421 Excess-3 Biquinary 1-out-of-10 0 0000 0000 0011 0100001 1000000000 0001 0001 0100 0100010 0100000000 0010 10 0100100 0010000000 oOlI 0110 0101000 0001000000 0100 0110000 0000100000 0101 1000 1000001 0000010000 6 0l10 1100 1000010 0000001000 1101 1010 1000100 0000000100 1000 110 1011 1001000 0000000010 l001 I10 1010000 000000000l Unused code words 010 0l01 0000 0000000 0000000000 0110 0001 0000001 1100 0010 0000010 0000000101 110l 1000 l101 0000011 0000000110 l110 1001 0000101 0000000111 1010
BCD codes Binary codes for decimal digits ( Table 2-9 )
BCD codes Express 10 digit(0-9): use 4 or more bits, many different way for coding Decimal digit BCD(8421) 8421 code 0000 0123 Natural code, just la ke 4-bit 0001 0010 binary numbers 0100 0101 Each digit is weighted 0110 6789 0111 It has 10 valid code words 000 1001 and 6 invalid code words
BCD codes Express 10 digit ( 0—9) : use 4 or more bits, many different way for coding 8421 code Natural code , just lake 4-bit binary numbers; Each digit is weighted; It has 10 valid code words and 6 invalid code words
BCD codes 2421 codes Decimal digit 2421 Each digit is weighted 0000 0123 0001 Self-complementing 0010 Use Msb to express 0100 1011 higher/lower part 1100 It has 10 valid codes and 110 6 invalid codes
BCD codes Each digit is weighted; Self-complementing; Use MSB to express higher/lower part; It has 10 valid codes and 6 invalid codes. 2421 codes
BCD codes Excess-3 code Decimal digit Excess-3 0 0100 Its digit is not weighted; 010l 0110 Self-complementing 3456789 01l1 1000 1001 8421code+“0011 1010 1011
BCD codes Excess-3 code Its digit is not weighted; Self-complementing ; 8421 code + “0011”
BCD codes 1-out-of-10 code Decimal digit 1-out-of-10 1000000000 0100000000 One hot code 0010000000 0001000000 It is very useful in 0000100000 0000010000 567 0000001000 control systems 0000000100 0000000010 0000000001
BCD codes 1-out-of-10 code One hot code; It is very useful in control systems
BCD codes Examples: use bcd code for decimal numbers a=19, 46 8421code:A=00011001.01000110 2421code:A=00011111.01001100 Excess-3code:A=01001100.01111001 Key point Each decimal digit is coded by a 4-bits string
BCD codes Examples: use BCD code for decimal numbers A = 19.46 8421 code : A = 0001 1001. 0100 0110 2421 code : A = 0001 1111. 0100 1100 Excess-3 code: A = 0100 1100. 0111 1001 Key point Each decimal digit is coded by a 4-bits string!
BCD codes Biquinary code: 7-bits first 2 bits for higher/lower range last 5 bits is one hot code in the range error-detecting property
BCD codes Biquinary code : 7-bits; first 2 bits for higher/lower range; last 5 bits is one hot code in the range. error-detecting property !
G ray codes Target: code for continues changed numbers (in binary system) to prevent wrong code happened in transition time; Property In each pair of successive code words, only one bit changes
Gray codes Target: code for continues changed numbers (in binary system) to prevent wrong code happened in transition time; Property : In each pair of successive code words, only one bit changes
G ray codes From binary number to gray code The length is same the msb is same; From left to right, if a bit in binary system is same as its left bit, the gray code is 0, if it is different, the gray code is 1 Examples: binary number: 10010010 01100011 Gray codes: 1101101101010010
Gray codes From binary number to Gray code The length is same, the MSB is same; From left to right, if a bit in binary system is same as its left bit, the gray code is 0, if it is different, the gray code is 1. Examples: binary number: 1001 0010 0110 0011 Gray codes: 1101 1011 0101 0010