博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
cache
阅读量:7287 次
发布时间:2019-06-30

本文共 862 字,大约阅读时间需要 2 分钟。

When the CPU is instructed by a load instruction to read a word from ad-

dress A of main memory, it sends the address A to the cache. If the cache is holding
a copy of the word at address A, it sends the word immediately back to the CPU

So how does the cache know whether it contains a copy of the word at address A?

here is some cache parameters you need to know 

the way how the address match which part of the cache

1)先从cache了解有(S,E,B)判断set有多少位,assoc有多少位,block有多少位

2)假设block有b位,则有连续的2^n个位置都是属于这个set,假如cache为空,我们现在要地址0的内容,cpu先向cache发送地址0,cache未能命中,则向内存中发出读地址0命令,将地址0的内容写入set0,在这个读内存的过程中,cache还连带的把地址1、2、3

的内容读入到cache中。假如下一次cpu需要地址2的内容就可以直接从cache中读取。

3)那assoc有什么用呢!假如cpu需要地址8的内容,而且地址8和地址0都是用到set0。如果E只有0位那么就先要吧set0原先的内容踢掉,再去加载地址8的内容,如果E有1位,cpu如果需要地址8的内容就可以直接把地址8的内容加载到line2中,同样的在加载地址8时,cache顺便的把地址9、a、b的内容加载到cache中

 

转载于:https://www.cnblogs.com/been/p/3917097.html

你可能感兴趣的文章
IGP-LAB-RIP-3
查看>>
会说话的vc编译器(一)
查看>>
Exchange 2013部署系列之(一)系统要求
查看>>
利用itext导出word表格,处理图片
查看>>
我的友情链接
查看>>
数据结构(一)循环链表 约瑟夫环
查看>>
fastDFS+java api + sping mvc +JPA+Hibernate
查看>>
解读关于HTML5的六个传说
查看>>
Solaris ZONE
查看>>
Android APP应用开发视频教程
查看>>
unrecognized selector sent to class 0x91cde0
查看>>
python学习笔记-Day10--(进程\线程\协程)
查看>>
linux学习第4天(自习)
查看>>
持续更新:Centos常用方便的命令与技巧集合
查看>>
ubuntu 终端vi和gedit中文乱码解决方案
查看>>
Linux下无连接的套接字通信C实现
查看>>
ipv6
查看>>
CCNA入门---交换机端口安全的四种行为
查看>>
获取当前时间的时分秒
查看>>
mysql5.6源码拷贝不编译安装
查看>>