Question: B. You are given a MIPS machine with a single level of 2KiB direct-mapped cache with 512B cache blocks. It has 1MiB of physical
B. You are given a MIPS machine with a single level of 2KiB direct-mapped cache with 512B cache blocks. It has 1MiB of physical address space. (12 points) The function foo is ran on the system with a cold cache and as the only process: #define ARRAY LEN 4096 hithit #define STEP_SIZE 64 // A starts at 0x10000 // B starts at Ox20000 foo( int* A, int* B) { int total = 0; Which wit for (int i = 0; i < ARRAY_LEN; i+= STEP_SIZE) { total += A[i]; total = B[i]; } iji. } Calculate the number of Tag, Index, and Offset bits for this cache. (6 points) Tag = 503 bits. Index= 9 bits offset bits 512 bits - Calculate the hit percentage for this cache after running foo. (2 points) 50% The cache is now cleared and the code is run again. This time, A and B are pointing to the same array, which starts at Ox10000. Calculate the new hit percentage. (2 points) Assume A and B starts once again at 0x10000 and 0x20000. What is the new hit percentage if we ran foo on a fully associative cache, with all other parameters staying the same? (2 points) fully associative cache: memory block could be mapped to any cache block 100%
Step by Step Solution
There are 3 Steps involved in it
Lets go through the calculations step by step Calculate the number of Tag Index and Offset bits for ... View full answer
Get step-by-step solutions from verified subject matter experts
