Download Decimal to binary conversion for fractional numbers

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Large numbers wikipedia , lookup

Infinitesimal wikipedia , lookup

Approximations of π wikipedia , lookup

History of logarithms wikipedia , lookup

Vincent's theorem wikipedia , lookup

Strähle construction wikipedia , lookup

Location arithmetic wikipedia , lookup

Factorization wikipedia , lookup

Collatz conjecture wikipedia , lookup

Arithmetic wikipedia , lookup

Addition wikipedia , lookup

Rounding wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Positional notation wikipedia , lookup

Elementary mathematics wikipedia , lookup

Transcript
There is a simple method to find the equivalent binary
representation of a decimal fractional number.
Let us look at an example 0.5937510  ?2

Multiply 0.59375 by 2, and the result is 1.1875.
The integer part is 1, and the fractional part is
0.1875.

Now take the fractional part 0.1875, multiply it by 2
and the result is 0.375. The integer part is 0, and
the fractional part is 0.375.

Continue the above procedure until the fractional
part is 0. (In most cases, the fractional part will
never become zero; hence the number can be
represented only approximately – what results out
of the approximation is called round-off error).
The values of the integer and fractional parts are listed in
the table below.
Result
Integer
Part
Fractional
part
0.59375*2 1.1875
1
0.1875
0.1875*2
0.375
0
0.375
0.375*2
0.75
0
0.75
0.75*2
1.5
1
0.5
0.5
1.0
1
0
The binary representation therefore is the collection of the
integer parts starting from the first one.
0.5937510  0.100112
If this approach is used to introduce the decimal to binary
conversion of fractional numbers in the classroom, the
students may blindly learn the method but not necessarily
the reason behind it. A better way to show the method
through example (other than symbolically) is as follows.
Ask what is the smallest positive integer m for which 2-m
can be subtracted from 0.59735 to leave a positive
remainder. Well it is m=1, so that
0.59375  21  0.09375
Now take the remaining fractional part, which is 0.09375 in
this case and ask the same question. What is the smallest
positive integer m, such that 2-m can be subtracted from
0.09375 to leave a positive remainder? Well it is m=4, so
that
0.09375  24  0.03125
and hence
0.59375  2 1  2 4  0.03125
Now take the remaining fractional part, which is 0.03125
now and ask the same question. What is the smallest
integer m>0, such that 2-m can be subtracted from 0.03125
to leave a positive remainder? Well it is m=5, so that
0.03125  25  0
and hence
0.59375  21  24  25
There is no more remaining fractional part left now.
Rewriting 0.59375 in terms of all negative powers of 2
starting from the highest power, we get
0.59735  21  24  25
 1  21  1  24  1 25
 1  21  0  22  0  23  1 24  1  25
The binary representation therefore is the collection of the
coefficients of the powers of 2, that is,
0.5973510  0.100112