(If you want to write up your answers using Markdown, here is a partial, incomplete template you can use to get started.)

HW: Interpreting Binary Data

Part A: Signed and Unsigned Integers

Reminders:

Complete the following exercises:

  1. Calculate the following sums in hexadecimal and binary. Assume the numbers represent 8-bit unsigned integers. Circle or highlight any result that has an overflow. Note whether the hex and binary sums represent the same number.
  2. 1a Hex Binary
    0x46 0100 0110
    + 0x74 0111 0100
     
     
    1b Hex Binary
    0x46
    + 0xE9
     
     
    1c Hex Binary
    0x87
    + 0x74
     
     
    1d Hex Binary
    0x87
    + 0xE9
     
  3. For the 4 numbers that appear as operands above (0x46, 0x74, 0x87, 0xE9):     
  4. Which of the calculations in Question #1 above have operands or sums whose values depend on whether they represent unsigned or 2's complement numbers? (Question #2 provides part, although not all, of the answer to this question.) Would you expect the results of the sums to be different if the numbers were treated as 2's complement?
  5. For all of the sums above that would be different if interpreted as 2's complement signed integers, what is the value (expressed in decimal) of the 2's complement interpretation? When does overflow occur? Is this the same as in problem (1) above? Why or why not?
  6. Recalculate 1b (0x46+0xE9) using subtraction, treating 0x46 and 0xE9 as 2's complement binary integers. In other words, calculate 0x46 - (-0xE9), in binary. Then do the same calculation in hex. Both answers should match your answer in 1b. (Tip: -0xE9 = 0x17. Verify this by comparing it to the binary 2's complement value you calculated.)
  7. 1b as sub    Hex Binary
    hex/binary for 0x46 0x46
    hex/binary for - (-0xE9) - 0x17

Part B: Floating Point Numbers

  1. What is the floating point decimal value for 0xC1740000 if it represents a 32-bit floating point number?     
  2. What is the binary 32-bit floating point representation for -1609.5?     
  3. What is the 64-bit floating point representation for the same number (-1609.5)?