Homework 1 examples
Purposes:
(1) work with units and prefixes;
(2) work with the execution time equation and CPI.
Note:
For main memory size, interpret K, M, and G as powers of two.
Otherwise, interpret K, M, and G as powers of ten.
1. For a processor with 100 MHz clock frequency (a.k.a. clock rate),
what is the clock cycle time?
CCT = 1 / clock rate = 1 / ( 100 * 10^6 cycles per sec )
= 10 / 10^9 secs per cycle = 10 nsec
2. Consider making a complete backup of a full 40 GB hard drive using a
250 MB zip drive. How many 250 MB zip disks will be needed?
Use powers of ten for capacities other than cache or main memory.
# of zip disks = 40 GB / 250 MB = 4*10^10 / 2.5*10^8 = 160
3. Find the execution time for a program that executes 30 million
instructions on a processor with an avg. CPI of 2.0 and a clock
cycle time of 33.3 nsec.
exec. time = IC * CPI * CCT
= 30M insts. * 2 cycles/inst * 33.3 nsec/cycle
= 1.998 seconds = 2 seconds (rounded)
4. For the following instruction set workload and cycle values, find the
average CPI.
type | freq cycles
-------+--------------
alu | 0.5 2
branch | 0.2 6
ld/st | 0.3 6
avg. CPI = (0.5 * 2) + (0.2 * 6) + (0.3 * 6) = 4.0