Data Representation - Notes
Data Representation - Notes
Computer Science
Data Representation
Notes
A Binary number system has only two digits that are 0 and 1. Every number
(value) represents with 0 and 1 in this number system. The base of binary
number system is 2, because it has only two digits.
Octal number system has only eight (8) digits from 0 to 7. Every number
(value) represents with 0,1,2,3,4,5,6 and 7 in this number system. The base of
octal number system is 8, because it has only 8 digits.
NUMBER CONVERSIONS :
A) Divide the Number (Decimal Number) by the base of target base system (in
which you want to convert the number: Binary (2), octal (8) and Hexadecimal
(16)).
B) Write the remainder from step 1 as a Least Signification Bit (LSB) to Step
last as a Most Significant Bit (MSB).
Decimal Number is Binary Number is
: (12345)10 (11000000111001)2
a. (149)10
2 149 1
2 74 0
2 37 1
2 18 0
2 9 1
2 4 0
2 2 0
2 1 1
0
b.
Here, (804)10
8 804 4
8 100 4
8 12 4
8 1 1
0
c.
Here, (1600)10
16 1600 0
16 100 4
16 6 6
0
e.
Here, (2040)8 = 83 x 2 + 82 x 0 + 81 x 4 + 80 x 0
= 1024 + 32
= (1056)10
f.
Here, (1E0D)16 = 163 x 1 + 162 x E + 161 x 0 + 160 x D
= 4096 + 256 x 14 + 0 + 1 x 13
= 4096 + 3584 + 13
= (7693)10
g.
Here, (110111101)2
110 111 101
6 7 5
h.
Here, (1001110111)2
0010 0111 0111
2 7 7
i.
Here, (375)8
3 7 5
011 111 101
k.
Here, (555)8
5 5 5
101 101 101
= (101101101)2
0001 0110 1101
1 6 D
l.
Here, (BCA)16
B C A
1011 1100 1010
= (101111001010)16
101 111 001 010
5 7 1 2
b.
Here, (234.997)10
8 234 2
8 29 5
8 3 3
0
Also
0.997 x 8 = 7.976 7
0.976 x 8 = 7.808 7
0.808 x 8 = 6.464 6
0.464 x 8 = 3.712 3
0.712 x 8 = 5.696 5
0.696 x 8 = 5.568 5
c.
Here, (689.336)10
16 689 1
16 43 11 =
B
16 2 2
0
Also
0.336 x 16 = 5.376 5
0.376 x 16 = 6.016 6
0.016 x 16 = 0.256 0
0.256 x 16 = 4.096 4
0.096 x 16 = 1.536 1
0.536 x 16 = 8.576 8
d.
Here, (101.1101)2 = 22 x 1 + 21 x 0 + 20 x 1 + 2-1 x 1 + 2-2 x 1 + 2-3 x 0 + 2-4 x 1
= 4 + 0 + 1 + 0.5 + 0.25 + 0 + 0.0625
= (5.8125)10
e.
Here, (0.1042)8 = 8-1 x 1 + 8-2 x 0 + 8-3 x 4 + 8-4 x 2
= 0.125 + 0 + 0.0078125 + 0.00048828125
= (0.1333)10
f.
Here, (FA.AEF)16 = 161 x 15 + 160 x 10 + 16-1 x 10 + 16-2 x 14 + 16-3 x 15
= 240 + 10 + 0.625 + 0.0546875 + 0.00366211
= 250.68335
g.
Here, (101010.110111)2
101 010 110 111
5 2 6 7
h.
Here, (10101.11011)2
0001 0101 1101 1000
1 5 D 8
i.
Here, (77.226)8
7 7 2 2 6
111 111 010 010 110
Therefore, (77.226)8 = (111111.010010110)2
j.
Here, (0.376)8
3 7 6
011 111 110
= (011111110)2
0111 1111
7 F
k.
Here, (0.5AB)16
5 A B
0101 1010 1011
l.
Here, (0.226)16
2 2 6
0010 0010 0110
= (0.001000100110)2
001 000 100 110
1 0 4 6
0 0 0
0 1 1
1 0 1
1 1 0; Carry →1
Let us take an example of two binary numbers and add them.
For example: Add 11012 and 10012.
Solution:
EXAMPLE :
a.
Here, 11111 + 10001
11111
+ 10001
110000
b.
Here, 1111 + 1111
1111
+ 1111
11110
CHARACTER/STRING REPRESENTATION:
ASCII:
Stands for "American Standard Code for Information Interchange." ASCII is
a character encoding that uses numeric codes to represent characters. These
include upper and lowercase English letters, numbers, and punctuation symbols.
ISCII:
Indian Script Code for Information Interchange (ISCII) is a coding scheme for
representing various writing systems of India. It encodes the main Indic scripts
and a Roman transliteration. The supported scripts are: Assamese, Bengali
(Bangla), Devanagari, Gujarati, Gurmukhi, Kannada, Malayalam, Oriya, Tamil,
and Telugu.
UNICODE:
Unicode is a character encoding standard that has widespread acceptance. ...
They store letters and other characters by assigning a number for each one.
Before Unicode was invented, there were hundreds of different encoding
systems for assigning these numbers. No single encoding could contain
enough characters.