Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You execute the following code segment exactly once on a machine with 3 2 - bit integer values. # define OFFSET 1 int a [
You execute the following code segment exactly once on a machine with bit integer values.
# define OFFSET
int a junkaOFFSET
b junkbOFFSET
c ;
int i j;
for i ; i ; i
for j ; j ; j
cij bij aij;
The machine configuration is:
bit integer; bit words; byte addressed on word boundaries.
L data cache: KBbyte block size, direct mapped, no writeallocate, writethrough. Hit time for
L clock.
L: KB byte block size, direct mapped, write allocate, writeback, hit time for L clock to
process L miss clocks to access L clocks. Memory access time after clocks to discover
that there is an L miss clocks.
Assume:
Array a starts at address x and arrays are allocated contiguously. The assembly code
always fetches b before a on a given iteration.
Physical addresses for data map identically to their virtual addresses.
Machine starts with invalidated caches.
Writing all modified data from the L cache to main memory is done after the code runs and is
included in all answers to the questions.
Only data cache behavior is considered ignore instruction fetching Caches are blocking with no
prefetching of data.
a How many clocks are spent to handle L misses ie give the number of clocks waiting for main
memory beyond whatever clocks would have been required to access L cache if there had been hits
Justify your answer.
b How many clocks are spent to handle L misses that are hit in L Justify your answer.
Hint: Layout the arrays in the cache and see how many times they wrap around and see what is the
effect of junka and junkb on the layout of the arrays.
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