revised version
TRANSCRIPT
PRESENTATION ON
CHARACTER CODES
Submitted by:Dilpreet
Itisha
CHARACTER CODE In computer and machine- based
terminology , a character is a unit of information such as an alphabet .
Character could not be stored as in original form because they were not represented by binary digits.
So binary codes were introduced and each character was represented by different binary combination.
It is known as computer character codes.
TYPES OF CHARACTER CODES ASCII Code (American Standard Code for
Information Interchange)
EBCDIC Code (Extended Binary Coded Decimal Interchange Code)
Gray Code
BCD Code (Binary Coded Decimal)
Excess-3 Code/ XS-3 Code
ASCII CODE ASCII is a code for representing english
characters as numbers from 0-127. ASCII code is a 7 bit code. Format for ASCII code is X6 X5 X4 X3 X2 X 1
X0 where each X is a 0 or a 1.
ASCII Codes for uppercase and lowercase characters :
A to Z 65-90a to z 97-112
Digits X 3X2 X1 X0
011 X6 X5 X4100
X 6X5 X4 101
X 6X5 X4110
X 6X5 X4111
0000 0 P p0001 1 A Q a q0010 2 B R b r0011 3 C S c s0100 4 D T d t0101 5 E U e u0110 6 F V f v0111 7 G W g w1000 8 H X h x1001 9 I Y i y1010 J Z j z1011 K k1100 L l1101 M m1110 N n1111 O o
EBCDIC CODE EBCDIC stands for Extended Binary Coded
Decimal Interchange Code .
It is a 8 bit code.
It is used by large computers for transferring alphanumeric data .
Digits 0111 1000 1001 1100 1101 1110 1111
0000 a j 0
0001 b k s A J 1
0010 c l t B K S 2
0011 d m u C L T 3
0100 e n v D M U 4
0101 f o w E N V 5
0110 g p x F O W 6
0111 h q y G P X 7
1000 i r z H Q Y 8
1001 I R Z 9
BINARY CODED DECIMAL It is a method that use Binary Digits 0 which
represent “off” and 1 which represent “on”.
Each digit is called a Bit . 4 bits are called Nibble which is use to represent each decimal digit (0-9).
BCD is also named as BCD-8421 code.
8421 represent 16 numbers (0000-1111) but in 8421 BCD only first ten are used , rest of the six code combinations are invalid (1010,1011,1100,1101,1110,1111).
Decimal Digits (0-9) BCD Code
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
FOR EXAMPLE:BCD code of 25 will be….11001
How?
. . . . .32 16 8 4 2 1 1 1 0 0 1
As 16+8+1=25
GRAY CODE The gray code is the non-weighted code, &
is not suitable for the arithmetic operations.
It is not a BCD code but a cyclic code because successive code words in this code differ in one bit position only, i.e. it is a unit distance code.
Reason for the popularity of the gray code is its ease of conversion to & from binary.
Gray codes are used in instrumentation & data acquisition systems where linear or angular displacement are measured.
PROCEDURE FOR BINARY TO GRAY CONVERSION
Record the MSB of the binary as MSB of the gray code.
Add the MSB of binary to the next bit in binary, recording the sum & ignoring the carry. This sum is the next bit of the gray code.
Add the 2nd bit of binary to the 3rd bit of binary, 3rd to 4th & so on.
Record the successive sums as the successive bits of the gray code until all the bits of the binary number are exhausted.
FOR EXAMPLE:Convert the binary 1001 to gray code.
Binary: 1 + 0 + 0 + 1 | | | | Gray: 1 1 0 1
PROCEDURE OF GRAY-TO-BINARY CONVERSION
The MSB of the binary no. is the same as the MSB of Gray code no. ; record it.
Add the MSB of the binary to the next significant bit of the gray code, record the sum & ignore the carry.
Add the 2nd bit of binary to the 3rd bit of gray, 3rd bit of the binary to 4th bit of gray & so on.
Continue till all gray bits are exhausted. The sequence of bits that has been written down is the binary equivalent of the gray code no.
FOR EXAMPLE:Convert gray code 1101 to binary.
Gray : 1 1 0 1 |/ |/ | / | Binary: 1 0 0 1
EXCESS-3 CODE
The excess-3 code, also called XS-3, is a non weighted BCD code.
This code derives its name from the fact that each binary code word is the corresponding 8421 code word plus 0011 (3).
IT is a sequential code &, therefore, can be used for arithmetic operations.
FOR EXAMPLE:Write 26 in XS-3 code
8421 code of 26 = 11010
To obtain Xs-3 code, add 0011(3) to it.
11010 + 0011 = 11101 , which is 8421 code of 29.
Answer is verified as 26 + 3 = 29
THANK YOU