Question: Write a simple C program for which a 4 - way associative cache has a significantly lower miss rate than an equally sized 2 -

Write a simple C program for which a 4-way associative cache has a significantly lower miss rate than an equally sized 2-way set associative cache. It will be easiest if you use blockSize1.c as a starting point. You may choose any cache size and block size you wish, but they must remain the same for the entire problem.
Hints for writing programs with a specified cache behavior:
You need not loop through the entire array. Instead, find addresses that collide in the cache. Remove the inner loop and make NUM_LOOPS 1,000,000.Notice in blockSize1.c that array is an array of characters; therefore, each item in the array is exactly 1 byte. As a result, it is easy to identify data items that will or will not conflict in the cache. For example, in an 8KB direct-mapped cache, array bytes 0 and 8192 will conflict. This is basically a pencil-and-paper problem that we happen to be using a cache simulator to verify.Write the simplest program you can that will produce a 100% miss rate for the 2-way cache.
Submit the source code, all cache parameters, and resulting hit rates.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!