Sie sind auf Seite 1von 1

it has a lot of information on converting both integers and fractions

to other bases. But I didn't see an example of converting a fraction


FROM binary back TO decimal, so here are the methods and an example.

The place values to the right of the radix point (what we call the
equivalent of the "decimal point" when working in other bases) are
simply negative powers of two:

[.] 2^(-1) 2^(-2) 2^(3) 2^(-4) ...

When a base is raised to a negative power, it just means the


reciprocal of the base raised to that (positive) power. For example,
2^(-1) = 1/(2^1) = 1/2, and 2^(-2) = 1/(2^2) = 4, etc. So the place
values can also be expressed as:

[.] 1/2 1/4 1/8 1/16 ...

Of course, we can also express these fractions in decimal form as:

[.] .5 .25 .125 .0625 ...

So the binary fraction 0.1101 represents:

1/2 1/4 1/8 1/16


--- --- --- ----
. 1 1 0 1

Just as with integers, we multiply each digit by its place value and
add the results. For my example, we'd get:

1 * 1/2 = 1/2 = 8/16 1 * .5 = .5


+ 0 * 1/4 = 1/4 = 0/16 1 * .25 = .25
+ 1 * 1/8 = 0 = 2/16 or + 0 * .125 = .0
+ 1 * 1/16 = 1/16 = 1/16 1 * .0625 = .0625
----- -----
11/16 .8125

As an alternate method, you can simply move the radix point to the
right end of the number (as long as it's not a repeating fraction).
Count how many places you moved the radix point. Convert the resulting
integer to binary, and divide by 2^n, where n is the number of places
you moved the radix point.

In my example, we can convert .1101 to decimal by:

.1101

1. Shift the radix point to the right end 1101.

2. Count the number of places moved (4 places)

3. Convert the integer to decimal 1101_2 = 13_10

4. Divide the result by 2^n 13/(2^4) =


13/16 =
.8125

I hope this helps. If you have any more questions, write back.

Das könnte Ihnen auch gefallen