Homework 4

CS 220

30 points, due Oct. 24, 1997

Write pseudocode and a SAL program for multiplying 32-bit unsigned integers by shifting the multiplicand. The multiplicand and product will each require two words for storage.

In the SAL program use logical instructions and masks to handle the following:

  1. The shift of the msb from the multiplicand's least significant word (lsw) to the lsb of the multiplicand's most significand word (msw).

  2. Detection of the carry from the product and multiplicand addition from the lsw of the product to the msw of the product.

The multiplicand and multiplier should be input in binary form for the SAL program. The 64-bit product should be output in binary form.

The pseudocode should be written so as to serve as documentation for the SAL program. Variables names and program structure (loops, if/else statements) must be the same between the pseudocode and the program.

Turn in your pseudocode, the SAL program, and sample runs of the program. At least one of the runs must demonstrate that the carries and shifts from lsw to msw mentioned above are working properly. Verify for me that the sample runs either produce or do not produce the correct results. This assignment must be turned in in hardcopy form; e-mail is not acceptable.



Thomas P. Kelliher
Fri Oct 17 12:23:35 EDT 1997
Tom Kelliher