简体   繁体   English

如何计算缓存未命中?

[英]how to calculate cache misses?

I got the following question: 我有以下问题:

A and B are arrays of 4 integers (integer = 4 bytes = one word) on a computer that uses a cache with cache size of 64 Bytes, and with block size of one word. A和B是使用高速缓存大小为64字节,块大小为一个字的高速缓存的计算机上的4个整数(整数= 4字节=一个字)的数组。 A starts in address 0 and B starts in address 16 Assume the cache is initially empty. A从地址0开始,B从地址16开始假定缓存最初是空的。

A user run the following code: 用户运行以下代码:

for (i=0; i<2; i++) 
{
    for (j=0; j<4; j++) {
         read A[j]
         read B[j]
    }
}

I'm asked to answer&explain how many cache misses would you expect at the following cases: 我被要求回答并解释在以下情况下您期望多少个高速缓存未命中:

a) The cache uses direct mapping. a)缓存使用直接映射。

b) The cache uses 2-Way Set Associativity b)缓存使用2-Way Set关联性

What does it mean that 'A starts in address 0 and B starts in address 16'? “ A从地址0开始,B从地址16开始”是什么意思? don't sure how to access this question 不确定如何访问此问题

It's saying: 这是说:

&A[0] == 0
&B[0] == 16

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM