You are on page 1of 4

REPRESENTATION OF DATA (NUMBER SYSTEM)

Computers can accept numbers (0-9), alphabets and some special


characters. While processing, data has to flow from one part of computer to
another. Since, the computer is an electronic device and works with electronic
pulses, the information should be in machine readable form (in the form of
electronic pulses).

We can work with decimal number system. This number system uses 10
distinct digits(0-9). One can represent any possible number with the help of
these digits. If the computer has to work with decimal number system it
requires 10 different types of electronic pulses. This will make computer
operations very complicated. To make things simple, binary number system is
used in computers. It deals with two digits only 0 and 1. Any number of
decimal number system can be represented with the help of these two digits.

If the computer starts using binary system, only two distinct pulses would be
required to represent any numbers internally.

Two pulses that are used to represent basic numbers (0 and 1) are:
Absence of pulse (current) - 0
Presence of pulse (current) - 1

Table 1: Numbers with different bases


DECIMAL
(base 10)
(10
0
10
n
)
BINARY
(base 2)
(2
0
2
n
)
OCTAL
(base 8)
(8
0
8
n
)
HEXADECIMAL
(base 16)
(16
0
16
n
)
00 0000 00 0
01 0001 01 1
02 0010 02 2
03 0011 03 3
04 0100 04 4
05 0101 05 5
06 0110 06 6
07 0111 07 7
08 1000 10 8
09 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
16 10000 20 10
17 10001 21 11
18 10010 22 12


Decimal to Binary Conversion

To convert a decimal digit into its binary equivalent, following steps are
performed:

1. Divide the decimal number by 2 (base of binary number)
2. Note the remainder separately as the right most digit of binary
equivalent
3. Divide the quotient again by 2
4. Note the remainder as next left digit of binary number
5. Repeat the step 3 and 4 until quotient becomes 0

For example, the binary equivalent of 23 is:

QUOTIENT

2 23 REMAINDER (bottoms up)

2 11 1

2 5 1

2 2 1

2 1 0

0 1


Therefore, binary value of 23 will be 10111.

BINARY TO DECIMAL CONVERSION

To convert binary into decimal:
1) Multiply each digit of binary number by 2 having power(0,1,2 n)
2) Sum all the products to get the decimal equivalent

Decimal equivalent of binary number 10111 is 23 as follows:

4 3 2 1 0 Power of 2 (2
4
, 2
3
, 2
2
, 2
1
, 2
0
)



1 0 1 1 1

10111 =1*2
4
+0*2
3
+1*2
2
+1*2
1
+1*2
0

=16 +0 +4 +2 +1
=23


Decimal equivalent of binary .101 is .625
.101 =1*2
-1
+0*2
-2
+1*2
-3

=.5 +0
-1
+.125
=.625


OCTAL NUMBER SYSTEM

DECIMAL TO OCTAL CONVERSION
The same procedure as decimal to binary conversion, only decimal number is
divided by 8 (as base is 8).

Octal equivalent of decimal number 15 is 17 as follows: (15)
10
=(17)
8
QUOTIENT

8 15 REMAINDER (bottoms up)

8 1 7

0 1


Therefore, octal value of binary 15 will be 17.

OCTAL TO DECIMAL CONVERSION
Similarly decimal equivalent of octal number 17 will be 15 as follows:
(17)
8
=(15)
10

17 =1*8
1
+7*8
0

=1*8 +7*1
=8 +7
=15

OCTAL TO BINARY CONVERSION

To convert octal to binary, each octal digit is converted into 3-bit binary
equivalent (8 =2
3
3 bit).

(1476)
8
=(001 100 111 110)
2

1 4 7 6 Check the table










HEXADECIMAL NUMBER SYSTEM (0-9, A, B, C, D, E, F)

DECIMAL TO HEXADECIMAL CONVERSION


Same process as binary to decimal, only decimal number is divided by 16 (as
base is 16).

(1000)
10
=(3E8)
16

QUOTIENT

16 1000 REMAINDER (bottoms up)

16 62 8 8

16 3 14 E

0 3 3

Therefore, hexadecimal value of binary 1000 will be 3E8.


HEXADECIMAL TO DECIMAL CONVERSION

Same procedure as binary to decimal but number is expressed as sum of
powers of 16.

(B65F)
16
=(46687)
10

B65F =B*16
3
+6*16
2
+5*16
1
+F*16
0

=11*16
3
+6*16
2
+5*16
1
+15*16
0

=45056 +1536 +80 +15
=46687

Therefore, decimal value of hexadecimal B65F will be 46687.

You might also like