Convert 24(decimal) to modified IEEE 754 floating point format? Here's what I have as the tweaked format I'm to use:


S EEE MMMM (excess 8 format)
s = sign bit, E = exponent bits, M = mantissa/fraction bits
Otherwise, it follows the IEEE 754 in principle.
The values:

(-1)^s x 0.0: e == 0, &amp;&amp; m == 0

(-1)^s x 0.M x 2^-2: e == 0, &amp;&amp; M != 0

(-1)^s x 1.N x 2^(e - 3): 0 &lt; e &lt; 7

(-1)^s x infinity: e == 7 &amp;&amp; m == 0

NaN: e == 7 &amp;&amp; m != 0


That's the formula I've been provided. I need to change 24(decimal) into a floating point binary value, but I continually end up with NaN. Am I doing something wrong?

It is technically a homework question, so if you don't want to provide an exact answer, I'd still be very appreciative if someone can tell me if I'm doing this right or wrong.
Since $e=111$ is saved for indicating NaN and  $\infty$, then the maximal number that can be represented with this 8bit-floating point structure is
$$ (-1)^0 \cdot (1.1111)_b \cdot 2^{6-3} = 15.5$$

Therefore, you cannot represent 24(Dec) using the above system. 

However, the correct translation would be infinity rather than a NaN, that is, 24 should be represented as $0\ 111\ 0000 \equiv \infty$.