CSCI 2321 (Principles of Computer Design), Spring 2002:
Homework 4

Assigned:
February 27, 2002.

Due:
March 8, 2002, by the start of class.

Credit:
40 points.


Problems

  1. (6 points) Do problem 4.10 on p. 323 of the textbook.

    Hint: The textbook claims this can be done with only three instructions. I think this is only possible by using pseudoinstructions; if you use only real instructions you will need four.

  2. (8 points) Do problem 4.12 on p. 323 of the textbook.

  3. (8 points) Do problem 4.14 on p. 324 of the textbook.

    Hint: You may find conversions from binary to decimal less tedious if you first convert to hexadecimal and then convert to decimal. Remember that partial credit for wrong answers is only possible if you show your work.

  4. (8 points) Do problem 4.23 on p. 326 of the textbook. (The problem suggests photocopying Figure 4.17. To save you the trouble of photocopying the figure or finding it on the authors' Web site, here it is in your choice of printable formats: PDF or PostScript. This figure is copyrighted1.)

    Hint: Consider whether you can combine the output marked Set (bit 31 of the result of subtracting a - b) and the output marked Overflow to generate something that is 1 when $ a < b$ and 0 otherwise.

  5. (6 points) Do problem 4.43 on p. 329 of the textbook.

  6. (4 points)
    1. Use the algorithm in Figure 4.32 of the textbook to multiply $ 0011_2$ by $ 0010_2$, showing values at each step for all of the registers involved (as the textbook does in the example in Figure 4.33 -- you don't have to use this exact format but should show about the same amount of detail).

    2. Use the algorithm in Figure 4.40 of the textbook to divide $ 0111_2$ by $ 0100_2$, showing values at each step for all of the registers involved.



Footnotes

... copyrighted1
COPYRIGHT 1998 MORGAN KAUFMANN PUBLISHERS, INC. ALL RIGHTS RESERVED.


Berna Massingill
2002-04-29