Question: I have written a single piece of code that consists of a single for loop with a simple calculation within the loop. I run

 I have written a single piece of code that consists of a single   

I have written a single piece of code that consists of a single "for" loop with a simple calculation within the loop. I run the code two different times on the same computer, timing the execution for each run. The only change that is made between the two different runs is changing the number of loops that are executed. (10 points) If run number 1 is expected to loop 1 million times, and run number 2 is expected to loop 1 billion times, which run should take longer (assume CPIs are identical)? (Please justify your answer using the performance equation). b. (10 points) If both runs were found to take the identical amount of time, how many instructions were executed for each program? (assume that the time measurements are perfectly accurate and the CPIs are identical) (5 points) how long did the program run in each case? d. (5 points extra credit) Please explain what might have caused this? (you must correctly answer 3.a-3.c to receive this extra credit)

Step by Step Solution

3.39 Rating (149 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Assuming the number of instructions per loop IPL and clock cycles per instruction CPI remain constant we can use the performance equation to analyze t... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!