Assignment 12, due April 23
Part of
the homework for 22C:122/55:132, Spring 2004
|
Always, on every assignment, please write your name legibly as it appears on your University ID and on the class list! All assignments will be due on Fridays at the start of class, and unless there is what insurance companies call "an act of God", the only exceptions to this rule will be by advance arrangement.
a) Work it out assuming there are no bubbles or other events that might invalidate instructions.
b) What problems do bubbles and stalls cause with your solution.
c) What problems do branches cause with your solution.
t = 0 for i = 1 to 10 do t = t + a[i]*b[i]
As in the notes, begin with non-optimal code that follows the logic of the original program, then optimize.
int fib(int i) { if (i < 2) return i; return fib(i - 1) + fib(i - 2); }
Do not code this function! The assignment is to create a calling sequence, receiving sequence and return sequence appropriate for this function.