Number System Conversions

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 24

DECIMAL TO BINARY

Example − Convert decimal number 112 into binary number.


Since given number is decimal integer number, so by using above
algorithm performing short division by 2 with remainder.
Division Remainder (R)
112 / 2 = 56 0
56 / 2 = 28 0
28 / 2 = 14 0
14 / 2 = 7 0
7/2=3 1
3/2=1 1
1/2=0 1

Now, write remainder from bottom to up (in reverse order), this will be
1110000 which is equivalent binary number of decimal integer 112.
DECIMAL TO OCTAL

Example − Convert decimal number 210 into octal number.


Since given number is decimal integer number, so by using above
algorithm performing short division by 8 with remainder.
Division Remainder (R)
210 / 8 = 26 2
26 / 8 = 3 2
3/8=0 3

Now, write remainder from bottom to up (in reverse order), this


will be 322 which is equivalent octal number of decimal integer
210.
DECIMAL TO HEXADECIMAL

Example − Convert decimal number 540 into hexadecimal number.


Since given number is decimal integer number, so by using above
algorithm performing short division by 16 with remainder.

Division Remainder (R)


540 / 16 = 33 12 = C
33 / 16 = 2 1
2 / 16 = 0 2
0 / 16 = 0 0

Now, write remainder from bottom to up (in reverse order), this will be
021C (or only 21C) which is equivalent hexadecimal number of decimal
integer 540.
DECIMAL FRACTION TO BINARY

Let's take an example for n = 4.47


Step 1: Conversion of 4 to binary
1. 4/2 : Remainder = 0 : Quotient = 2
2. 2/2 : Remainder = 0 : Quotient = 1
3. 1/2 : Remainder = 1 : Quotient = 0
So equivalent binary of integral part of decimal is 100.
Step 2: Conversion of .47 to binary
1. 0.47 * 2 = 0.94, Integral part: 0
2. 0.94 * 2 = 1.88, Integral part: 1
3. 0.88 * 2 = 1.76, Integral part: 1
So equivalent binary of fractional part of decimal is .011
Step 3: Combined the result of step 1 and 2.
Final answer can be written as:
100 + .011 = 100.011
DECIMAL FRACTION TO OCTAL
Example 1: Convert (73.625)10 to ( ? )8
Solution: Firstly, we will separate the integral part (73)8 and the fractional part (0.625)8. Now, we
will convert each of them to octal individually.
Integral Part
Divisor Quotient Remainder
8 73
8 9 1 LSB
8 1 1
8 0 1 MSB
All the remainders read from top to bottom, where topmost is the LSB and bottom one is the MSB.
Therefore, (73)10 = (111)8
Fractional Part
0.625 * 8 = 5.000
The integer part of the product term read from top to bottom forms the equivalent octal number
i.e., (.625)10 = (0.5)8
After converting both integral part and fractional part individually into octal, now we combine
both to get our desired result i.e., (73.625)10 = (111.5)8
DECIMAL FRACTION TO HEXADECIMAL
Ex1: Convert (0.0628)10 decimal fraction to hexadecimal fraction (?)16 using successive
multiplication method
1st Multiplication Iteration
Multiply 0.0628 by 16
0.0628 x 16 = 1.0048(Product)         Fractional part=0.0048            Carry=1    (MSD)
2nd Multiplication Iteration
Multiply 0.0048 by 16
       0.0048 x 16 = 0.0768(Product)         Fractional part = 0.0768         Carry = 0   
3rd Multiplication Iteration
Multiply 0.0768 by 16
        0.0768 x 16 = 1.2288(Product)         Fractional part = 0.2288            Carry = 1   
 4th Multiplication Iteration
Multiply 0.2288 by 16
      0.2288 x 16 = 3.6608(Product)         Fractional part = 0.6608            Carry = 3  (LSD) 
 Hence, the fractional hexadecimal number of the given decimal fraction
 (0.0628)10 is (0.1013)16.
BINARY TO DECIMAL
BINARY TO OCTAL

Example − Convert binary number 10010110 into octal number.

Given binary number


= (10010110)2
Take three numbers from left as a group, convert it into octal number
= (226)8 which is answer.
BINARY TO HEXADECIMAL

Example − Convert binary number 1101010 into hexadecimal


number.

Given binary number


