【发布时间】:2017-06-10 15:10:08
【问题描述】:
【问题讨论】:
-
位索引是一样的,当然,最终值取决于访问的地址。
标签: caching assembly mips processor
【问题讨论】:
标签: caching assembly mips processor
缓存索引(或有时称为set bits)是(块地址)模块(缓存中的块数)。
如果缓存中的条目数是 2 的幂,那么模可以是 只需使用低阶 log2 (以块为单位的缓存大小)位计算 地址。
在你的情况下直接映射缓存。
4 块缓存使用块的两个最低位 (4 = 2^2 ) 地址。
(block address) cache index
0000 mod 4 = 00
1000 mod 4 = 00
0000 mod 4 = 00
0110 mod 4 = 10
1000 mod 4 = 00
这里有一些方程和参数,为了解决一般的缓存问题,很高兴知道。
要知道的参数
C = cache capacity
b = block size
B = number of blocks
N = degree of associativity
S = number of set
tag_bits
set_bits (also called index)
byte_offset
v = valid bits
要知道的方程式
B = C/b
S = B/N
b = 2^(byte_offset)
S = 2^(set_bits)
内存地址
|___tag________|____set___|___byte offset_|
【讨论】: