CS 282 Winter 2003

Assignment 4

3/26/2003

 

Due date: 4/2/2003 12:30 PM

 

  1. Do addition on the following unsigned numbers.  Identify which (if any) of the operations result in overflow. Show a check of your work by converting to decimal and redoing our calculations.

 

(a)       100110 (b) 1000101

+  001000                   + 0111100

--------------             ----------------

 

            

 

  1. Do addition on the following two’s complement  numbers.  Identify which (if any) of the operations result in overflow for 8-bit words. Show a check of your work by converting to decimal and redoing our calculations.

 

(a)       01110110 (b) 11000101

+  01100011                     + 00111100

----------------                ----------------

 

 

  1. Do the following two’s complement subtraction. Identify which (if any) of the operations result in overflow for 8-bit words. Show a check of your work by converting to decimal and redoing our calculations.

 

   (a)        10110101                    (b)        10110110

-  00110011                             -  01110100

----------------                    ----------------

 

 

  1. Do the following multiplications in two’s complement representation. Convert the decimal numbers to two’s complement representation first, and then show the multiplication. Check that your answer is correct.

Treat them as 4 bit numbers and perform sign extension before multiplying.

 

(a)   7  x  5

(b)   -6  x  4

 

      5. Consider the 8-bit quantity:  10110010

(a)    Perform a logical left shift operation on the above number.

(b)   Perform an arithmetic right shift on the above number.

 

      6. Consider the 8-bit quantity:  11000110

(a)    Perform a left rotate operation on the above number.

(b)   Perform an right operation on the above number.