Consider a program comprising 25% arithmetic instructions, 32% load instruction,
ID: 3715958 • Letter: C
Question
Consider a program comprising 25% arithmetic instructions, 32% load instruction, 13% store instructions, and 30% branch instructions. Assume the CPI for arithmetic instructions is 1, for load and store instructions it is 4, and branches have a CPI of 2. The CPU clock rate is 3.4 GHz. We have a referenceprogram with 1,102,000 instructions.
a. What is the run time of the program given?
b. Consider running the program on a machine with a large graphics card.When we run the program on this machine, the arithmetic instructions only can be run in parallel on the card, everything else is run sequentially. As the number of stream processors on the GPU goes toward infinity, what is the maximum speedup obtainable on this program?
c. Consider running the program on a version of the CPU with a clock rate of 2.4 GHz, but which has a CPI of 3 for load and store instructions (all other’s CPIs
remain the same). Which CPU performs better on the program and by how much ?
Explanation / Answer
Solution:
a)
The runtime will be calculated as
First Average CPI = 0.25*1 + 0.32 * 4 + 0.13 * 4 + 0.3 * 2= 2.65
Execution time= Instruction count*CPU/Clock frequency = 1102000 * 2.65/(3.4 * 10^9) = 0.00085891176 = 0.85891176 ms
b)
The new CPI will be 0.32 * 4 + 0.13 * 4 + 0.3 * 2= 2.4
Speedup = 2.65/2.4 = 1.10416666667
c)
The new average CPI will be
0.25*3+ 0.32 * 4 + 0.13 * 4 + 0.3 * 2 = 3.15
CPU time = 1102000 * 3.15/(2.4 * 10^9) = 0.001446375 = 1.446375 ms
which is slower
so the previous implementation is fasteer.
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.