Homework #1


Most problems for this homework are from the textbook.

Submit your work work on the Blackboard before midnight the day the homework is due. Failure to do so will result in late penalties, see the syllabus for grading detail.

Here are the requirements for your Blackboard submission:

  • Attach the assignment as a compressed archive file (.zip, .tgz, .tbz2, .rar)
  • The name of the file should be: firstName-lastName-HW-assignmentNumber.extension (e.g. Jane-Doe-HW-1.zip)
  • Include your e-mail address in the Comment field when submitting the assignment through the Digital Drop Box
  • If for any reason you are submitting the assignment more than once, indicate this in the Comment field by including the word COMPLEMENT

  Problem Page Points
1 1.1 56 52
2 1.2 58 25
7 See #1 below 50
8 See #2 below 50
Maximum mark (100%) 175

1. Using trace files, i.e. 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.

Comment based on the histograms. The files to use are:

The first contains the traces obtained by executing the Spice circuit simulator and the second one has been obtained by running compiling the CC compiler using CC.

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; for this exercise you only need to consider the second column in the file.

HINT: your work will be significantly easier if you use standard UNIX utilities such as awk and sort and a graphing application such as gnuplot.

2. 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 (double).

You will compile and run the programs on two different systems -- most likely one of them will be your own desktop/laptop and the other one a computer in the lab, or otherwise on one of the UNIX computers IIT makes available to its students.

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, measure the running time and then take the average. Also the running time has to be significantly large (many seconds) to avoid measuring errors; this means you will have to work with matrices that have at least hundreds of lines and columns.

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, operating system, etc.) and of the compiler used.

Attach the source code and the tables with your time measurements for your work.



$Id: hw1.html,v 1.2 2009/08/26 03:44:16 virgil Exp $