关于cache

dxy2007139 2013-01-02 02:05:05
29. When the following code fragment is executed on a computer with 32-bit integers and a fully-associative cache with 32-byte cache lines, how many bytes of the array a will be fetched into the cache from main memory?
int a[100];
for (i = 0; i < 17; sum += a[i], i++);
(a) at most 96. (b) exactly 3II. (c) exactly 17. (d) at most 68.
30. Your computer has 32-bit integers and a direct cache containing 128 32-byte cache lines. In the following code fragment, the compiler allocates a at address 0x800000 and b at address 0x801000. Before the execution of the code fragment, the arrays a and b have never been used, so they are not in the cache. What is the minimum number of bytes from each of the arrays a and b that could be fetched into the cache from main memory, during the execution of the code?
int b[1024];
int a[1024];
for (i = 0; i < 17; sum += a[i] + b[i], i++);
(a) 1088 (b) 96 (c) 68 (d) 17
...全文
143 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
gooogleman 2013-01-03
  • 打赏
  • 举报
回复
引用 2 楼 dxy2007139 的回复:
引用 1 楼 gooogleman 的回复:?这个不是ARM里面的cache 吧? 就是普通的存储器层次结构的高速缓存
那和ARM用的一样,没认真看你的那么多公式,以前只是了解过原理。
dxy2007139 2013-01-03
  • 打赏
  • 举报
回复
引用 1 楼 gooogleman 的回复:
?这个不是ARM里面的cache 吧?
就是普通的存储器层次结构的高速缓存
gooogleman 2013-01-02
  • 打赏
  • 举报
回复
?这个不是ARM里面的cache 吧?

6,125

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 硬件设计
社区管理员
  • 硬件设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