Theorem: Prove every number in double precision 32-bit floating-point format can be represented in double precision 64-bit floating point-format.
Attempt: Let $ b = b_0 ,...,b_{31} $ be a binary string of 32 bits.
Define a binary string of 64-bits $ a = a_0,...,a_{63} $ as follows:
$ a_0 = b_0 $, $ ~~~~ a_1 = b_1,...,a_8 = b_8 $, $~~~~ a_9=a_{10} = a_{11} = 0 $, $~~~ a_{12} = b_9 ,...,a_{34} = b_{31}~ $, $~~~ a_{35} = a_{36} = ... = a_{63} $. Note that the binary string $ a $ as a float in 64-bits has the same sign and fraction of binary string $ b $ as a float in 32-bits, since:
$ a_0 = b_0 $ ( signs are the same ), $ \forall 1 \leq i \leq 8. a_i = b_i .$ and $ \sum_{k=1}^{52} a_{k+11} \cdot 2^{-k} = \sum_{k=1}^{23} a_{k+11} \cdot 2^{-k} = \sum_{k=1}^{23} b_{k+8} \cdot 2^{-k} $ ( fractions are the same ). We'll show that they both the same exponents, [ missing arguments ].
I got stuck in showing that both $ a $ and $ b $ have the same exponent, but it might not be true from my construction of $ a $ since If I take the following 32-bit float:
we see that $ sign = 0 , fraction = 1 \cdot 2^{-2} = \frac{1}{4}$ , $ exp = (01111100)_2 = (124)_{10} $ so this floating point number represents $ (-1)^0 \cdot 2^{124-127} \cdot ( 1 + \frac{1}{4} ) = 0.15625 $. But according to my construction of $ a $ I get that $ exp =( 01111100000 )_2 $ which is $( 992)_{10} $, so I get that $ a $ represents $ (-1)^0 \cdot 2^{992 - 1023} \cdot ( 1 + \frac{1}{4} )$ which is a totally different number
. hence I was stuck in proving the theorem. Can you please help? how would you prove the above theorem?