Question: 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

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 Databases Questions!