Answered step by step
Verified Expert Solution
Link Copied!

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 32-bit integer values.
# define OFFSET 1
int a [128][128], junka[OFFSET],
b [128][128], junkb[OFFSET],
c [128][128];
int i, j;
for (i =0; i <128; i++){
for (j =0; j <128; j++){
c[i][j]=(2* b[i][j])+(3* a[i][j]);}}
The machine configuration is:
32-bit integer; 32-bit words; byte addressed on word boundaries.
L1 data cache: 8KB,16-byte block size, direct mapped, no write-allocate, write-through. Hit time for
L1=1 clock.
L2: 256 KB,16 byte block size, direct mapped, write allocate, write-back, hit time for L2=1 clock to
process L1 miss +3 clocks to access L2=4 clocks. Memory access time (after 4 clocks to discover
that there is an L2 miss)=50 clocks.
Assume:
Array a [] starts at address 0x00000000 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 L2 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
pre-fetching of data.
a) How many clocks are spent to handle L2 misses (i.e. give the number of clocks waiting for main
memory beyond whatever clocks would have been required to access L2 cache if there had been hits).
Justify your answer. (15)
b) How many clocks are spent to handle L1 misses that are hit in L2. Justify your answer. (35)
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

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

Big Data Concepts, Theories, And Applications

Authors: Shui Yu, Song Guo

1st Edition

3319277634, 9783319277639

More Books

Students also viewed these Databases questions

Question

=+2. Who is the audience?

Answered: 1 week ago