This problem evaluates the cache performances for different loop orderings. You are asked to consider the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
This problem evaluates the cache performances for different loop orderings. You are asked to consider the following two loops, written in C, which calculate the sum of the entries in a 128 by 64 matrix of 32-bit integers: Loop B sum = 0; for (j=0; j<64; j++) for (i = 0; i < 128; i++) sum += A[i][i]: Loop A sum = 0; for (i =0; i<128; i++) for(j 0; j<64; j++) sum + Aillil: The matrix A is stored contiguously in memory in row-major order. Row major order means that elements in the same row of the matrix are adjacent in memory as shown in the following memory layout: A[i][j] resides in memory location [4*(64*i+j)] Memory Location: 0 A[0][0] | A[0][1] 252 A[0][63] 256 A[1][O]... 4 (64 127+63) A[127][63] (a) Consider a 4KB direct-mapped data cache with 32-byte (8-word) cache blocks. Calculate the number of cache misses that will occur when running Loop A. Calculate the number of cache misses that will occur when running Loop B. Assume that the caches are initially empty. Show all your work to get full credit. (b) Consider a direct-mapped data cache with 32-byte 8 (8-word) cache blocks. Calculate the minimum number of cache blocks required for the data cache if Loop A is to run without any cache misses other than compulsory misses. Calculate the minimum number of cache blocks required for the data cache if Loop B is to run without any cache misses other than compulsory misses. Explain your reasoning. This problem evaluates the cache performances for different loop orderings. You are asked to consider the following two loops, written in C, which calculate the sum of the entries in a 128 by 64 matrix of 32-bit integers: Loop B sum = 0; for (j=0; j<64; j++) for (i = 0; i < 128; i++) sum += A[i][i]: Loop A sum = 0; for (i =0; i<128; i++) for(j 0; j<64; j++) sum + Aillil: The matrix A is stored contiguously in memory in row-major order. Row major order means that elements in the same row of the matrix are adjacent in memory as shown in the following memory layout: A[i][j] resides in memory location [4*(64*i+j)] Memory Location: 0 A[0][0] | A[0][1] 252 A[0][63] 256 A[1][O]... 4 (64 127+63) A[127][63] (a) Consider a 4KB direct-mapped data cache with 32-byte (8-word) cache blocks. Calculate the number of cache misses that will occur when running Loop A. Calculate the number of cache misses that will occur when running Loop B. Assume that the caches are initially empty. Show all your work to get full credit. (b) Consider a direct-mapped data cache with 32-byte 8 (8-word) cache blocks. Calculate the minimum number of cache blocks required for the data cache if Loop A is to run without any cache misses other than compulsory misses. Calculate the minimum number of cache blocks required for the data cache if Loop B is to run without any cache misses other than compulsory misses. Explain your reasoning.
Expert Answer:
Answer rating: 100% (QA)
Consider the given question Two loops written in C language are given The answer and explanation for the answer are provided in the next steps Explana... View the full answer
Related Book For
Computer Architecture A Quantitative Approach
ISBN: 978-0123704900
4th edition
Authors: John L. Hennessy, David A. Patterson
Posted Date:
Students also viewed these programming questions
-
Derive a combinational circuit that selects and generates any of the 16 logic functions listed in Table 4-5. Table 4-5 x y Fo F F F3 1000 00 0 1 1 TABLE 4-5 Truth Tables for 16 Functions of Two...
-
Inscribe a detailed paper on RFID Solutions and Standards in the Transportation Industry.
-
In about 1965, engineers at the Toro Company invented a gasoline gauge for small engines, diagrammed in Figure P35.43. The gauge has no moving parts. It consists of a flat slab of transparent plastic...
-
Sascha owns stock in Lewis Corp and she bought a $1,000 corporate bond. The bond pays 6.34% annual interest. a. How much will Sascha receive in annual interest? b. How much will Sascha receive in...
-
In the spring of 1999, Source Associates, Inc. (Source), and Conrad A. Mamajek, Inc. (CAM), entered into a joint venture to act as a middleman for the sale of polymers manufactured by Mitsui...
-
Echo Canyon Muffins sells its muffins to restaurants and coffee houses for an average selling price of $ 27 per case. The following information relates to the budget for Echo Canyon Muffins for this...
-
Recent events have once again shaken and stirred the memory of the nation. Almost immediately after the Civil War, a myth arose painting the conflict with a brush that attempted to blur the lines...
-
Consider the Bode plot of the loop transfer function of a closed loop control system: Bode plot of D(jw)G(jw) is shown. a) Determine the GM and PM of the system. b) Determine the wer of the system....
-
Relate animal morphology and anatomy to taxonomy and histology. Explain exhaustively and provide citations and examples.
-
A study published in April 2015 in the Academic Emergency Medical journal found that \(85 \%\) of doctors surveyed admitted that they ordered tests not because they were necessary for medical reasons...
-
To strengthen the incentive for hospitals to avoid making mistakes, public hospitals in Australia received no funding after July 1, 2017, for sentinel events (for example, operating on the wrong body...
-
In Solved Problem 20.4, does joint profit increase, decrease, or remain the same as the share of revenue going to Ann increases? Data From Solved Problem 20.4:- Peter, the owner of a firm, pays his...
-
You own a house worth $800,000 that is located on a river bank. If the river floods moderately, the house will be completely destroyed. This happens about once every 50 years. If you build a seawall,...
-
At the conclusion of this chapter, the textbook mentions that data and process modeling may eventually become obsolete due to the increasing popularity and usage of object-oriented modeling and...
-
1. What is meant by the terms positive and negative assurance, and which category does a comfort letter fall into? Explain. 2. Share insight with me, i.e. something you found interesting while...
-
The Heese Restaurant Group manufactures the bags of frozen French fries used at its franchised restaurants. Last week, Heeses purchased and used 101,000 pounds of potatoes at a price of $ 0.70 per...
-
The switched snooping protocol of Figure 4.40 assumes that memory "knows" whether a processor node is in state Modified and thus will respond with data. Real systems implement this in one of two...
-
We will start by configuring a system to complete a sort in the least possible time, with no limits on how much we can spend. To get peak bandwidth from the sort, we have to make sure all the paths...
-
The performance of a snooping cache-coherent multiprocessor depends on many detailed implementation issues that determine how quickly a cache responds with data in an exclusive or M state block. In...
-
If price moves from disequilibrium to equilibrium, what happens to the combination of producer and consumer surplus in the market?
-
Why does nearly every purchase you make provide you with consumer surplus?
-
The chapter frames the issue of the effects of taxation in terms of its effects on producer and consumer surplus. a. What does that framework leave out of the analysis? b. How might one frame the...
Study smarter with the SolutionInn App