[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
块内地址:是指你要访问这个块内的哪个字节
主存按照cache的容量先来分区,然后每个区的内部按照与cache相同的规则来分组,然后每个组的内部跟按照与cache相同的规则来分块。
<>练习
【例一】
【例二】
根据题目给的条件进行的分析过程:
组相联中,查目录表的目的是我们确定了主存的某区某组某块装到了cache的某组里去了,但是装到哪一块去了,我们并不知道,需要查目录表才能得知。所以最后
cache中对应的地址是主存地址中的组号+目录表中得到的cache组内块号+主存地址的块内地址进行拼接
【例三】
如果今后遇见需要算目录表存储容量的题目,记住:上题中目录表高位的行号(对应cache的块号)是不需要存储的(例如:组相联中组号和cache组内块号都不需要算进容量里),因为cache有多少行(块)目录表就有对应的几行(块),以例三为例,左下方的目录表的容量为:(13bit+2bit+1bit)*行数
其中,13bit为主存区号的位数,2bit为主存组内块号的位数,1bit为有效位,行数就是cache的块数
当然,如果题目中提到了写回法或者替换策略,则在计算目录表的容量时,每行还需要考虑修改位数或者计数器的位数。有效位是必须要考虑的!!!然鹅,上面例题为了更加理解地址映射和地址变换的过程,均简化了目录表,也就是均未提及~~