The CPU clock is 1 GHz. One OP requires 5 clock cycles (for example arithmetic instruction and conditional). Each memory access (read or write) requires 100 clock cycles and the problem size is 1 million or n = 1,000,000. There is no memory access cost of loop index variable: don't count any arithmetic instructions for initializing or incrementing the loop index value. Assume the loop index variable is free of charge. There is an arithmetic operation involved in updating the accumulator variable. Algorithm Sum = 0 For i in range (0, n); Sum += i; Print (“sum =, sum) How many memory accesses and clocks are required by this algorithm?

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter5: Looping
Section: Chapter Questions
Problem 3RQ
icon
Related questions
Question

The CPU clock is 1 GHz. One OP requires 5 clock cycles (for example arithmetic instruction and conditional). Each memory access (read or write) requires 100 clock cycles and the problem size is 1 million or n = 1,000,000.

There is no memory access cost of loop index variable: don't count any arithmetic instructions for initializing or incrementing the loop index value. Assume the loop index variable is free of charge. There is an arithmetic operation involved in updating the accumulator variable.

Algorithm

Sum = 0

For i in range (0, n);

Sum += i;

Print (“sum =, sum)

How many memory accesses and clocks are required by this algorithm?

 

 

Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Registers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,