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

Assigned:
February 25, 2004.

Due:
March 3, 2004, at 5pm. Not accepted past classtime March 5.

Credit:
40 points.


Problems

Do the following problems. You may write out your answers by hand or using a word processor or other program, but please submit hard copy, either in class or in my mailbox in the department office.

  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 $ 0010_2$ by $ 0101_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). Assume the numbers are being treated as unsigned integers.

    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
2004-02-24