5
$\begingroup$

Here are two locations in memory:

 0110 | 1111 1110 1101 0011
 0111 | 0000 0110 1101 1001

Interpret locations 6 (0110) and 7 (0111) as an IEEE floating point number. Location 6 contains bits [15:0] and location 7 contains bits [16:31].

Floating Point -
   Locations 6 and 7: 0000 0110 1101 1001 1111 1110 1101 0011
   The number represented is 1.101 1001 1111 1110 1101 0011 × 2^(-114) 

Is my answer correct?
I am unsure exactly what the [16:31] and [15:0] relate to/mean?

$\endgroup$
  • $\begingroup$ Not really a math question. You may have better luck on a computing site. $\endgroup$ – Gerry Myerson Sep 14 '14 at 7:25
  • $\begingroup$ @GerryMyerson Can't we migrate this for him? It's been done for at least one my questions and maybe one of yours. $\endgroup$ – Robert Soupe Sep 14 '14 at 17:12
  • $\begingroup$ @Robert, I suppose we could vote to close and migrate, or flag for moderator attention and suggest migration, but I don't know enough about computing sites to suggest one as the target. $\endgroup$ – Gerry Myerson Sep 15 '14 at 1:32
  • $\begingroup$ @Gerry, I was looking at programmers.stackexchange, but a question there about converting from single precision float to half precision was closed for being "off-topic" (which of course does not always mean it really is off-topic. The scope is said to include questions about "algorithm and data structure concepts." $\endgroup$ – Robert Soupe Sep 15 '14 at 2:34
  • $\begingroup$ @Robert, if you find an appropriate site, go ahead and take whatever steps you can to migrate. I'm happy to let OP do the work of finding a better site and the work of contacting the moderators to migrate, or let OP delete here and post elsewhere. $\endgroup$ – Gerry Myerson Sep 15 '14 at 3:53
4
+25
$\begingroup$

The [16:31] and [15:0] refer to locations in the binary representation of a $32$-bit integer. You have interpreted this correctly.

When in doubt about technical problems, always consult Wikipedia an expert.

enter image description here

In your case the number is 0 || 00001101 || 101 1001 1111 1110 1101 0011

The sign is positive.

The biased exponent is 1101 $ = 13$, so the actual exponent is $13 - 127 = -114$, assuming single precision.

So the answer you have is correct: $$2^{-114} \times (1.101 1001 1111 1110 1101 0011)_2$$

$\endgroup$
  • 1
    $\begingroup$ If this question didn't advocate trusting Wikipedia at any level on any topic, and if I was the issuer of the bounty, I think I would award it to this answer. $\endgroup$ – Robert Soupe Sep 17 '14 at 0:49
  • $\begingroup$ I'd let the typo slide, though ("techincal"). $\endgroup$ – Robert Soupe Sep 17 '14 at 1:35
  • $\begingroup$ Hows that? Better? $\endgroup$ – A.E Sep 17 '14 at 2:38
  • 3
    $\begingroup$ Endianness do matter. You can check here $\endgroup$ – user137035 Sep 17 '14 at 10:22
  • $\begingroup$ Agreed, endianness matters. I am assuming that the bits in memory correspond to a 32 bit word (in the order stated) and that the exponent and mantissa have the MSB on the left. $\endgroup$ – A.E Sep 17 '14 at 18:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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