IEEE-754 single precision 1-bit sign 8-bit exponent 23-bit fraction, What is the binary representation of 0.25*2^(-128)=2^(-130)? by using the formula: exponent-bias=log(given number) and also fraction=-1+(given number)/2^(exponent-bias) doesn't give the right answer....why? And how to solve this question?
Asked
Active
Viewed 264 times
-2
-
I would like to say that this is actually a really interesting question if anyone would give you guys a chance instead of just assuming your trying to cheat on your homework. – William Rosenbloom Feb 25 '16 at 07:51
-
Where exactly did you get stuck? Please show your work. So we have 1.0 * 2**-130. What's the fraction? Zero. The number is positive, so what's the sign bit? Zero. Now you just need the biased exponent: For that, add the exponent bias to the mathematical exponent. Finally, merge the bit fields together. – njuffa Feb 25 '16 at 07:55
-
@njuffa The exponent seems to be -3: 11...1101 but the answer says: exponent: 0 fraction: 0.001 – avivk Feb 25 '16 at 08:00
-
1@njuffa: It's subnormal. – Mark Dickinson Feb 25 '16 at 08:04
-
@avivk Sorry, my mistake (past midnight here). IEEE-754 uses a normalized significand in \[1,2), unless the number is subnormal, which *is* the case here. The smallest normalized IEEE-754 `binary32` number is 2**-126. Subnormal numbers have a biased exponent of zero. I think you can figure it out from here. See also [Wikipedia](https://en.wikipedia.org/wiki/IEEE_floating_point) – njuffa Feb 25 '16 at 08:14
-
@avivk Wikipedia has a dedicated page for IEEE-754 [single-precision format](https://en.wikipedia.org/wiki/Single-precision_floating-point_format). In the section "Exponent encoding" you can see how the numerical value relates to the encoding. In this case, look at the entry for "denormal number" (that's an older term for "subnormal number"). With that, you should be able to figure out the desired answer – njuffa Feb 25 '16 at 08:27
1 Answers
0
It's 00000000000010000000000000000000
or 0x00080000
in hex.
Courtesy of this webpage.

William Rosenbloom
- 2,506
- 1
- 14
- 37
-
Because it's negative. On means negative off means positive. – William Rosenbloom Feb 25 '16 at 08:02
-
-
You could add an explanation about why this is the right answer. (The OP doesn't ask for a solution, but rather asks *how* to solve.) – Mark Dickinson Feb 25 '16 at 08:06
-
number 2^(-130) is positive,1) Does it represents the sign of exponent? 2) Does this representation only for positive numbers? – avivk Feb 25 '16 at 08:06
-
@MarkDickinson To be honest I don't know how to solve it. I was just curious and I thought they'd appreciate to know the answer also. – William Rosenbloom Feb 25 '16 at 08:17
-
@avivk No this representation works for negative numbers too. – William Rosenbloom Feb 25 '16 at 08:17
-
why the exponent is zero and fraction is 0.001? by the formula I wrote it suppose to be different... – avivk Feb 25 '16 at 08:26