Homework 2 Solutions - i = 2: B[2], C[3], A[2] = 3 misses,...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CDA 5106 Homework #2 <50 points> P 3.1) There are 1500 memory references (500 to each A, B, and C – since loop control i += 2 ). For each array, these span (1000x8/64) = 125 blocks, hence there are 125 misses to each array, leading to 3x125 = 375 total misses. The total miss rate is 375/1500 = 25% . P 3.3) The first iteration accesses memory location &B[0], &C[1], and &A[0]. Unfortunately, since the arrays are consecutive in memory, these locations are exactly 8KB (1024x8B per double) apart. Hence, in a two-way set associative cache they conflict, and the access to A[0] will evict B[0]. In the second iteration, the access to B[2] will evict C[1], and so on. loop i = 0: B[0], C[1], A[0] = 3 misses, read first block block B[0], C[1], block A[0] replaces B[0]
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: i = 2: B[2], C[3], A[2] = 3 misses, B[2] replaces C[1], C[3] replaces A[0], A[2] replaces B[2] i = 4: B[4], C[5], A[4] = 3 misses, B[4] replaces C[3], C[5] replaces A[2], A[4] replaces B[4] i = 6: B[6], C[7], A[6] = 3 misses, B[6] replaces C[5], C[7] replaces A[4], A[6] replaces B[6] loop i = 8: B[8], C[9], A[8] = 3 misses, read second block B[8], C[9], block A[8] replaces B[8] : The pattern repeats, and no hit will result. Hence the miss rate is 100% . P3.13) P3.24) CPI = 1.15 + 12 cycles/miss x (.03 miss/inst + .02 miss/inst) + 50 cycles/L2miss x (.25 L2miss/L2ref x (.03+.02) L2ref/inst) = 1.15 + 0.60 + 0.625 = 2.375 cycles/inst P3.4)...
View Full Document

Page1 / 2

Homework 2 Solutions - i = 2: B[2], C[3], A[2] = 3 misses,...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online