Homework #1

This first homework will ask you to solve some problems from the textbook and to do some work on your own related to comparing perfomance and to locality.

1. 2.1 (page 81) (5 points)

2. 2.2 (page 81) (5 points)

3. 2.3 (page 81) (10 points)

4. 2.4 (page 82) (5 points)

5. 2.5 (page 82) (5 points)

6. 2.7 (page 82) (5 points)

7. 2.9 (page 83) (5 points)

8. Using files that contain addresses issued by some CPU to execute some application(s), draw the histogram of address distribution for each of them. On the Ox axis of the plot you will have the address number (don't start with zero, rather with the smallest address you find in the file and go up to the maximum address in the file). On the Oy axis you will have the number of occurences for each particular address. Please comment based on the histogram. The name of the files are


The first contains the traces obtained by executing the spice simulator to simulate a circuit and the second one has been obtained using the cc compiler to compile itself.

Each line in the file has two fields: the first field indicates what kind of operation the CPU performs (read, write, etc.), and the second field is the address. (60 points)

9. Write a program that multiplies two square matrices, whose elements are randomly generated. You will have two versions of the program, one in which matrix elements are integers and another one where they are real numbers. You will compile and run the programs on two different systems (most likely one of them will be some PC and the other one some workstation - delta0 through delta8).
Measure the time it takes the program to complete and then compare the performance of the two systems. Since the matrices are randomly generated, you will have to run the program several times, mesure the running time and then take the average. Also the running time has to be significantly large (many seconds) to avoid measuring errors.
Is the performance ratio the same as the clock rate ratio of the two systems? Explain. Based on the retail price of the two systems, which one is more cost effective? Make sure your work includes a description of the two systems (manufacturer, CPU type, amount of memory, etc.) and of the compiler used. (50 points)

Maximum mark: 150 (100%)