0

Convert to binary : 46.5 * 10^(-24) Or something like 46.5 * 10^(24)

I have to find the binary equivalents here, for the purpose of representation in IEEE 754 floating point representation. But I cannot convert the powers of 10 to binary! Please help me!

1 Answers1

1

The method for converting a decimal number less than $1$ to binary uses repeated multiplication by $2$. $$2(0.00465)=0.0093$$ $$2(0.0093)=0.0186$$ $$2(0.0186)=0.0372$$ $$2(0.0372)=0.0744$$ $$2(0.0744)=0.1488$$ $$2(0.1488)=0.2976$$ $$2(0.2976)=0.5952$$ $$2(0.5952)=1.1904$$ $$2(0.1904)=0.3808$$ $$2(0.3808)=0.7616$$ $$2(0.7616)=1.5232$$ $$2(0.5232)=1.0464$$ continuing this process of doubling the fractional part of the result gives the infinite binary expansion of the number in the units column. That is to say $$(0.00465)_{10}\approx(0.000000010011)_2$$

Peter Foreman
  • 19,947
  • What if the exponent is very small, like 10 to the power of -24? In that case we can't do this right.. – Arjun Ashok Apr 27 '19 at 16:40
  • You can - it just requires more multiplications to be made. I'm quite sure this is the easiest way to convert such a decimal number into binary as there is no quick way to convert $10^{-n}$ to binary. The binary expansion of $10^{-n}$ is infinitely long (although periodic). For example $(10^{-1})_{10}=(0.0\overline{0011})_2$ – Peter Foreman Apr 27 '19 at 16:41