Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spreadsheet Modeling And Decision Analysis A Practical Introduction To Management Science

Authors: Cliff T. Ragsdale

5th Edition

324656645, 324656637, 9780324656640, 978-0324656633

More Books

Students also viewed these Accounting questions

Question

Gay, lesbian, bisexual, and transgender issues in sport

Answered: 1 week ago