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, 23.06.2019 06:40
How many nibbles can be stored in a 16-bit word?
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
Which of these is a benefit of using objects in a powerpoint presentation? a. collaborators can create the external files while you create and edit the slide show. b. you can easily change the theme and design of the presentation. c. you can have older data in the source file while having up-to-date data in the presentation. d. collaborators can easily share the presentation.
Answers: 2
question
Computers and Technology, 23.06.2019 17:00
1. which of the following is not an example of an objective question? a. multiple choice. b. essay. c. true/false. d. matching 2. why is it important to recognize the key word in the essay question? a. it will provide the answer to the essay. b. it will show you a friend's answer. c. it will provide you time to look for the answer. d. it will guide you on which kind of answer is required.
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
Write a program that displays the following menu: geometry calculator 1. calculate the area of a circle 2. calculate the area of a rectangle 3. calculate the area of a triangle 4. quit enter your choice (1-4): if the user enters 1, the program should ask for the radius of the circle and then display its area. use the following formula: area = ď€(the square of r) use 3.14159 for ď€ and the radius of the circle for r. if the user enters 2, the program should ask for the length and width of the rectangle and then display the rectangle’s area. use the following formula: area = length * width if the user enters 3, the program should ask for the length of the triangle’s base and its height, and then display its area. use the following formula: area = base * height * .5 if the user enters 4, the program should end. input validation: display an error message if the user enters a number outside the range of 1 through 4 when selecting an item from the menu. do not accept negative values for the circle’s radius, the rectangle’s length or width, or the triangle’s base or height. note: if the user enters an improper menu choice (1-4), the program prints "the valid choices are 1 through 4. run the program again and select one of those." if the user enters a negative radius, the program prints "the radius can not be less than zero." if the user enters a negative value for height or base, the program prints "only enter positive values for base and height."
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, 01.10.2019 11:30
Questions on the website: 13722361