You are on page 1of 42

NUMBER

SYSTEMS
Conversion with Fractions
NUMBER SYSTEM
CONVERSION

FRACTIONAL NUMBERS
FRACTIONAL NUMBER CONVERSIONS

1) From Decimal to Other Number System

2) From Other Number System to Decimal

3) From Octal to Binary and Binary to Octal

4) From Hexadecimal to Binary and Binary to


Hexadecimal

5) From Octal to Hexadecimal and Hexadecimal to


Octal
FRACTIONAL CONVERSION

From
DECIMAL
to
ANY NUMBER SYSTEM
CONVERSION FROM DECIMAL FRACTION TO
BINARY FRACTION

Example : 0.62510 --- > Binary

For the fractional conversion, see steps below

1. Multiply the fraction by 2

.625 X 2 = 1.250

2. The integer and fraction portion of the


product are separated and the integer
portion is extracted, (1 from 1.250)
CONVERSION FROM DECIMAL TO BINARY

3. Only the fraction portion is multiplied again by 2.

0.250 X 2 = 0.500 (Extract again the integer


portion which is 0)

0.500 X 2 = 1.000 (Extract again the integer


portion which is 1)

The above operations are repeated until the fraction


becomes 0.

4. Read the integer portion from the top going down


Hence 0.62510 = 0.1012
Same procedure is used to convert from
decimal fraction to octal fraction and
hexadecimal fraction
except that instead of multiplying the
fraction part by 2, it will be multiplied by
8 (for octal) and 16 (for hexadecimal)

It should be noted that when decimal fractions


are converted, most of the times the conversion
is not finished. No matter how many times the
fraction portion is multiplied by the base, it
will not become 0.
CONVERSION FROM DECIMAL FRACTION TO
OCTAL FRACTION

Example : 0.52510 --- > Octal

0.525 X8 = 4.200 (Extract 4)


0.200 X8 = 1.600 (Extract 1)
0.600 X8 = 4.800 (Extract 4)
0.800 X8 = 6.400 (Extract 6)
0.400 X8 = 3.200 (Extract 3)
0.200 X8 = 1.600 (Extract 1)

Hence 0.52510 = 0.4146318


CONVERSION FROM DECIMAL FRACTION TO
HEXADECIMAL FRACTION

Example : 0.8510 --- > Hexadecimal

0.85 X 16 = 13.60 (Extract 13)


0.60 X 16 = 9.60 (Extract 9)
0.60 X 16 = 9.60 (Extract 9)
0.60 X 16 = 9.60 (Extract 9)
0.60 X 16 = 9.60 (Extract 9)
0.60 X 16 = 9.60 (Extract 9)

Hence 0.8510 = .D9999916


Exercise : 0.12510 --- > Binary, Octal,
Hexadecimal
Exercise :
0.12510 X 2 = 0.25 0
0.25 X 2 = 0.5 0
0.5 X 2 = 1.0 1

0.001 (base 2)

0.12510 X 8 = 1.0 1

0.100 (base 8)

0.12510 X 16 = 2.0 2

0.200 (base 16)


Exercise : 0.3310 --- > Binary, Octal,
Hexadecimal
Exercise :
0.3310 X 2 = 0.66 0
0.66 X 2 = 1.32 1
0.32 X 2 = 0.64 0
0.64 X 2 = 1.28 1
0.28 X 2 = 0.56 0
0.56 X 2 = 1.12 1

0.010101 (base 2)
Exercise :
0.3310 X 8 = 2.64 2
0.64 X 8 = 5.12 5
0.12 X 8 = 0.96 0
0.96 X 8 = 7.68 7
0.68 X 8 = 5.44 5
0.44 X 8 = 3.52 3

0.250753 (base 8)
Exercise :
0.3310 X 16 = 5.28 5
0.28 X 16 = 4.48 4
0.48 X 16 = 7.68 7
0.68 X 16 = 10.88 A
0.88 X 16 = 14.08 E
0.08 X 16 = 1.28 1

0.547AE1 (base 16)


Exercise : 50.37510 --- > Binary, Octal,
Hexadecimal
Exercise :
0.37510 X 2 = 0.75 0
0.75 X 2 = 1.5 1
0.5 X 2 = 1.0 1

50.375 = 110010.011
Exercise :
0.37510 X 8 = 3.0 3

50.375 = 62.3 (base 8)

Exercise :
0.37510 X 16 = 6.0 6

50.375 = 32.6 (base 16)


CONVERSION

From
FRACTION of ANY NUMBER SYSTEM
to
DECIMAL FRACTION
CONVERSION FROM ANY NUMBER SYSTEM
FRACTION TO DECIMAL FRACTION

Take note of the positional weight of the digits in the


number systems

Binary number 1 0. 1 1 0 12
Exponents → 1 0 -1 -2 -3 -4

Octal number 1.4 2 68


Exponents → 0 -1 -2 -3

Hexadecimal number 5. 1 5 C16


Exponents → 0 -1 -2 -3

Multiply each digit to be converted with its positional


weight depending on the base of the number system
CONVERSION FROM BINARY SYSTEM TO DECIMAL
(with fraction)

Example Binary number 1 0. 1 1 0 1 2

Multiply each bit with its positional weight depending on the


base (radix) of the number system

