Homework 7

  1. Show how each of the following numbers would be represented as 8-bit 2s-complement binary integers:
        
     93    -93    -64  
       
    


  2. Convert the following 8-bit 2s complement binary numbers to decimal:
        00011010
        11111011
        11101010
        10000000
    


  3. Given the declaration
               byt:    .byte     -1,0,-1,0
    

    Show what is in each register ($t0 through $t3) after the following code executes. Give your answer in hex.

                lb         $t0,byt
                lbu        $t1,byt
                lw         $t2,byt
                srl        $t3,$t2,8
                
    


  4. Show (using binary arithmetic) how the following sums would be computed in a 4-bit two's complement system. If an addition would generate an overflow, put a * next to the result. (Note: overflows occur when the sign is wrong!)
          3      4        5      -3       7        -4
        + 4    + 5     + -2    + -4     + 4        -6
        ---    ---     ----    ----     ----     -----