CHAPTER-2 DataRepresentation
CHAPTER-2 DataRepresentation
0 0000 0 0
1 0001 1 1
2 0010 2 2
3 0011 3 3
4 0100 4 4
5 0101 5 5
6 0110 6 6
7 0111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
Repeatedly divide the given decimal by 2.
Record the remainders.
Assemble all the remainders from bottom to
up.
Example: Convert (45)10 to binary.
2 45
2 22 - 1
2 11 - 0
2 5 - 1
2 2 - 1 (101101)2
2 1 - 0
0 - 1
Sum up the weights(powers of 2) of the
positions in the binary number.
Example: Convert (11001)2 to decimal.
1x24+1x23+0x22+0x21+1x20
= 16+8+0+0+1
= (25)10
Repeatedly divide the given decimal by 8.
Record the remainders.
Assemble all the remainders from bottom to
up.
Example: Convert (266)10 to octal.
8 266
8 33 - 2
8 4- 1
0- 4 (412)8
Sum up the weights(powers of 8) of the
positions in the binary number.
Example: Convert (372)8 to decimal.
3x82+7x81+2x80
= 3x64+7x8+2x1
= (250)10
Repeatedly divide the given decimal by 16.
Record the remainders.
Assemble all the remainders from bottom to
up.
Example: Convert (423)10 to hexadecimal.
16 423
16 26 - 7
16 1- A
0- 1 (1A7)16
Sum up the weights(powers of 16) of the
positions in the binary number.
Example: Convert (2AF)16 to decimal.
2x162+10x161+15x160
= 512+160+15
= (687)10
Convert each octal digit to its 3-bit binary
equivalent.
Example: Convert (5431)8 to binary
5 4 3 1
101 100 011 001
= (101100011001)2
The bits of the binary integer are grouped
into groups of three bits starting at the
LSB(Least Significant Bit).
Then each group is converted to its octal
equivalent.
Example: Convert (100111010)2 to octal.
100 111 010
4 7 2
=(472)8
Convert each hexadecimal digit to its 4-bit
binary equivalent.
Example: Convert (9F2)16 to binary
9 F 2
1001 1111 0010
= (100111110010)2
The bits of the binary integer are grouped
into groups of four bits starting at the LSB.
Then each group is converted to its
hexadecimal equivalent.
Example: Convert (100111010001)2 to hexadecimal.
1001 1101 0001
9 D 1
=(9D1)16
0 +0= 0
0 +1= 1
1 +0= 1
1 +1= 10
1 +1+ 1 = 11
(i) ASCII(American Standard Code for
Information Interchange)
It is a 7-bit alpha numeric code which
represents characters using numbers.
Each character is assigned a number from 0
to 127.
Another version is ASCII-8, also called
extended ASCII, which uses 8 bits for each
character, can represent 256 different
characters.
(ii) ISCII
It stands for Indian Standard Code for
Information Interchange.
It is capable of encoding 256 characters.
ISCII retains all ASCII characters and offer
coding for Indian scripts also.
(iii)Unicode
It is a superset of all other character sets.
Unicode defines multiple encoding systems
to represent characters. These are UTF-8,
UTF-16 and UTF-32.