= 1 X 21 + 0 X 20 + 1 X 2-1 + 1 X 2-2 + 0 X 2-3 + 1 X 2-4

= 1 X 2 + 0 X 1 + 1 X .5 + 1 X .25 + 0 X .125 + 1 X .0625


= 2 + 0 + .5 + .25 + 0 + .0625
= 2.8125

Hence 1 0. 1 1 0 1 2 = 2.812510
CONVERSION FROM OCTAL SYSTEM TO
DECIMAL (with fraction)

Example Octal number 62.358

Multiply each digit with its positional weight depending


on the base of the number system

= 6 X 81 + 2 X 80 + 3 X 8-1 + 5 X 8-2

= 6 X 8 + 2 X 1 + 3 X .125 + 5 X .015625
= 48 + 2 + .375 + .078125
= 50.453125

Hence 62.358 = 50.45312510


CONVERSION FROM HEXADECIMAL SYSTEM TO
DECIMAL (with fraction)

Example Hexadecimal number 42A.1216

Multiply each digit with its positional weight depending on the


base of the number system

= 4 X 162 + 2 X 161 + 10 X 160 + 1 X 16-1 + 2 X 16-2

= 4 X 256 + 2 X 16 + 10 X 1 + 1 X .0625 + 2 X .00390625


= 1024 + 32 + 10 + .0625 + .0078125
= 1066.0703125

Hence 42A.1216 = 1066.070312510


CONVERSION FROM BINARY SYSTEM TO DECIMAL
(with fraction)

Example Binary number 0.0 1 1 2

Multiply each bit with its positional weight depending on the


base (radix) of the number system

= 0 X 2-1 + 1 X 2-2 + 1 X 2-3

= 0 X .5 + 1 X .25 + 0 X .125

Hence 0. 0 1 1 2 = 0.37510
Exercise : 0.10112 --- > Decimal

0.0028 --- > Decimal

BE.A116 --- > Decimal


Exercise : 0.10112 --- >

.5 + .125 + 0.0625 = 0.6875 (Decimal)


Exercise : 0.0028 --- >

= 2 * .001953= 0.003906 (Decimal)


Exercise : BE.A116 --- > Decimal

= 10* 0.0625 + 1* 0.003906


= 0.625 + 0.003906
= 0.628906

=190.628906
CONVERSION

From
BINARY FRACTION
to
OCTAL FRACTION
And vice versa
Conversion from Binary fractions to octal

- The steps are the same as with binary integer


conversion. Group the bits by 3, starting from
the bit right after the fractional point.

- Replace each group of 3 by its octal digit


equivalent
Binary Fraction to Octal

Example

0. 1 0 1 1 1 1 0 0 0 12 → Octal

0. 1 0 1 111 000 100

0. 5 7 0 4

Hence 0. 1 0 1 1 1 1 0 0 0 12 = 0.57048
Conversion from Octal fractions to Binary Fraction

- Replace each octal digit by its 3 bit equivalent

Octal to Binary Fraction

Example

0. 5678 → Binary

0. 5 6 7

0. 1 0 1 110 111

Hence 0.5678 =0. 101110111 2


CONVERSION

From
BINARY FRACTION
to
HEXADECIMAL FRACTION
And vice versa
Conversion from Binary fractions to hexadecimal

- The steps are the same as with binary integer


conversion. Group the bits by 4, starting from
the bit right after the fractional point.

- Replace each group of 4 by its hexadecimal digit


equivalent
Conversion from Binary fractions to hexadecimal

Example

0. 1 0 1 1 1 1 0 0 0 12 → Hexadecimal

0. 1 0 1 1 1100 0100

0. 11 12 4

0. B C 4

Hence 0. 1 0 1 1 1 1 0 0 0 12 = 0.BC416
Conversion from Hexadecimal fractions to Binary

- Replace each hexadecimal digit by its 4 bit


equivalent

Example:

0. 8E16 → Binary

0. 8 E

0. 1 0 0 0 1110

Hence 0.8E16 =0. 1 0 0 0 1 1 1 0 2


CONVERSION

From
OCTAL FRACTION
to
HEXADECIMAL FRACTION
And vice versa
Conversion of octal to hexadecimal fractions and
vice versa

- The fraction conversion from octal to hexadecimal


and vice versa are also the same as with integer
conversion from octal to hexadecimal and vice versa

- The 2 step process is


1.) Convert octal/hexadecimal to binary
2.) Convert binary to octal/hexadecimal equivalent
Octal Fraction to Hexadecimal

Example

0. 5468 → Hexadecimal

0. 5 4 6

0. 1 0 1 100 110

0. 1 0 1 1 0011 0

0. B 3 0

Hence 0.5468 =0. B316


Hexadecimal Fraction to Octal

Example

0. 8E16 → Octal

0. 8 E

0. 1 0 0 0 1110

0. 1 0 0 011 100

0. 4 3 4

Hence 0.8E16 =0. 4348


Exercises:
1.) 10F.BADE16 (binary)

2.) 747.238 (hexa)

3.) 1 001.010 12 (octal)

4.) 1 1110.1111 02 (hexa)

5.) 10.7510 (octal)


References:

Introduction to Computer Systems, 3rd Ed


Japan Information-Technology Engineers Examination Center
Information Technology Promotion Agency, Japan

Digital Principles and Logic Design


A. Saba & N. Manna

You might also like