当前位置:网站首页>Mapping mode of cache
Mapping mode of cache
2022-06-25 09:00:00 【Picchu moving forward】
The hierarchy of the storage system
To address capacity , Speed , The contradiction between prices , Put all kinds of different storage capacity , Different access speeds , Memory at different prices , Organized according to a certain architecture , The stored programs and data are distributed in each memory according to the hierarchy , Form a multi tiered storage system 
- view in its entirety ,Cache—— The access speed of main memory level is close to Cache Access speed of , But the capacity is close to the main memory
- It solves the contradiction between high-speed and low-cost
- This layer is completely implemented by hardware , Transparent to users

How cache memory works
The principle of program locality : Time locality and space locality
The locality principle of program access
The principle of time locality : Data or instructions currently in use will be used in the near future , Then the instruction or data currently in use , We should put Cache, When used in the future , Directly from Cache Remove from
The principle of spatial locality : Data or instructions currently in use in the near future , Adjacent instructions or data may be used , We put the data or instructions currently in use from memory into Cache, At the same time, you also need to put adjacent instructions and data into Cache in .
Cache Address mapping ( image ) The way
- Address mapping : Apply a function to map the main memory address to Cache Address , It is called address mapping
- All associative mapping
- Direct mapping
- Group associative mapping
For the convenience of follow-up study , Let's assume first
All associative mapping
CPU and Cache Interact , however Cache The contents are stored from the master
The lower five bits of the address indicate the address within the block
The upper four digits of the address indicate which block , That is, the block number , stay 0 Block ,1 Block …
Cache Inside tag( Mark ) The table name is the block number , That is, record the block number of the corresponding main memory , Occupy 4 position ,2^4=16
If we want to compare Cache Whether to hit , Because the full connection is arbitrary , High utilization , But we need to compare the hits line by line , Low efficiency
Direct mapping






Group associative mapping





边栏推荐
- Oracle-单行函数大全
- 获取扫码的客户端是微信还是支付宝
- 声纹技术(七):声纹技术的未来
- Swiperefreshlayout+recyclerview failed to pull down troubleshooting
- 通过客户经理的开户二维码开股票账户安全吗?还是去证券公司开户安全?
- matplotlib matplotlib中决策边界绘制函数plot_decision_boundary和plt.contourf函数详解
- Explanation of assertions in JMeter
- Chinese solution cannot be entered after webgl is published
- Webgl Google prompt memory out of bounds (runtimeerror:memory access out of bounds, Firefox prompt index out of bounds)
- 《乔布斯传》英文原著重点词汇笔记(二)【 chapter one】
猜你喜欢

城链科技平台,正在实现真正意义上的价值互联网重构!

matplotlib matplotlib中决策边界绘制函数plot_decision_boundary和plt.contourf函数详解

Nodejs using the express framework demo

Exchange: manage calendar permissions

C#启动程序传递参数丢失双引号,如何解决?

How to become a software testing expert? From 3K to 17k a month, what have I done?

sklearn PolynomialFeatures的具体用法
![[opencv] - input and output XML and yaml files](/img/4e/7944e205c71246d0b0e3747eefca37.png)
[opencv] - input and output XML and yaml files

compiling stm32f4xx_ it. c... “.\Objects\BH-F407.axf“ - 42 Error(s), 1 Warning(s).

Close a thread
随机推荐
Explanation of assertions in JMeter
3 big questions! Redis cache exceptions and handling scheme summary
How to implement a system call
How to choose an account opening broker? Is it safe to open an account online?
C language: bubble sort
socket编程——poll模型
关掉一个线程
106. 简易聊天室9:使用 Socket 传递音频
Is it safe for Huatai Securities to open a stock account on it?
Easyplayer streaming media player plays HLS video. Technical optimization of slow starting speed
Nodejs using the express framework demo
[opencv] - input and output XML and yaml files
IC研发常用英文术语缩写
五、项目实战---识别人和马
获取扫码的客户端是微信还是支付宝
Unity--configurable joint -- a simple tutorial to get you started with configurable joints
View all listening events on the current page by browser
OpenFOAM:底层
In Section 5 of bramble pie project practice, Nokia 5110 LCD is used to display Hello World
对常用I/O模型进行比较说明









