Homework #1


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


1. 1.1 (page 51) (20 points)

2. 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

~virgil/cs470/varia/traces/benchmarks/spice.din
~virgil/cs470/varia/traces/benchmarks/tex.din

The first contains the traces obtained by executing the spice simulator to simulate a circuit and the second one has been obtained using the TeX word processor.

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)

3. 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: 130 (100%)