当前位置:网站首页>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





边栏推荐
- In Section 5 of bramble pie project practice, Nokia 5110 LCD is used to display Hello World
- [515. find the maximum value in each tree row]
- 【期末复习笔记】数字逻辑
- 打新债安全性有多高啊
- atguigu----18-组件
- sklearn 高维数据集制作make_circles 和 make_moons
- Is it safe to open a stock account through the account opening QR code of the account manager? Or is it safe to open an account in a securities company?
- City Chain technology platform, really Realizing value Internet reconstruction!
- Sharepoint:sharepoint server 2013 and adrms Integration Guide
- How to design test cases
猜你喜欢

RMB 3000 | record "tbtools" video, make a friend and get a cash prize!

微服务调用组件Ribbon底层调用流程分析
![[opencv] - input and output XML and yaml files](/img/4e/7944e205c71246d0b0e3747eefca37.png)
[opencv] - input and output XML and yaml files
![[515. find the maximum value in each tree row]](/img/0d/7ae494a5b3df3917ab95ebf61a1c96.png)
[515. find the maximum value in each tree row]

A 35 year old Tencent employee was laid off and sighed: a suite in Beijing, with a deposit of more than 7 million, was anxious about unemployment

紧急行政中止令下达 Juul暂时可以继续在美国销售电子烟产品

【OpenCV】—离散傅里叶变换

View all listening events on the current page by browser

City Chain technology platform, really Realizing value Internet reconstruction!

matplotlib matplotlib中决策边界绘制函数plot_decision_boundary和plt.contourf函数详解
随机推荐
买股票通过客户经理的开户二维码开户资金是否安全?想开户炒股
How to solve the 10061 error of MySQL in Linux
某次比赛wp
C # startup program loses double quotation marks for parameters passed. How to solve it?
annotation lib 和 processor lib如何引用
LVS-DR模式多网段案例
Notes on key vocabulary of the original English work biography of jobs (I) [introduction]
【OpenCV】—离散傅里叶变换
106. simple chat room 9: use socket to transfer audio
Oracle one line function Encyclopedia
[opencv] - Discrete Fourier transform
CSV parameterization in JMeter
Summary of hardfault problem in RTOS multithreading
Unknown table 'column of MySQL_ STATISTICS‘ in information_ schema (1109)
五、项目实战---识别人和马
Notes on key words in the original English work biography of jobs (III) [chapter one]
The first techo day Tencent technology open day, 628 waiting for you!
compiling stm32f4xx_ it. c... “.\Objects\BH-F407.axf“ - 42 Error(s), 1 Warning(s).
证券开户风险大吗,安全靠谱吗?
Notes on key words in the original English work biography of jobs (VI) [chapter three]









