Student ID: 20726557 # Cache ### Calculate cache size and tag addresses ![image](https://hackmd.io/_uploads/ByPcptRC1l.png) The total cache size is the following: > 64 Byte/Cacheline * 4096 Cachelines = 262144 Byte = 256 KB > 256 KB * 4 way = 1024 KB total cache size The address range of the tag is the following (assuming byte addressable): > Offset = log2(64) = 6 Bits > Index = log2(4096/4) = 10 Bits > Address Range = 16 Bits ### MESI protocol exercise ![image](https://hackmd.io/_uploads/HkrYD9RRke.png) ![image](https://hackmd.io/_uploads/SJlqs5RAJe.png) --- # Memory ### Memory system performance improvement techniques ![image](https://hackmd.io/_uploads/S1Yeh5CRye.png) ![image](https://hackmd.io/_uploads/rkSf6cCRJl.png) ### Access array elements in storage order ![image](https://hackmd.io/_uploads/SJMHTqRAye.png) Code A gives better performance. Since the array is in row-major order, by accessing the data at across each row allows better spatial locality and improves the performance. ### DRAM address mapping ![image](https://hackmd.io/_uploads/ryxHaA50Ake.png) How many memory channels? > 1 Channel Bit --> 2 Channels How many DIMMs are in each channel? > 1 DIMM Bit --> 2 DIMMs per Channel How many banks are in each DIMM? > 2 Bank Bits --> 4 Bank per DIMM Which CPU address bit for dataset size of 265B? > 265B --> 512B, log2(512) = 9 --> Bit[8]