11 CS Data Representation
11 CS Data Representation
REPRESENTATION
INTRODUCTION
– As we know that computer system stores any data in binary form thats
why we use to add the word DIGITAL with all the work related to computer.
The data stored in computer is knows as Digital Data.
– In this chapter we will see various techeniques to represent data in a
computer system.
– Human beings have adopted Decimal Number System in their day to day
life. In the same manner, computer system has adopted Binary Number
System, Octal Number System and Hexadecimal Number System which
are combinely known as Digital Number System.
– These Number Systems are -
DECIMAL NUMBER
Decimal SYSTEM
number system
– Decimal system is consists of 10 digits which are as under
• 0,1,2,3,4,5,6,7,8,9
– Base of this system is 10 and it is to be shown as-
• (1249)10
– This techenique is based on positional value where the weightage of a
digit is as per its position. For ex- in number 526, the value of 5 is 500,
value of 2 is 20 and value of 6 is 6. (it is as per the method of hundreds ,
tens and ones).
We can write above given example as-
– 526 = 5 X 102 + 2 X 101 + 6 X 100
– 25.32 = 2 X 101 + 5 X 100 + 3 X 10-1 + 2 X 10-2
– The left most digit is called MSD (Most Significant Digit ).
– The right most digit is called LSD (Least Significant Digit ).
BINARY
BinaryNUMBER SYSTEM
Number System
– Binary system consists of 2 digits 0,1 known as bit.
– Base of this system is 2 and it is to be shown as
(1001010101)2
– In Digital systems, use of decimal system is immpossible
therefore use of binary system for a computer system is
meaningful. Use of circuit to maintain two voltage level is very
easy.
– See the examples of binary number method-
– 1010 = 1 X 23 + 0 X 22 + 1 X 21 + 0 X 20
– 10.11 = 1 X 21 + 0 X 20 + 1 X 2-1 + 1 X 2-2
– The left most digit is called MSB (Most Significant Bit ).
– The right most digit is called LSB (Least Significant Bit ).
OCTAL
OctalNUMBER SYSTEM
Number System
– Octal system consists of 8 digits which are as
under-
• 0,1,2,3,4,5,6,7
– 147 = 1 X 82 + 4 X 81 + 7 X 80
(239)10 =
(354)8
Octal to TO
DECIMAL Decimal
OCTAL
• For this, every digit of octal is multiplied by 8 after applying
power as per its position.
• The resultant expression is then to be solved mathematically.
• For ex- to convert 345 octal to decimal -
• Another example -
24.68 = 2 X 81 + 4 X 80 + 6 X 8-1 = 20.7510
DECIMAL
DecimalTO
to HEXADECIMAL
Hexadecimal
• For this, decimal value is to be divided by 16 and remainder is to be
arrange in order. Quotient is again to be divide by 16 and remainder is
to be again kept in order. This process is to be repeated until quotient
become zero. Remainder is then to keep in reverse order which results
in hexadecimal of the given number. (remainder should come in
between 0 to 15 only). A is to be written for 10, B for 11.......... F for 15.
HEXADECIMAL TO DECIMAL
Hex to Decimal
• For this, every digit of Hex is multiplied by 16 after applying
power as per its position.
• The resultant expression is then to be solved
mathematically. For ex-
Octal Binary
0 000 (235)8 = (010011101)2
1 001
Every digit of octal is to be replaced
2 010 by its relevant binary value.
3 011
4 100 (101110100)2= (564)8
5 101
First, combine three-three digits from
6 110 right and then write their concerned
7 111 octal value from table.
Hex Binary Hex binary
0 0000
• For this, first convert the hex to decimal and
1 0001 then the received decimal to binary.
2 0010 • Another method is with the help of Hex Table-
3 0011
4 0100
5 0101
(2A5)16 = (001010100101)2
6 0110 Just write binary of each hex digit at its place.
7 0111
8 1000 (000101110100)2= (174)16
9 1001
First, combine four-four digits from right
A 1010
and then write their concerned hex
B 1011 value from table.
C 1100
D 1101
E 1110
F 1111
Octal Hex Hex Binary
0 0000
• For this, you can write binary from octal
1 0001
table and then convert it to hex.
2 0010
Reverse the process to convert from
3 0011
hex to octal.
4 0100
• Another method with table-
5 0101
6 0110
Octal Binary
(347)8 = ( )16 7 0111
0 000
First convert to binary- 8 1000
1 001 (347)8 = (011100111)2 9 1001
2 010 Now, prepare four digits
A 1010
3 011 group from right and write
B 1011
4 100 their Hex- (011100111)2
= (E7)16 C 1100
5 101
D 1101
6 110
E 1110
7 111
F 1111
Binary – Unsigned Integers
• An unsigned integer can be any positive value or 0
(Zero).
0+0= 0
0+1= 1
1+0= 1
Characters can
be identified by
this
ISCII
• Indian Standard Code Code
for Information Interchange is developed
in India.
• It identifies signals and charaters of almost all indian languages
• It identifies ASCII script along with subscripts of various indian
languages.
• It also works in the 8 bit group.
Unicode
• This is Universal Character Set which represents a signal or a
character in a group of 32 bit.
• It has the capability to include signals and characters from all
scripts of all languages of world.
• Before the development of Unicode, various encoding
system were in use.
• Problems related to language on internet has been resolved by
the use of Unicode.
Unicode uses various encoding systems to
represent characters. Like-
1. UTF – 8 (Unicode Transformation Format)
–8
a) UTF – 8 – 1 Octet (8 bits) Representation
b) UTF – 8 – 2 Octet (16 bits) Representation
c) UTF – 8 – 3 Octet (24 bits) Representation
d) UTF – 8 – 4 Octet (32 bits) Representation
2. UTF – 32