Menu

(Solved) : Exercise 5 30 Marks Consider 32 Bit Computer Simplified Memory Hierarchy Hierarchy Contain Q44116267 . . .

Exercise 5. [30 Marks] Consider a 32-bit computer with a simplified memory hierarchy. This hierarchy contains a single cache

Exercise 5. [30 Marks] Consider a 32-bit computer with a simplified memory hierarchy. This hierarchy contains a single cache and an unbounded backing memory. The cache has the following characteristics: • Direct-Mapped, Write-through, Write allocate. • Cache blocks are 16 words each. • The cache has 128 sets. (a) [4 Marks] Calculate the cache’s size in bytes. (b) [12 Marks] Consider the following code fragment in the C programming language to be run on the described computer. Assume that: program instructions are not stored in cache, arrays are cache-aligned (the beginning of the array aligns with the beginning of a cache line), ints are 32 bits, and all other variables are stored only in registers. int N = 16384; int A[N]; for (int i = 1; i < N; i += 2) { A[i-1] = A[i]; Determine the following: (i) The number of cache misses. (ii) The cache miss rate. (iii) The type of cache misses which occur. (c) [14 Marks] Consider the following code fragment in the C programming language to be run on the described computer. In addition to the assumptions of part (b), assume that that the array B immediately follows the array A in memory. int N = 16384; int A[N]; int B[N]; for (int i = 0; i < N; ++i) { A[i] = B[i]; Determine the following: (i) The number of cache misses. (ii) The cache miss rate. (iii) The type of cache misses which occur. Show transcribed image text Exercise 5. [30 Marks] Consider a 32-bit computer with a simplified memory hierarchy. This hierarchy contains a single cache and an unbounded backing memory. The cache has the following characteristics: • Direct-Mapped, Write-through, Write allocate. • Cache blocks are 16 words each. • The cache has 128 sets. (a) [4 Marks] Calculate the cache’s size in bytes. (b) [12 Marks] Consider the following code fragment in the C programming language to be run on the described computer. Assume that: program instructions are not stored in cache, arrays are cache-aligned (the beginning of the array aligns with the beginning of a cache line), ints are 32 bits, and all other variables are stored only in registers. int N = 16384; int A[N]; for (int i = 1; i

Expert Answer


Answer to Exercise 5. [30 Marks] Consider a 32-bit computer with a simplified memory hierarchy. This hierarchy contains a single c…

OR