subject

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.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 19:30
Why is it a good idea to leave an interview being courteous and polite?
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
Write a full class definition for a class named player , and containing the following members: a data member name of type string .a data member score of type int .a member function called setname that accepts a parameter and assigns it to name . the function returns no value.a member function called setscore that accepts a parameter and assigns it to score . the function returns no value.a member function called getname that accepts no parameters and returns the value of name .a member function called getscore that accepts no parameters and returns the value of score .this is what i have, aparently this is wrong: class player{private: string name; int score; public: void player: : setname (string n){name =n; }void player: : setscore (int s){score = s; }string player: : getname (){return name; }int player: : getscore (){return score; }};
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
Which one of the following functions is not available on the autosum tool? sum average if max
Answers: 3
question
Computers and Technology, 25.06.2019 09:30
Which resource produces the cleanest energy? -coal -gasoline -oil -wind
Answers: 1
You know the right answer?
In this exercise, we look at memory locality properties of matrix computation. The following code is...
Questions
question
Business, 17.03.2021 23:40
question
Health, 17.03.2021 23:40
Questions on the website: 13722363