Question: int data[N]; int compute variance () ( int sumi 0, sum20, result; int i; for(i=0;i < N;i++) ( suml data[i]; 1 suml sumi /

Consider the function compute variance listed abov 

int data[N]; int compute variance () ( int sumi 0, sum20, result; int i; for(i=0;i < N;i++) ( suml data[i]; 1 suml sumi / N for (i = 0; i < N;i++) ( sum2 data[i] data[i]; 1 sum2 - sum2 / N result (sum2- suml sumi); return result; 6. Consider the function compute variance listed above that computes the variance of integer numbers stored in the integer array called data: Consider the case where N is 16 and 32. How many cache misses will there be in each case with the following assumptions: an integer is 4 bytes long a block size of 4 bytes using direct mapped cache

Step by Step Solution

3.52 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

91 If N16 then we will suffer a cache miss in the first for loop ... 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 Computer Engineering Questions!