-1
$\begingroup$

I am trying to convert +3.5 to binary floating point, but im struggling to find the exponent. (8 Bit)

Where 1st bit is the Sign, 3 bits for Exponent and 4 bits for Mantissa. Hope somebody can explain this

Here is what I have done:

+3.5 - Sign = 0 3 = 1 1 0.5 * 2 = 1 ---> 1 1 . 1 1 1 . 1 * 2^0 ----> 0.1 1 1 * 2^2

Mantissa = 1 1 1 Exponent?

This is an exercise from a book and the actual answer is: 0 1 1 0 1 1 1 0 Im unsure on how they got 1 1 0 for the exponent

$\endgroup$

closed as off-topic by Daniel W. Farlow, Newb, Shuchang, Mario Carneiro, kingW3 Mar 17 '15 at 10:58

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question is not about mathematics, within the scope defined in the help center." – Daniel W. Farlow, Newb, Shuchang, Mario Carneiro, kingW3
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 6
    $\begingroup$ the Finery Bloating Point is defined to be that state when a person becomes too large to wear truly fashionable clothes. For men, this is usually when the pot belly doubles the natural width back-to-front, for pregnant women it is about the sixth month. $\endgroup$ – Will Jagy Mar 8 '15 at 20:30
  • $\begingroup$ @Amzoti - I have added what the actual answer is - if you could explain how the exponent was achieved that would be appreciated! $\endgroup$ – Mathematica Mar 8 '15 at 20:31
1
$\begingroup$

The bias of your encoding, following the example of IEEE floating point types, is $2^2-1=3$, so that the exponent range is from $0-3=-3$ to $7-3=4$, disregarding IEEE encodings for $\pm\infty$ and NaN. By the rules of normalization, $(11.1)_2$ is encoded as $(1.11)_2·2^1$, the leading $1$ is implicit in the encoding. Adding the bias to the exponent gives the exponent code $1+4=4=(100)_2$ so that the complete encoding is

0 100 1100
$\endgroup$
0
$\begingroup$

I will rewrite the answer in details (I was wrong - the book is correct): I assume two's complement representation. The first digit is the sign of the number.

0 110 1110 = decimal notation: $14X2^{-2}$ = 3.5

Exponent 110 = -2 dec, 1110 = 14 dec.

$\endgroup$
  • $\begingroup$ This seems unlikely, since by the leading 1 the number is negative. 1 010 1110 more likely corresponds to $-(1.1110)_2⋅2^{2-3}=-(0.5+0.25+0.125+0.0625)=-0.9375$. $\endgroup$ – LutzL Mar 10 '15 at 5:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.