Assignment 8, due Mar 28
On every assignment, write your name legibly as it appears on your University ID card! Homework is due on paper at the start of class on the day indicated (usually Friday). Exceptions will be made only by advance arrangement (excepting "acts of God"). Late work must be turned in to the TA's mailbox (ask the CS receptionist in 14 MLH for help). Never push homework under someone's door!
A problem: Make a table showing all possible combinations of f1, f2, f3, and c0 (the carry in to the least significant bit). For each row in this table (that is, for each combination of the inputs) document the function performed by this bank of logic circuits. (for example, one row might compute A+B+1, while some other row might compute A&B, and yet another row might perform some useless function. (1.0 points)
Background: Compare the code for faster binary multiplication on the Hawk (about 1/5 of the way into Chapter 9) with the code for fast signed multiplication on the Hawk. The most obvious difference between these two is that the signed version has a special case for the sign bit of the multiplier before the main loop of the multiplication. There are some other important differences.
A Problem They shift different things. Very briefly state what each routine shifts and which way it shifts it. (0.4 points)
SRU R3,1 SRU R4,1 ADJUST R1,CMSB
The above code is from section 11.2 of the Hawk manual.
A Problem: There is a much faster way to do this using 2 12-bit right-shifts, a 20-bit left shift and a small number of auxiliary instructions. Give the best code you can for this. The very best code is surprisingly compact. (0.8 points)