Computers and Technology

In this exercise, we look at memory locality properties of matrix computation. The following code is written in C, where elements within the same row are stored contiguously. Assume each word is 32-bit integer, and A and B are 16x16 integer arrays. For (I = 0; I < 15; I++) For (J = 0; J < 15; J++) A[I] [J] = B[J][I] + A[J][0]; a) How many 32-bit integers can be stored in a 16-byte cache block?
b) References to which variables exhibit temporal locality?
c) References to which variables exhibit spatial locality?
d) Assume that starting address of matrix A is 0 times 1000, and the starting address of matrix B is 0 times 1800. Given a 512Byte 2-way set associative data cache with write allocate. Assume each cache block is 16 Byte. Estimate the cache hit ratio.
Locality is affected by both reference order and data layout. The same computation can also be written below in Matlab, which differs from C by storing matrix elements within the same column contiguously in memory.
For I = 1:15
For J =1:15
A(l, J) = B(J, I) + A(J, 0);
End
a) How many 16-byte cache blocks are needed to store both matrix A and B?
b) References to which variables exhibit temporal locality?
c) References to which variables exhibit spatial locality?
d) Assume that starting address of matrix A is 0 times 1000, and the starting address of matrix B is 0 times 1800. Given a 512Byte 2-way set associative data cache with write allocate. Assume each cache block is 16 Byte. Estimate the cache hit ratio.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 18:00, larry5007
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
Answers: 1
image
Computers and Technology, 24.06.2019 00:10, roxymiller3942
Read each statement below. if the statement describes a peer-to-peer network, put a p next to it. if the statement describes a server-based network, put an s next to it. p - peer-to-peer s - server-based
Answers: 1
image
Computers and Technology, 24.06.2019 11:00, asiaosterling
The program below has been generalized to read a user's input value for hourlywage. run the program. notice the user's input value of 10 is used. modify that input value, and run again. generalize the program to get user input values for workhoursperweek and workweeksperyear (change those variables' initializations to 0). run the program. monthsperyear will never change, so define that variable as final. use the standard for naming final variables. ex: final int max_length
Answers: 2
image
Computers and Technology, 24.06.2019 21:30, erickamiles1797
How do i copy and paste equations and pictures like math graphs, to post on this site to get my questions answered?
Answers: 2
Do you know the correct answer?
In this exercise, we look at memory locality properties of matrix computation. The following code is...

Questions in other subjects: