Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions

Question

paid month end salaries of $57,000

Answered: 1 week ago

Question

What are the stages of project management? Write it in items.

Answered: 1 week ago

Question

why do consumers often fail to seek out higher yields on deposits ?

Answered: 1 week ago