views:

44

answers:

2

hey!

So here is what we have, a custom IEEE based setup:

Consider a five-bit floating representation based on the IEEE floating point format with 1 sign bit, two exponent bits and 2 significand bits.

And a selection of bits that needed to be converted to binary (answers included):

0 00 00 = 0

0 00 01 = 0.01

0 00 10 = 0.10

0 00 11 = 0.11

0 01 00 = 1.00

0 01 01 = 1.01

0 01 10 = 1.10

The way I was attempting to calculate the above was as:

2^(2-1) -1 = 1 (the bias)

for the second one, this would mean 0 -1 (since the exponent field is zero), so 0.1 * 10-1 = .01. only prob is that we dont seem to be adding the implicit leading 1. why not? and yet it seems for the values with a positive exponent (see 5 and below) we do indeed add the leading one. bit stumped as to what im missing.

many thanks!

+1  A: 

You probably exchanged the exponent and the mantissa column. Maybe because it looked so fitting.

drhirsch
+1  A: 

What you're missing is that in the IEEE-754 formats, values that have a zero exponent but non-zero significand field, called denormals, do not have an implicit leading bit.

For example, in IEEE single precision, the smallest positive normal number is:

0x00800000 = 0x1.0 * 2**-126

the next smaller number is the largest denormal:

0x007fffff = 0x0.fffffe * 2**-126

the smallest positive number is the smallest denormal:

0x00000001 = 0x0.000002 * 2**-126

Note that not only do denormals have no implicit bit, but they also have the same exponent as elements in the next larger binade, even though their encoded exponent is one smaller (zero vs. one).

Stephen Canon
Thanks! I learned something today. ;)
John at CashCommons