Download presentation
Presentation is loading. Please wait.
Published byGwenda Stevenson Modified over 9 years ago
2
Coding of Information Assign a unique string of binary digits to each piece of information There are many standard coding groups –Decimal Codes (BCD – Binary Coded Decimal) Ways to encode the first 10 symbols of the decimal number system. –Unit-Distance Codes Only one bit changes between succesive values –Alphanumeric Codes Ways to encode characters and numeric data
3
BCD Codes To represent the first 10 digits in decimal (0-9), how many bits are needed? –With 3 bits, there are 8 different combinations –With 4 bits, there are 16 different combinations Since only 10 different combinations are needed, use 4 bits – 6 combinations will not be used.
4
Weighted Decimal Codes Decimal Digit8421 Code2421 Code5421 Code7536’ Code 00000 10001 1001 20010 0111 30011 0010 40100 1011 50101101110000100 60110110010011101 70111110110101000 8 111010110110 91001111111001111
5
BCD Codes (Decimal Codes) Weighted Code –8421 code Most common Default The corresponding decimal digit is determined by adding the weights associated with the 1s in the code group. **** The BCD representation is NOT the binary equivalent of the decimal number ***** –623 10 = 0110 0010 0011 –2421, 5421,7536, etc… codes The weights associated with the bits in each code group are given by the name of the code
6
BCD Codes (Decimal Codes) Nonweighted Codes –2-out-of-5 Actually weighted 74210 except for the digit 0 Used by the post office for scanning bar codes for zip codes Has error detection properties
7
Unit Distance Codes Important when an analog quantity must be converted to a digital representation. Only one bit changes between two successive integers which are being coded.
8
Unit-Distance Codes (Gray Code) Decimal DigitGray Code Decimal DigitGray Code 00000 81100 10001 91101 20011 101111 30010 111110 40110 121010 50111 131011 60101 141001 70100 151000
9
Alphanumeric Codes Codes to handle alphabetic and numeric information, special symbols, punctuation marks, and control characters. ASCII (American Standard Code for Information Interchange) is the best known. Unicode – a 16-bit coding system provides for foreign languages, mathematical symbols, geometrical shapes, dingbats, etc…
10
b6b5b4b6b5b4 b3b2b1b0b3b2b1b0 000001010011100101110111 0000NULDLESP0@P`p 0001SOHDC1!1AQaq 0010STXDC2"2BRbr 0011ETXDC3#3CScs 0100EOTDC4$4DTdt 0101ENQNAK%5EUeu 0110ACKSYN&6FVfv 0111BELETB‘ 7GWgw 1000BSCAN(8HXhx 1001HTEM)9IYiy 1010LFSUB*:JZjz 1011VTESC,;K[k{ 1100FFFS,<L\l| 1101CRGS- M]m} 1110SORS. >N^n~ 1111SIUS/ ?O_oDEL ASCII Code
11
UNICODE UNICODE is a 16-bit code for representing alphanumeric data. With 16 bits, can represent 2 16 or 65536 different symbols. 16 bits = 2 Bytes per character. $0041-005A A-Z $0061-4007A a-z Some other alphabet/symbol ranges $3400-3d2d Korean Hangul Symbols $3040-318F Hiranga, Katakana, Bopomofo, Hangul $4E00-9FFF Han (Chinese, Japenese, Korean) UNICODE used by Web browsers, Java, most software these days.BR 2/00
12
Error Detection and Error Correction Codes
13
How Much Memory? Memory is purchased in bits – –How many bits do I need if I want to distinguish between 8 colors? –How many bits do I need if I want to represent 16 million different colors?
14
How Much Memory? How many bits do I need if I want to distinguish between 8 colors? 2 x-1 < 8 <= 2 x x = 3 (3 bits are needed) How many bits do I need if I want to represent 16 million different colors? 2 x-1 < 16 million <= 2 x 16M = 1Mx16 = 2 20 x2 4 = 2 24 x = 24 (24 bits are needed)
15
What do you need to know? Codes (Binary, Weighted BCD (8421 Code), Alphanumeric (ASCII), Unit Distance(Gray)) Number of bits needed?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.