Question: Homework Description This problem focuses on execution time analysis. Consider the C program listed below: ` ` ` int arr 1 [ 2 5 6
Homework Description
This problem focuses on execution time analysis. Consider the C program listed below:
int arr;
int arr;
int fooint flag
int i;
int sum ;
if flag
fori;i;i
arri i;
arrii;
fori;i;i
sum arriarri;
return sum;
Assume that this program is run on a processor with a data cache of bytes. Each block of the cache is bytes. Memory addresses are of bits. Data in arr and arr are stored in contiguous memory locations, ie in a sequence as arr arr arr arr arr arr
a How many paths does the function foo of this program have? Describe what they are.
b If the cache is a direct mapped cache, how many bits in a bit address are used for block offset, set index and tag, respectively?
c Let T denote the execution time of the second for loop in the program. How does executing the first for loop affect the value of T Explain your answer.
The following question is for EECE. students only:
d if the cache is a twoway associative cache which has two cache blocks in a set would the cache benefit this foo function? Explain your answer.
Requirement
Please show your work and include as much details as possible.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
