Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need answer for attached question You execute the following code segment exactly once on a machine with 3 2 - bit integer values.int a

I need answer for attached question You execute the following code segment exactly once on a machine with 32-bit integer values.int a [128][128], junka[OFFSET],c [128][128];
int i, j;
for (i=0; i 128; i++){ c[i][j]=(2* b[i][j])+(3*\textrm{a}[\textrm{i}][\textrm{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: 256KB,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.
b) How many clocks are spent to handle L1 misses that are hit in L2. 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.
image text in transcribed

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

Murach's SQL Server 2012 For Developers

Authors: Bryan Syverson, Joel Murach, Mike Murach

1st Edition

1890774693, 9781890774691

More Books

Students also viewed these Databases questions

Question

Describe five general characteristics of the Renaissance period.

Answered: 1 week ago

Question

How is workforce planning linked to strategic planning?

Answered: 1 week ago