Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Consider the following C program. It will run on a processor of a data cache and an instruction cache. For this question, ignore instruction
1. Consider the following C program. It will run on a processor of a data cache and an instruction cache. For this question, ignore instruction cache miss (the instruction cache size is more than enough). /1 double is 8-byte double X [1024] double sum = 0.0; double max = DBL MIN; // DBL MIN ?s minimum value for double for (int ? = 0; i max ) maxX[i] Assume that the start address of the array is a multiple of 32. a. Assume the cache is 16 KB, direct mapped, and of 32-byte blocks. How many cache misses will happen? Explain your result. b. Now assume the cache is 4 KB, direct mapped, and of 32-byte blocks. How many cache misses will happen? Explain your result. Pay attention to the difference in the cache size. c. This question continues sub-question b). Revise the code to reduce the number of cache misses. Write down the code in the space below. You don't have to copy the declarations. 1. Consider the following C program. It will run on a processor of a data cache and an instruction cache. For this question, ignore instruction cache miss (the instruction cache size is more than enough). /1 double is 8-byte double X [1024] double sum = 0.0; double max = DBL MIN; // DBL MIN ?s minimum value for double for (int ? = 0; i max ) maxX[i] Assume that the start address of the array is a multiple of 32. a. Assume the cache is 16 KB, direct mapped, and of 32-byte blocks. How many cache misses will happen? Explain your result. b. Now assume the cache is 4 KB, direct mapped, and of 32-byte blocks. How many cache misses will happen? Explain your result. Pay attention to the difference in the cache size. c. This question continues sub-question b). Revise the code to reduce the number of cache misses. Write down the code in the space below. You don't have to copy the declarations
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started