CS 211: Fall 2008. Homework 1. Due
September 23rd
Questions 1 and 2 are required. Question 3 will not be graded and you can collaborate on question 3 only.
Ques.1: Consider the process of improving the performance of a program by optimizing some of the code in the program and running it in an enhanced (i.e., optimized) form. Suppose that optimized instructions run 20 times faster than sequential.
Ques.2: This question requires that you start using the simplescalar simulation environment. Refer to link posted on the course webpages for simplescalar information.
Use the C compiler (gcc is
the default for simplescalar) and compile the code
for matrix multiplication (for the pseudo code shown below for one the machines
supported by simplescalar (
You must use the following algorithm for matrix multiplication
For i=1 to N do
{
for j=1 to N do
{
C[i,j] = 0;
for k=1 to N do
C[i,j] = C[i,j] + A[i,k]*B[k,j];
}
}
Ques.3: This question requires you to generalize Amdahl’s law to the case when multiple enhancements are possible. Three enhancements with the following speedups are proposed for a new architecture:
Speedup1=30, Speedup2= 20, Speedup3 = 15.
Only one enhancement is usable at a time (but multiple can be used over the entire application). If enhancements 1 and 2 are each usable for 25% of the time, what fraction of the time must enhancement 3 be used to achieve an overall speedup of 10 for the entire application ?