Homework 2 -- Computer Representation of Integers

  1. Convert the following numbers from the bases as indicated.
    a.      306  (octal)              ______________________  (binary) 
    
    b.      2E5  (hex)                ______________________  (binary)
    
    c.      11101010 (binary)         ______________________  (octal) 
    
    d.      11101010 (binary)        ______________________  (hex) 
    
    e.      306   (octal)              ______________________  (hex) 
    
    f.      2E5   (hex)                ______________________  (octal) 
    
    
  2. What is the biggest numeric value you can write in 10 bits using two's complement notation? Express it in both binary two's complement form and in decimal:
    two's comp  __________________________  decimal  ________________________
    
    
  3. What is the smallest numeric value you can write in 10 bits using two's complement notation? Express it in both binary two's complement form and in decimal:
    two's comp  __________________________  decimal  ________________________
    
    
  4. Convert the following decimal values to binary two's complement notation in 8 bits:
    a.   -81           ______________________
    
    b.    -2           ______________________
    
    c.    88           ______________________
    
    d.   -45           ______________________
    
    e.     1           ______________________
    
    f.  -122           ______________________
    
    
  5. Is it possible to express +1024 in 11 bits using two's complement notation? If so, then write it below.
    ________________________
    
    
  6. Is it possible to express +1024 in 11 bits if we use unsigned numbers? If so, then write it below.
    ________________________
    
    
  7. What is the biggest value we can express in 32 bits if we use unsigned numbers? Express it in both binary and in decimal:
    binary  __________________________  decimal  ________________________
    
    
  8. What is the smallest value we can express in 32 bits if we use unsigned numbers? Express it in both binary and in decimal:
    binary  __________________________  decimal  ________________________
    
    


  9. What are the decimal values of the following numbers, given that they are written using 8-bit two's complement notation?
    a.	11010110		______________________
    
    b.	10110010		______________________
    
    c.	00011001		______________________
    
    d.	01000101		______________________
    
    e.	11110111		______________________
    
  10. Suppose we use a machine that represents integers in 9 bits using two's complement notation.
    a.	Our integers act like what set of modulo numbers?  _________________
    
    b.	How many integers can be represented in the machine? _______________
    
    c.	What is the largest possible positive integer?  Express it in both binary and decimal.
    
    	binary:  _______________________  decimal:  ______________________
    
    d.	What is the smallest possible negative integer?  Express it in both binary and decimal.
    
    	binary:  _______________________  decimal:  ______________________
    
    
  11. What is the smallest number of bits that can be used to store an integer on a computer which must be able to handle integers ranging from 2,000,000,000 down to -2,000,000,000?
    _______________________
    
  12. What if the computer represents integers in a fixed number of bytes? What is the fewest number of bytes necessary to handle integers ranging from 2,000,000,000 down to -2,000,000,000?
    _______________________