tags:

views:

298

answers:

3

How would i go about finding the value of the two-byte two’s complement value 0xFF72 is"?

  1. Would i start by converting 0xFF72 to binary?
  2. reverse the bits.
  3. add 1 in binary notation. // lost here.
  4. write decimal.

I just dont know..

Also,

What about an 8 byte double that has the value: 0x7FF8000000000000. Its value as a floating point?

+2  A: 

Step 3 just means add 1 to the value. It's really as simple as it sounds. :-)

Example with 0xFF72 (assumed 16-bits here):

  1. First, invert it: 0x008D (each digit is simply 0xF minus the original value)
  2. Then add 1: 0x008E
Chris Jester-Young
A: 

This sounds like homework and for openness you should tag it as such if it is.

As for interpreting an 8 byte (double) floating point number, take a look at this Wikipedia article.

David Kanarek
This is not homework.. This was a question on a quiz 2 weeks ago that i missed and wanted to learn how to do
Corey
+1  A: 

I would think that this was homework, but for the particular double that is listed. 0x7FF8000000000000 is a quiet NaN per the IEEE-754 spec, not a very interesting value to put on a homework assignment:

  • The sign bit is clear.
  • The exponent field is 0x7ff, the largest possible exponent, which means that the number is either an infinity or a NaN.
  • The significand field is 0x8000000000000. Since it isn't zero, the number is not an infinity, and must be a NaN. Since the leading bit is set, it is a quiet NaN, not a so-called "signaling NaN".
Stephen Canon
This is not homework.. This was a question on a quiz 2 weeks ago that i missed and wanted to learn how to do
Corey