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, 22.06.2019 14:30
The “rule of 72” is used to approximate the time required for prices to double due to inflation. if the inflation rate is r%, then the rule of 72 estimates that prices will double in 72/r years. for instance, at an inflation rate of 6%, prices double in about 72/6 or 12 years. write a program to test the accuracy of this rule. for each interest rate from 1% to 20%, the program should display the rounded value of 72/r and the actual number of years required for prices to double at an r% inflation rate. (assume prices increase at the end of each year.)
Answers: 1
question
Computers and Technology, 23.06.2019 08:30
Based on your knowledge of a good network, describe what you think is a perfect network would be. what kind of information and resources could users share on this network. what would the network administrator do? what kind of communication would be used?
Answers: 1
question
Computers and Technology, 24.06.2019 11:00
Which of the statements below describe the guidelines for the use of text in presentation programs? a. do not use numbered lists. b. fonts should be appropriate for your audience. c. limit the number of fonts you use to three or four. d. only use bulleted lists for sales promotions. e. select font sizes that are appropriate for your delivery method. f. use font colors that work well with your background. select all that apply
Answers: 1
question
Computers and Technology, 24.06.2019 13:30
To move an excel worksheet tab, simply right-click on it drag and drop it double-click on it delete it
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
Mathematics, 13.10.2020 06:01
question
Mathematics, 13.10.2020 06:01
question
Mathematics, 13.10.2020 06:01