Number Representation Codes Straight binary code Represents numbers
Number Representation Codes Straight binary code: Represents numbers using natural or straight binary form (this is a weighted code) Decimal codes: Use binary to represent a decimal value · Weighted decimal codes The location of each bit contains related weight. Example: BCD (or 8421) code, 2421 code, 7536' code, or 5043210 code · Nonweighted decimal codes The location of each bit has no related weight. Example: Excess-3 code, 2 -out-of-5 code 2/2550 A. Yaicharoen 2
Code Conversion Decimal to BCD code conversion (VS straight binary) 1 9 2 8 0001 1001 0010 1000 0111 1000 2/2550 A. Yaicharoen (decimal) (BCD) (binary) 3
Unit-Distance Codes Use when convert analog quantity to digital representation Only one bit change between two successive integer numbers Example: Gray code 2/2550 A. Yaicharoen 4
Code Conversion Binary code to Gray code conversion 1 1 2/2550 0 0 1 + + + 1 0 1 A. Yaicharoen (binary) (Gray) 5
Code Conversion Gray code to Binary code conversion 1 1 2/2550 1 + + + 0 0 1 A. Yaicharoen (Gray) (binary) 6
Alphanumeric codes Use binary to represent characters Number of bits in these codes depends on number of characters these codes represented. Example: ASCII (American Standard Code for Information Interchange) is 7 -bit code Unicode Standard is 16 -bit code 2/2550 A. Yaicharoen 7
- Slides: 11