Midterm Solutions 2013

# Assuming a fixed data set which lines on the graph

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (d) 14: 13 : 5 (e) None of the above 32. Suppose we switch to a word- addressed memory. Give the Tag : Index : Offset breakdown: (a) 16 : 15 : 4 (b) 14 : 13 : 3 (c) 16 : 13 : 3 (d) 14: 13 : 5 (e) None of the above 33. Using the following code to answer the question. You may assume sizeof(int) = 4. Also assume that arr is block aligned. #define WIDTH _?_ #define STRIDE _?_ void printer(int* arr) { // assume arr is of length WIDTH for (int i = STRIDE; i &lt; WIDTH; i += STRIDE) { printf(“%d\n”, *(arr+i)); printf(“%d\n”, *(arr+i-STRIDE)); } } Suppose WIDTH = 220. What is the smallest stride that produces the worst possible hit rate and what is that hit rate? (assume a cold cache, answers are STRIDE, Hit Rate). (a) 8, 0% (b) 16, 0% (c) 216, 0% (d) 1, 50% (e) 220, 10% 34. Calculate AMAT for a machine with the following specs: L1 hits take 3 cycles, L1 local miss rate is 25%. L2 hits take 10 cycles, L2 local hit rate is 60%. L3 hits take 100 cycles, L3 global miss rate is 9%. Main memory accesses take 1000 cycles and all data is available in memory. (a) 105.5 cycles (b) 1000 cycles (c) 24.5 cycles (d) 25.5 cycles (e) 278.25 cycles 35. Suppose we call printer() repeatedly with the same arr. How does increasing STRIDE change the “amount” of spatial and temporal locality with respect to arr? (a) Increasing STRIDE decreases temporal locality and increases spatial locality. (b) Increasing STRIDE increases temporal locality and increases spatial locality. (c) Increasing STRIDE does not change temporal locality and decreases spatial locality....
View Full Document

Ask a homework question - tutors are online