所以我有一个问题:
cache access time: 5ns
penalty = 200ns
hit rate = 0.95 for instruction cache
hit rate = 0.90 for data cache
1k Instructions
Total memory access time = 23,750ns
在程序中查找记忆指令百分比 我的方法
instructions found in cache: 950 * 5 = 4750ns
instructions not found in cache = 50*(200+5) = 10,250
Total time = 4750 + 10,250 = 15,000
Percentage = 15,000 / 23,750 = 0.63 so 63%
然而,这似乎不正确,因为对于第二个问题,它询问,如果数据缓存命中率提高到95%,那么总内存访问时间是多少。这意味着数据缓存的总访问时间与指令缓存相同(因为它们现在都是95%)因此它将是15,000。 那么总内存访问时间将是= 15,000 + 15,000 = 30,000,这超过了原始访问时间。这没有意义,因为如果我们提高命中率,总访问时间不应该下降吗?
答案 0 :(得分:0)
我认为这是针对Kaushik Patra的SJSU CS147课程作业。
Total_access_time = instruction_access_time + data_access_time instruction_access_time =(1000 * 5ns)+(0.05 * 1000 * 200ns)= 15000ns 所以我们得到data_access_time = 8750ns,我们需要弄清楚data_access_time中使用的内存指令的百分比
data_access_time =(memory_fraction * 1000 * 5ns)+(memory_fraction * 0.10 * 1000 * 200ns) 在一些代数之后你应该得到memory_fraction是0.35