Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

We have a 1024 byte cache that is direct mapped. Each line of the cache stores a 64-byte block. We have the following structure definition:

We have a 1024 byte cache that is direct mapped. Each line of the cache stores a 64-byte block. We have the following structure definition: struct object { int a; /* uses 4 bytes of memory */ int b; /* uses 4 bytes of memory */ double c; /* uses 8 bytes of memory */ }; (a) For this code block struct object data[192]; /* starts at memory address 0 */ int sumA = 0, sumB = 0, i; /* these are stored in registers */ double sumC = 0; /* this is stored in a register */ for(i = 0; i < 192; i++) sumA += data[i].a; for(i = 0; i < 192; i++) sumB += data[i].b; for(i = 0; i < 192; i++) sumC += data[i].c; i. Determine the number of times that the cache is read. ii. What is the cache miss rate?

(b) For this code block struct object data[192]; /* starts at memory address 0 */ int sumA = 0, sumB = 0, i; /* these are stored in registers */ double sumC = 0; /* this is stored in a register */ for(i = 0; i < 192; i++) { sumA += data[i].a; sumB += data[i].b; sumC += data[i].c; } i. Determine the number of times that the cache is read. ii. What is the cache miss rate?

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_2

Step: 3

blur-text-image_3

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

More Books

Students explore these related Databases questions