0% found this document useful (0 votes)
26 views24 pages

CHAPTER-2 DataRepresentation

Data Representation
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views24 pages

CHAPTER-2 DataRepresentation

Data Representation
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

DATA REPRESENTATION

Data representation is the method used


internally to represent data in a computer.
A number system has a unique base, which
depends upon the number of symbols.
 The number of symbols used in a number
system is called base or radix of a number
system.
 The weight of a digit depends on its relative
position. Such a number system is known as
positional number system.
 All positional number systems have a base
and the place value of a digit is some power
of this base.
 The decimal number system involves ten
symbols 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9 to form
a number.
 Since there are ten symbols in this number
system, its base is 10.
 Therefore, the decimal number system is
also known as base-10 number system.
 It is a positional number system.
 In Binary Number system there are only two
digits i.e. 0 or 1.
 It is base-2 system.
 It is a positional number system, where each
binary digit has its own value expressed as
power of 2.
 It has eight unique symbols i.e. 0 to 7.
 It has base of 8.
 It is a positional value system in which each
octal digit has its own value or weight
expressed as the power of 8.
 The hexadecimal system uses base 16.
 It has 16 possible digit symbols. It uses the
digits 0 through 9 plus the letters A,B,C,D,E,F
as 16 digit symbols.
 It is a positional value system in which each
hexadecimal digit has its own value or weight
expressed as a power of 16.
Decimal Binary Octal Hexadecimal

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.

 UTF-8 (Unicode Transformation Format 8) is a


a variable length encoding scheme in which
each character is represented by one to four
bytes.
 UTF-16 is a character encoding capable of
encoding all 1,112,064 valid character code
points of Unicode. The encoding is variable-
length, as code points are encoded with one
or two 16-bit code units
 UTF-32 (32-bit Unicode Transformation
Format) is a fixed-length encoding used to
encode Unicode code points that uses exactly
32 bits (four bytes) per character.

You might also like