Converting Decimal Fractions to Binary Fractions
There is a simple, stepbystep method for computing the binary expansion on the righthand side of the point. We will illustrate the method by converting the decimal value .625 to a binary representation..
 Step 1: Begin with the decimal fraction and multiply by 2. The whole number part of the result is the first binary digit to the right of the point.
 Because .625 x 2 = 1.25, the first binary digit to the right of the point is a 1.
 So far, we have .625 = .1??? . . . (base 2) .
 Step 2: Next we disregard the whole number part of the previous result (the 1 in this case) and multiply by 2 once again. The whole number part of this new result is the second binary digit to the right of the point. We will continue this process until we get a zero as our decimal part or until we recognize an infinite repeating pattern.
 Because .25 x 2 = 0.50, the second binary digit to the right of the point is a 0.
 So far, we have .625 = .10?? . . . (base 2) .
 Step 3: Disregarding the whole number part of the previous result (this result was .50 so there actually is no whole number part to disregard in this case), we multiply by 2 once again. The whole number part of the result is now the next binary digit to the right of the point.
 Because .50 x 2 = 1.00, the third binary digit to the right of the point is a 1.
 So now we have .625 = .101?? . . . (base 2) .
 Step 4: In fact, we do not need a Step 4. We are finished in Step 3, because we had 0 as the fractional part of our result there.
 Hence the representation of .625 = .101 (base 2) .
Converting Binary Fractions to Decimal Fractions
Xn means 1/Xn. So, 22 = 1/4 and 23 = 1/8.
To convert an expression in base two notation to base ten notation, just do the arithmetic. Here is 100.101 converted from binary representation to decimal representation:
You should doublecheck our result by expanding the binary representation.
1

0

0

.

1

0

1

1×2^{2}

0×2^{1}

0×2^{0}

.

1×2^{1}

0×2^{2}

1×2^{3}

1×4 +

0×2 +

0×1+

.

1×0.5 +

0×0.25 +

1×0.125

4 +

0 +

0 +

.

0.5 +

0 +

0.125

4

.

625

References
http://programmedlessons.org/AssemblyTutorial/Chapter29/ass29_5.html
http://cs.furman.edu/digitaldomain/more/ch6/dec_frac_to_bin.htm
No comments:
Post a Comment