Go Tools Window Help HW 5 statement.pdf (1 page) HW 5: Performance Problems 1) C
ID: 3890098 • Letter: G
Question
Go Tools Window Help HW 5 statement.pdf (1 page) HW 5: Performance Problems 1) Computer A has a 5 GHz clock and executes program P in 30 seconds with an average CPI (cycles per instruction) of 3.0. How many instructions does it execute for program P? 2) Computer B has a 2 GHz clock. It executes P with the same number of instructions as computer A with an average CPI 1.0. How long does it take to execute P? p comaure the pertormae of computer B and computer on program P. Which is faster? by how much? 4) A new compiler for computer A compiles program P so that it executes only half as many instructions. Unfortunately, the CPI for computer A on these instructions is 4.0. How long does it take to execute the newly compiled program ? 5) Compare the performance of computer B (with the old compiler) to computer A (with the new compiler) on program P. Which is faster? by how much?Explanation / Answer
1)
Given Frequency of the clock in computer A is = 5 GHz
Clock period = 1 / Frequency = 1 / 5 GHz = 1 / (5 * 109)
Hence Clock period is = 0.2 * 10-9 = 0.2 ns
Given average CPI is = 3
Time taken to execute one instruction is = 3 * 0.2 ns = 0.6 ns
Total time taken to execute the entire program is = 30 secs
Number of instructions computer A executes for program A is = 30 secs / 0.6 ns
= 30 / 0.6 * 10-9
= 5 * 1010
Hence Number of instructions computer A executes for program A is = 5 * 1010.
2)
Given Frequency of the clock in computer B is = 2 GHz
Clock period = 1 / Frequency = 1 / 2 GHz = 1 / (2 * 109)
Hence Clock period is = 0.5 * 10-9 = 0.5 ns
Given average CPI is = 1
Time taken to execute one instruction is = 1 * 0.5 ns = 0.5 ns
Number of instructions is same as computer A and it is = 5 * 1010
Total time taken to execute the entire program is = 5 * 1010 * 0.5 ns
= 25 secs
Hence Total time taken to execute the entire program is = 25 secs.
3)
Computer B is faster than computer A as it executes the same number of
instructions (5 * 1010) in 25 secs on the other hand computer A takes 30 secs.
B is 20 % faster than A ( (30-25/25) *100 = (5/25)*100 = 20 )
4)
With the new compiler computer A will only execute 1/2 instructions of total
Hence total Number of instructions computer A executes is = 1/2 * 5 * 1010 = 2.5 * 1010
Given CPI is = 4 and we know that clock period is = 0.2 ns
Time taken to execute one instruction is = 4 * 0.2 ns = 0.8 ns
Hence Time taken to execute 2.5 * 1010 instructions is = 2.5 * 1010 * 0.8 ns = 20 secs
5)
Now with new compiler computer A completes the execution of program P in 20 secs
whereas with old compiler computer B completes the execution of program P in 25 secs
Hence computer A is faster.
A is 25 % faster than B ( (25-20/20) *100 = (5/20)*100 = 25 )
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.