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.3.1 59 5
2 1.3.4 59 5
3 1.4.1 60 10
4 1.4.6 60 10
5 1.5.1 61 5
6 1.5.4 61 5
7 1.6.1 62 5
8 1.6.2 62 5
9 1.7.1 63 5
10 1.7.4 64 5
11 1.10.1 66 5
12 1.10.4 67 10
13 1.14.2 70 10
14 1.14.3 70 10
15 1.15.1 71 5
16 1.15.4 71 10
17 See #1 below 50
18 See #2 below 50
Maximum mark (100%) 210

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 file contains the trace obtained by executing TeX, the typesetting system, 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.1 2011/09/06 14:54:39 virgil Exp $