convert it to denery

its in the format C with sign bit first, next 6 bits exponent next 9 bits matissa itself

1011100010101000

Printable View

- October 18th 2006, 07:28 PMashana_hafloating points help
convert it to denery

its in the format C with sign bit first, next 6 bits exponent next 9 bits matissa itself

1011100010101000 - October 18th 2006, 10:59 PMCaptainBlack
lets assume that the format is:

sign,exponent,mantissa

with exponent and mantisa with msb in the leftmost position.

Here the sign bit is 1 which makes our number -ve.

the exponent is 011100 which is 0*1+0*2+1*4+1*8+1*16+0*32 = 28,

but we must subtract from this the exponent offset, which should be 63

so our exponent is 28-63=-35

The mantisa is 010101000 but there is a hidden bit which makes this

1010101000 which is:

0*(1/512)+0*(1/256)+0*(1/128)+1*(1/64)+0*(1/32)+1*(1/16)+0*(1/8)+1*(1/4)+0*(1/2)+1*1=1.328125.

So the number represented is:

-1.328125 2^(-35) ~= -3.86535 10^(-11)

RonL

(I should check this carefully if I were you as my assumptions about your

assumed 16 bit float representation could easily not matchthose that

you are working to)