Question:
Consider an array stored in memory from address 6 6000 int
Last updated: 8/15/2023
Consider an array stored in memory from address 6 6000 int array 4 4 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Suppose the machine implements a fully associative cache only one set bit with a single line of 16 bytes The memory addresses can then be partitioned into 2 tag bits and 4 block offset bits For example the memory address 6 b101100 would be formatted as tag bits 2 b10 and block offset bits 4 b1100 a Version 1 Suppose the array is accessed with for loops below and the cache is cold to start completely empty How many caches misses would each for loop incur int sum 0 for int i 0 i 4 i for int j 0 j 4 j sum array i j to 6 b Version 2 is declared as follows int sum 0 for int j 0 j 4 j for int i 0 i 4 i sum array i j