机器上物理地址的宽度为40位。 512 KB 8路集关联高速缓存中的标记字段的宽度为____________位
(A) 24
(B) 20
(C) 30
(D) 40答案: (A)
说明:一种简单的方法是我们知道物理地址为40个字节
We know cache size = no.of.sets*
lines-per-set*
block-size
Let us assume no of sets = 2^x
And block size= 2^y
So applying it in formula.
2^19 = 2^x + 8 + 2^y;
So x+y = 16
Now we know that to address block size and
set number we need 16 bits so remaining bits
must be for tag
i.e., 40 - 16 = 24
The answer is 24 bits
如果问题扩展而要求比较器的大小是多少,我们需要的是24位比较器。
以上说明由Sumanth Sunny提供
备用说明:
Physical Address Bits = T(Tag Bits) + S(Set Bits) + O(Offset Bits) = 40 bits (given)
Set = 8 (given)
Size of cache = 512 KB (given)
Size of lines = 512 / 8 = 64 KB
So, O = 64/8 = 8 bits
Now, S + O = 8 + 8 = 16 bits
Hence, T = 40 - 16 = 24 bits
This explanation is contributed by Mohit Gupta.
Refer the following links for more understanding in the above topic:
Cache Memory
Cache Organization | Introduction
这个问题的测验