Problem 6.5(p. 482) The three functions in Figure 6.20( next page)perform the same operation with varying degrees of spatial locality. Rank order the functions with respect to the spatial locality enjoyed by each Explain how you arrived at your ranking
Problem 6.5 (p.482) • The three functions in Figure 6.20(next page) perform the same operation with varying degrees of spatial locality. Rankorder the functions with respect to the spatial locality enjoyed by each. Explain how you arrived at your ranking
1 define N 1000 1 void clearl(point xp, int n) 3 typedef struct i int i, ji int vel[31 int acc[31 23456 for(⊥=0;⊥<n;i++){ 6 point (=0;j<3;j++) p[i].ve1[j]=0 point p[N] for(1=0;j<3;j++) p[i].acc[]=0; (a) An array of structs (b)The clearl function 1 void clear(point *p, int n) 1 void clear (point *p, int n) int±,j int i, j 4 for (i =0;i< n; i for (1=0 6 for(=0;j<3;j++) for (i =0:i< n: i++) p[].ve1[]=0 p[i].ve1[1=0 p[i] []=0 f。Y < 9 p[i].acc[]=0; a)The clear function (b) The clear function
Problem 6.6(p. 490) Fundamental parameters Parameter Description Number of sets E Number of lines per set B=2b Block size(bytes m=log2(M) Number of physical (main memory)address bits Derived quantities Parameter Description M=2 Maximum number of unique memory addresses Number of set index bits b=log2(B) Number of block offset bits =m-(8+b) Number of tag bits C=BXEX S Cache size(bytes)not including overhead such as the valid and tag bits
Problem 6.6 (p.490) • The table gives the parameters for a number of different caches. For each cache, determine the number of cache sets(S), tag bits(t), set index bits(s), and block offset bits(b). Cache m C B E S t s b 1. 32 1024 4 1 2. 32 1024 8 4 3. 32 1024 32 32