# Converting a decimal to IEEE754 32-bit binary number

Convert 0.625 to IEEE754 32-bit binary number.

0.625 x 2 = 1.250
0.250 x 2 = 0.500
0.500 x 2 = 1.000


So,

0.625 = 0.101
=> 0.625 = 1.01 x 2^(-1)


So,

S = 0
E = -1+127 = 126 => 01111110
M = 01 => 0100000 00000000 00000000


I am confused with the mantissa part.

Would it be

M = 01 => 0100000 00000000 00000000


Or,

M = 01 => 0000000 00000000 00000001


?

• 0.625 = 1.01 * 2^(-1). 5 = 1.01 * 2^2. And the exponent is biased. – gnasher729 Mar 18 at 23:15
• You wrote 0.625 = 1.01 * 2^2, when really 5 = 1.01 * 2^2. And your correction is still wrong: 0.625 = 1.01 * 2^(-1), not 1.01 * 2^(-2). – gnasher729 Mar 18 at 23:31
• @gnasher729, is it correct now? – user366312 Mar 18 at 23:41