MCS-284 Chapter 2 Homework (Fall 2002)
When turning in a homework problem, if it is one from the book, you
should indicate the exercise number. If it is not from the book, you
should indicate the number I give with an x in it, as in 2.x1 and 2.x2
below. These will be the reference numbers I use in reporting back
your standing on the homework.
A program I just ran took 12.26 seconds on the 400 MHz Pentium II in
my office, but only 4.26 seconds on one of the 1.8 GHz Pentium 4s in
the lab. (Note: 1 GHz = 1000 MHz.) How do the two machines' CPIs
compare for this program?
Another program took 1.87 seconds on my office machine and .26 seconds
on the lab machine. How do the two machines' CPIs compare running
this second program?
One of these two program was a real program (to do something useful),
which made significant use of memory. The other was a simple test
program that just looped a whole bunch of times doing nothing much,
reusing the same memory locations over and over. Speculate as to which
program is which and explain why you think so.
Do exercise 2.31 on page 96.
Do exercise 2.32 on page 96.
You are the manager of a microprocessor design team. The software that
will run on your microprocessor already exists and is fixed: it will
not be rewritten or recompiled in response to your design decisions.
microprocessor runs that software with an average CPI of 0.7.
One of the members of your design team suggests a change that will
reduce the CPI of multiply instructions from 2 to 1 (and leave the CPI
of other instructions unchanged). However, it will require
lengthening the cycle time by 10%. You need to decide whether this
change is desirable or not.
Note that if the software makes no use of multiply instructions, the
change will be a bad idea, since the cycle time will be increased
without any decrease in the number of cycles. Conversely, if the
software is nothing but multiply instructions, the change will be a
good idea, since one half of the cycles will be eliminated, which
will more than pay for a 10% increase in cycle time.
Real software is presumably somewhere in between these two extremes.
What fraction of the instructions executed need to be multiplies for
the proposed change to be a good one?
Instructor: Max Hailperin