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, && m == 0
(-1)^s x 0.M x 2^-2: e == 0, && M != 0
(-1)^s x 1.N x 2^(e - 3): 0 < e < 7
(-1)^s x infinity: e == 7 && m == 0
NaN: e == 7 && 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.