Lab 5 Pre-Lab Assignment

Show all work!!!!

  1. Convert the base 10 number 102 to base 2.

     

     

     

  2. Find the 8-bit two's complement representation of each of the following (your answer to #1 will help):

    1. 102     ________________________________________

    2. -102    ________________________________________

     

  3. Convert the base 10 number 508 to base 9 two different ways:
    1. Using the subtraction method

       

       

    2. Using the division method

       

       

  4. Find the base 10 value of each of the following 8-bit two's complement numbers:

    1. 11011101

       

       

    2. 01110100

     

     

  5. Convert the base 8 number 32758 to
    1. base 10

       

       

    2. base 2 (using the special relationship between base 8 and base 2)

       

       

  6. What is the largest positive base 10 integer (unsigned -- all places are used for the number with no sign) that can be represented in four base 6 digits? Write both the 4-digit base 6 number and find its value in base 10.

     

     

     

  7. The 8-bit two's complement representation of 107 is 01101011 and the representation of 52 is 00110100.
    1. Find the 8-bit sum (two's complement) of 107 and 52.
                 0 1 1 0 1 0 1 1
               + 0 0 1 1 0 1 0 0
               ------------------
      					<---- your answer
               __________________
      
      
    2. Convert the two's complement answer to base 10.

       

       

       

    3. Did overflow occur? Explain.

       

       

       

  8. Suppose gpa is a variable containing the grade point average of a student. Suppose the goal of the program is to let a student know if he/she made the Dean's list (the gpa must be 3.5 or above). Write an if... else... statement that prints out the appropriate message (either "Congratulations -- you made the Dean's List" or "Sorry you didn't make the Dean's List").