I know that if we multiply the fraction by 2 repetitively and take out the integer part every time, we will get the binary form. But why does this method work? Why should we multiply by 2 for the fractional part(since the general procedure to convert decimal to binary is to divide by two)?
- $\begingroup$ What do you mean by "the general procedure to convert decimal to binary is to divide by two"? $\endgroup$joriki– joriki2015-08-06 07:06:57 +00:00Commented Aug 6, 2015 at 7:06
- $\begingroup$ @joriki I meant the Long division method. $\endgroup$kakkarot– kakkarot2015-08-06 07:09:18 +00:00Commented Aug 6, 2015 at 7:09
- 1$\begingroup$ We are trying to express the fraction in terms of $\frac{1}{2}$, $\frac{1}{2^2}$, $\frac{1}{2^3}$ and so on. That is why, in order to obtain the '0' or '1' multiplier, we successively multiply by 2 $\endgroup$Shailesh– Shailesh2015-08-06 08:12:52 +00:00Commented Aug 6, 2015 at 8:12
- $\begingroup$ Can you please explain your answer? $\endgroup$kakkarot– kakkarot2015-08-06 09:35:57 +00:00Commented Aug 6, 2015 at 9:35
- $\begingroup$ OK, here is a similar question and an answer. If this is not OK, I will try to explain in a more intuitive way. $\endgroup$Shailesh– Shailesh2015-08-06 09:41:21 +00:00Commented Aug 6, 2015 at 9:41
1 Answer
Let the decimal be $0.d_1d_2d_3...$. When we are trying to express it in binary, we want to express it as $\frac{a_1}{2} + \frac{a_2}{2^2} + \frac{a_3}{2^3} + ...$ Now, if the original fraction is more than $\frac{1}{2}$, we want $a_1 = 1$, otherwise $a_1 = 0$. The best way to check that is to as to multiply LHS by $2$. If you get an integer part 1, put $a_1 = 1$, otherwise $a_1 = 0$. We have taken care of the first digit. The same process is continued. You can either drop the integers on the LHS multiplications, or keep them and put a '1' when they switch to odd. Hope this helps as an intuitive answer.