A CPU has a 32 KB direct mapped cache with 28-byte block size. Suppose A is a two dimensional tray of size 512 × 512 with elements that occupy 8-bytes each. Consider the following two C code segments P1 and P2
P1 : for (i = 0, i < 512; i++) {
for (j = 0, j < 512; j++) {
x+ = A [i] [j];
}
}
P2 : for (i = 0, i < 512; i++) {
for (j = 0, j < 512; j++) {
x+ = A [i] [j];
}
}
P1 and P2 are executed independently with the same initial state, namely, the array A is not in the cache and i, j, x are in registers. Let the number of cache misses experienced by P1 be M1 and that for P2 be M2
A CPU has a 32 KB direct mapped cache with 28-byte block size. Suppose A is a two dimensional tray of size 512 × 512 with elements that occupy 8-bytes each. Consider the following two C code segments P1 and P2
P1 : for (i = 0, i < 512; i++) {
for (j = 0, j < 512; j++) {
x+ = A [i] [j];
}
}
P2 : for (i = 0, i < 512; i++) {
for (j = 0, j < 512; j++) {
x+ = A [i] [j];
}
}
P1 and P2 are executed independently with the same initial state, namely, the array A is not in the cache and i, j, x are in registers. Let the number of cache misses experienced by P1 be M1 and that for P2 be M2
37. The value of the ratio M1 /M2 is
Consider a machine with a byte addressable main memory of 216 bytes. Assume that a direct mapped data cache consisting of 32 lines of 64 bytes each is used in the system. A50 × 50 two-dimensional array of bytes is stored in the main memory starting from memory location 1100 H. Assume that the data cache is initially empty. The complete array is accessed twice. Assume that the contents of the data cache do not change in between the two access.
Consider a machine with a byte addressable main memory of 216 bytes. Assume that a direct mapped data cache consisting of 32 lines of 64 bytes each is used in the system. A50 × 50 two-dimensional array of bytes is stored in the main memory starting from memory location 1100 H. Assume that the data cache is initially empty. The complete array is accessed twice. Assume that the contents of the data cache do not change in between the two access.