--- title: CMP Arch Chapter 5 --- # chapter 5 ## 5.1 ### Question * 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 a 32-bit integer. ![](https://i.imgur.com/NCZeX30.png) #### 5.1.1 ##### Q * How many 32-bit integers can be stored in a 16-byte cache block? #### 5.1.2 ##### Q * References to which variables exhibit temporal locality? #### 5.1.3 ##### Q * References to which variables exhibit spatial locality? #### 5.1.4 ##### Q * How many 16-byte cache blocks are needed to store all 32-bit matrix elements being referenced? #### 5.1.5 ##### Q * References to which variables exhibit temporal locality? #### 5.1.6 ##### Q * References to which variables exhibit spatial locality? ###### tags: `Computer Architecture` `CSnote`