PowerPoint Presentation
TUT08 – Memory Hierarchy
COMP1411: Introduction to Computer Systems
Copyright By PowCoder代写 加微信 powcoder
Dr. Xianjin XIA
Department of Computing
The Polytechnic University
Spring 2022
These slides are only intended to use internally. Do not publish it anywhere without permission.
given the following function in the C language
Assume that the address of the array a is 0x0000; the size of int is 4 bytes.
Calculate the address of the following elements
a[0][0], a[2][0], a[0][3], a[2][3]
#define N 100
int sumarray3d(int a[N][N])
int i, k, sum=0;
for (i=0;i
Evicting the earliest installed item when cache is full
The following access sequence for data variables is generated by a program
ACEGACEGBDFHBDFH
Compute the number of cache hits and misses for the two different cache block sizes (8B or 16B)
Explain the results to evaluate cache block size design
Assume the following configuration for a processor with a cache:
Cache size = 16B
Cache block size = 4B
Data variable size = 4B
Allocation of data variables in the main memory =>
There are two cache replacement policies
FIFO: if the cache is full, and a new cache block will be loaded into the cache, the cache block that are installed earliest in absolute time will be evicted
LRU: if the cache is full, and a new cache block will be loaded into the cache, the least recently accesses block will be evicted
Given the following access sequence
ABCDABEFABEFCDEF
Please compute the number of cache misses and hits for each cache replacement policy, compare the FIFO and LRU replacement policies, and explain the difference in terms of which policy better utilizes program locality
Two cache configurations
Cache size = 16B, block size = 4B, data variable size = 4B. Any block can be installed to the cache. Using LRU replacement policy.
Cache size = 16B, block size = 4B, data variable size = 4B. Cache is partitioned into 2 sets. Variables A, C, E, G can only be loaded into S1 but not S2; variables B, D, F, H can only be loaded into S2 but not S1. Using LRU replacement policy.
Given the following access sequence
ADCEDADCEDACDE
Please compute the number of cache misses and hits for each cache configuration, and compare and evaluate the two configurations.
/docProps/thumbnail.jpeg
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com