Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

DO NOT USE AI OR COPY OTHER ANSWERS FROM HERE Access pattern is defined as the order in which the elements within a data structure

DO NOT USE AI OR COPY OTHER ANSWERS FROM HERE
Access pattern is defined as the order in which the elements within a data structure are referenced. The access pattern can have a major impact on performance when using a memory system employing caches.
Consider a system with a direct-mapped D-cache (data cache) containing 4096 lines. Each line is 256 bytes in size. The D-cache is initially empty. The matrix X with 256 rows and 256 columns is to be processed. The matrix resides in memory starting at address 0x10040000. Assume that each matrix element is 32 bits. Also assume registers are used for the array indices and no code optimizations are performed.
a) If the matrix is stored in row major order, what is the miss ratio for the data cache based on the matrix accesses made by the following code?
for (i=0; i<256; i=i+2;){
for {j=0; j<256; j=j+2}
X[i,j]= X[i,j]+ X[i+1,j];
}
}
Each row contains 2564-byte elements and are 256*4=1024 bytes in size.
b) If the matrix is stored instead in column major order, what is the hit ratio for the cache based on the matrix accesses made by the following code?
for (j=0; j<256; j=j+2;){
for {i=0; i<256; i=i+2}
X[i,j]= X[i,j]+ X[i+1,j];
}
}

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

Modern Database Management

Authors: Fred R. McFadden, Jeffrey Slater, Mary B. Prescott

5th Edition

0805360549, 978-0805360547

More Books

Students also viewed these Databases questions

Question

Use substitution to find each indefinite integral. dx X z(xu[ + I)

Answered: 1 week ago

Question

find all matrices A (a) A = 13 (b) A + A = 213

Answered: 1 week ago

Question

7. List behaviors to improve effective leadership in meetings

Answered: 1 week ago

Question

6. Explain the six-step group decision process

Answered: 1 week ago