Number representation and arithmetic

Put all of your answers in a single file and submit using the class turnin page. (Wait for it to say that it is accepting submission of this assignment.

Due: 11:59:59PM on Monday, Sept. 1.

  1. 3.1-3.6
  2. 3.27 and 3.28 (add, subtract, multiply only)
  3. For each of the following what is the closest decimal number that can be represented as d*10k where d is a single decimal digit? Assume all the numbers are positive. Try to do these as estimates first before working them out on a calculator. Remember that 210 is about 1,00010, 220 is about 1,000,00010 and 230 is about 1,000,000,00010.
    1. 100 0000 00002
    2. 40016
    3. 100016
    4. 220
    5. 1 000016
    6. 0100 000016
    7. 4000 000016
    8. 7FFFF FFFF16 -- As I said in class, you can skip this one, though in fact there is nothing wrong with it; it just happens to be a 35 bit number.
    9. 0AC316
    10. 03F916
  4. What is the 32-bit 2's complement representation of the negative of each of the values in the previous question. You may express your answer in hex to save writing.
  5. Write a short program in the language of your choice to produce an addition table and multiplication table for the hex digits:
    Addition
         0  1  2  3 ... F
      0  0  1  2  3 ... F
      1  1  ...        10
      2  2  ...        11
      .
      .
      .
      F F 10 11 ...    1E
    
    Submit the code for your program and the output.