= (1101010)2
Take four numbers from left as a group, convert it into
hexadecimal number
=(6A)16 which is answer.
BINARY FRACTION TO DECIMAL
Let's take an example for n = 110.101
Step 1: Conversion of 110 to decimal
=> 110 = (1*2^2) + (1*2^1) + (0*2^0)
=> 110 = 4 + 2 + 0
=> 110 = 6
So equivalent decimal of binary integral is 6.
Step 2: Conversion of .101 to decimal
=> 0.101 = (1*1/2) + (0*1/2^2) + (1*1/2^3)
=> 0.101 = 1*0.5 + 0*0.25 + 1*0.125
=> 0.101 = 0.625
So equivalent decimal of binary fractional is 0.625
Step 3: Add result of step 1 and 2.
=> 6 + 0.625 = 6.625
BINARY FRACTION TO OCTAL

Let's take an example for n = 110.101

Step 1: Conversion of 110 to octal


=> 110 = 6
So equivalent octal of binary integral is 6.
Step 2: Conversion of .101 to octal
Þ 0.101=5 (consider three numbers as group from right)
Þ So equivalent decimal of binary fractional is 0.5

Step 3: Add result of step 1 and 2.


=> 6 + 0.5 = 6.5
BINARY FRACTION TO HEXADECIMAL

Let's take an example for n = 10110.10101

Step 1: Conversion of 10110 to hexadecimal


=> 10110 = 16
So equivalent hexadecimal of binary integral is 16.
Step 2: Conversion of .10101 to hexadecimal
(consider four numbers as group from right)
Þ 0.10101=A1
Þ So equivalent decimal of binary fractional is A1

Step 3: Add result of step 1 and 2.


=>16 + 0.A1 = 16.A1
OCTAL TO DECIMAL

The octal number is (377)8

3*8^2+7*8^1+7*8^0=192+56+7=255

(377)8 = (255)10
OCTAL TO BINARY

The octal number is (377)8

Replace each octal digit with its equivalent three digit binary
number.

011 111 111

(377)8 = (011111111)2
OCTAL TO HEXADECIMAL

The octal number is (377)8

Replace each octal digit with its equivalent three digit binary
number.

011 111 111

Group 4 binary digits from left

0 1111 1111

=0FF

(377)8 = (0FF)16
OCTALFRACTION TO DECIMAL

The octal number is (377.11)8

377

3*8^2+7*8^1+7*8^0=192+56+7=255

0.11= 1*1/8+1*1/8^2
=0.125+0.015625=0.140625

255+0.140625
(377.11)8 = (255.0140625)10
OCTALFRACTION TO BINARY

The octal number is (377.56)8

Replace each octal digit with its equivalent three digit binary
number.

011 111 111. 101 110

(377.56)8 = (011111111.101110)2
OCTALFRACTION TO HEXADECIMAL

The octal number is (377.56)8

Replace each octal digit with its equivalent three digit binary number.
number.

011 111 111. 101 110


Group 4 binary digits from left in mantissa and group 4 bits from
right after decimal point
(377.56)8 = (011111111.101110)2

0 1111 1111. 1011 10


=0FF. B9
(377.56)8 = (0FF.B9)16
HEXADECIMAL TO DECIMAL

The hexadecimal number is (377A)16

3*16^3+7*16^2+7*16^1+A*16^0
=3*4096+7*256+7*16+10*1
= 12288+1792+112+10
= 14202

(377A)16=(14202)10
HEXADECIMAL TO BINARY

The hexadecimal number is (377A)16

Replace each hexadecimal digit with four binary digits

0011 0111 0111 1010

(377A)16 = (0011011101111010)2
HEXADECIMAL TO OCTAL

The hexadecimal number is (377A)16

Replace each hexadecimal digit with four binary digits

0011 0111 0111 1010

(377A)16 = (033572)8
HEXADECIMAL FRACTION TO DECIMAL

The hexedecimal number is (377A.12)16

3*16^3+7*16^2+7*16^1+A*16^0
=3*4096+7*256+7*16+10*1
= 12288+1792+112+10
= 14202

0.12= 1*1/16+2*1/16^2
=0.0625+0.00390625
=0.06640625

14202 +0.06640625= 14202.06640625

(377A.12)16 = (14202.06640625)10
HEXADECIMAL FRACTION TO BINARY

The hexadecimal number is (377A.12)16

Replace each hexadecimal digit with four binary digits

0011 0111 0111 1010 . 0001 0010

(377A.12)16 = (0011011101111010 . 00010010)2


HEXADECIMAL FRACTION TO OCTAL

The hexadecimal number is (377A.12)16

Replace each hexadecimal digit with four binary digits

0011 0111 0111 1010 . 0001 0010

Group 3 bits from left in mantissa and 3 bits from right in decimal part

0 011 011 101 111 010 . 000 100 10

(377A.12)16 = (033572.044)8

You might also like