The following code snippet is executed on a system that uses a cache with a size of 128 bytes and a block size (1 row width) of 32 bytes. The array holds 2-byte int values.
for (int j = 0; j < step; j++) {
for (int i = 0; i < 128 / step; i++) {
A[i * step + j] = j;
}
}
Find the step values that result in the highest and lowest hit rates (the rate at which the desired data is found in the cache) for a cache with a direct-mapped structure.