How to round binary fractions correctly

9.8k Views Asked by At

We have three fractions which are converted to binary fractions

$$x= \frac{3}{5} ,\ y=\frac{4}{7} ,\ z=\frac{1}{35} $$

$$x_{binary}=0.\overline{1001}$$ $$y_{binary}=0.\overline{100}$$ $$z_{binary}=0.\overline{000001110101}$$

The binary fractions have to be rounded at the 5th bit. The 5th bit from $x_{binary}$ is 1. Do we get $0.\overline{1011}$ as the result? The 5th bit from $y_{binary}$ is also 1. Do we get $0.\overline{101}$ as the result? What about $z_{binary}$ the 5th bit is a 0, so will the number remain the same as before? Rounding in the binary system is quite confusing to me.

1

There are 1 best solutions below

0
On

Rounding is exactly the same as in decimal. If you want the conventional rounding (rounding from halfway up) in binary, it's actually even easier: if the next digit is 0, just cut off, if next digit is 1, increment the last bit (and carry if necessary). But you have to drop the repetition! Once you round, you get a finite binary expansion:

To 5 places (no carry, next bit is 0) $$x_\text{binary}=0.1001100110011001...\approx 0.10011$$ To 4 places (carry one, flips the 4th place up, as it was already 1, carries to 3rd place) $$x_\text{binary}=0.1001100110011001...\approx 0.1010$$