2

I am studying for an exam and I am confused about finding the "V" (The numeric value represented) and "f" fraction, in floating point rep

Let us use this example
16 bit:

|S (1 bit)|exp( 7 bit)|M (8 bit)|

Find:
exp: the value represented by considering the exponent field to be an unsigned integer
E: the value of the exponent after biasing
M: the value of the significant
V: the numeric value represented
f: the value of the fraction

Start with: 10.0000001

  1. Find our Bias: 2^(k-1)-1, Bias = 2(^6)-1 = 63
  2. Shift decimal: 1.00000001, E = 1 from a 2^1 shift
  3. M is to the right of the decimal, M = 00000001
  4. Find exp = E = exp - Bias, exp = 64
  5. sign bit is 0 when looking to the bit right after the decimal

Is this correct so far?

So our fp rep is : 0100000000000001 Hex: 0x4001

Now my question what is f and V?

I understand V is found from -1^s*M*2^E but I seem to have something messed up.

JDB
  • 25,172
  • 5
  • 72
  • 123
S1r-Lanzelot
  • 2,206
  • 3
  • 31
  • 45
  • This may help: http://stackoverflow.com/questions/3448777/how-to-represent-0-1-in-floating-point-arithmetic-and-decimal/3448855#3448855 – paxdiablo Oct 09 '12 at 03:09

1 Answers1

1

V is the value you started with, 10.00000012. Either the formula for V is incorrect (it should have f in place of M, so V = (-1)2·f·2E) or the definition of M is incorrect (it should be the entire fraction, not the portion with the initial 1 removed).

f is the fraction portion of the representation. For normal values, f = 1+M. (For subnormal values, f = 0+M.) So, in this example, f is 1.000000012.

Additionally, the sign bit is not taken from the bit to the right of the radix point. The sign bit is 0 if the number is positive and 1 if the number is negative.

Eric Postpischil
  • 195,579
  • 13
  • 168
  • 312