Confusion with calculating the mantissa of a floating point from a binary number
In order to keep this answer short, I'll answer for how it would work for a 8 bit floating point number and a 8 bit fixed point number. I don't actually know how it's usually done, so this will be how I'd do it if I was given this question on an exam.



The floating point number will have the following bits:

\$[~s~|~e_2~|~e_1~|~e_0~|~f_3~|~f_2~|~f_1~|~f_0~]\$ 

where:


s = sign
e = exponent\$-3\$
f = fraction(mantissa/significand)


A short example:

\$[~0~|~110~|~1001~]=+~|~2^{6-3}~|~1.1001=1.5625×2^3=12.5\$ 
\$[~0~|~001~|~0011~]=+~|~2^{1-3}~|~1.0011=1.1875×2^{-2}=0.296875\$ 
\$[~1~|~100~|~1000~]=-~|~2^{4-3}~|~1.1000=-1.5×2^{1}=-3\$ 
\$[~1~|~000~|~0000~]=-~|~2^{0-3}~|~1.0000=-1×2^{-3}=-0.125\$



The fixed point number will have the following bits:

\$[~s~|~d_3~|~d_2~|~d_1~|~d_0~|~d_{-1}~|~d_{-2}~|~d_{-3}~]\$ 

where:


s = \$-16\$
d = number \$×~2^{-3}\$


A short example:

\$[~0~|~0000001~]=0~|~+0000.001=0.125\$
\$[~0~|~1111000~]=0~|~+1111.000=15\$
\$[~1~|~0000001~]=-16~|~+0000.001=-14.875\$
\$[~1~|~1111000~]=-16~|~+1111.000=-1\$

In the computer, 0.125 will be stored as "00000001", but its binary value is 0000.001, so do not confuse yourself with the decimal point. It's still in the same byte. 8 bits. 



So let's convert from fixed format to float. Remember, this is Harry's way (that's me).

Here's some important things to focus on:


The fractional bits represents values between 0 and 1, then 1 is added to this. So the resulting fraction lies between 1 and 2. 
A multiplication by 2 is the same as a left shift by 1
A division by 2 is the same as a right shift by 1


So here's some pseudo code I came up with that should convert it correctly for positive values. With few edits it can cover zero and negative numbers too. 

float8 fixed_to_float(fixed8 a){

  float8 b; //float8 doesn't exist. It's my custom one, SEEEFFFF.
  fixed8 e = 3;//fixed8 doesn't exist, but imagine a int8 where 16 means 1.
  while(a&gt;=2){
    a&gt;&gt;=1;
    //divide "a" by a factor two until
    //it is less than 2
    e++;
    //count the number of right shifts
  }

  while(a&lt;1){
    a&lt;&lt;=1;
    //multiply "a" by a factor two until
    //it is greater than or equal to 1
    e--;
    //count the number of right shifts
    }
  }

  a-=1;
  //remove the "1" from 1.125 and keep the 0.125
  e&lt;&lt;=4;
  //move it into the right position for the floating point representation
  b=e||a;
  //logical OR e and a together.

  return b;
}


For this code to work, the data type "fixed" has to be custom made with the "&lt;" operator so 0000.1111 registers as 0.9375 (15/16) which is less than 1. Or you try to make the value to lie between 32 and 16 rather than 2 and 1. 

Pseudo code for fixed to floating in action:

a=\$4.5=100.1 =[~0~|~100100~]\$
e=\$3\$

\$100.100_2\$ is greater than or equal to \$010.000_2\$, add 1 to e (e=\$100_2\$)
\$010.010_2\$ is greater than or equal to \$010.000_2\$, add 1 to e (e=\$101_2\$)
\$001.001_2\$ is less than \$010.000_2\$, stop


a-=\$1=00000010_2\$
e&lt;&lt;\$=4=01010000_2\$


\$
a=~00000010_2\\
e=~01010000_2~OR\\
\overline{b=~01010010_2}
\$

Verification:

\$[~0~|~101~|~0010~]=+~|~2^{5-3}~|~1.0010=1.125×2^2=4.5\$ 



I'll stop here since the question was how to go from fixed to floating point. But I'm technically showing how the conversion is made at the top of this answer with the floating point examples.