当前位置:网站首页>Comparison between virtual memory and cache
Comparison between virtual memory and cache
2022-07-27 23:48:00 【Hua Weiyun】
The execution of a virtual memory program
CPU When using renewal , Find out the corresponding relationship between the virtual address and the real address by the auxiliary memory hardware , And judge whether the storage unit corresponding to this virtual address has been loaded into main memory . If already in main memory , Through address translation ,CPU The actual unit indicated by the main memory can be accessed directly ; If not in main memory , The page or paragraph containing this word is transferred to main memory and then transferred from CPU visit . If main memory is full , Replace a page or a section of main memory with a replacement algorithm .
Watch it
Generally, it adopts full connection or group connection , Every TLB The item is added by the page table item content TLB The tag field consists of ,TLB The tag is used to indicate which virtual page number in the song page table of this table item corresponds to the page table item , therefore TLB The marked content represents the virtual page number corresponding to the page table item in the fully associative mode ; In the group association mode, it represents the high-order part of the corresponding virtual page number , The lower part of the virtual page number is used to select TLB Group index of the Group .
Virtual memory and Cache Comparison
Common ground :
1) It is to improve the system performance , Both have capacity 、 Speed 、 The gradient of price ;
2) Divide the data into small information blocks , And as a basic transmission unit , The information block of virtual memory system is larger ;
3) All have address mappings 、 Replacement algorithm 、 Update strategy and other issues ;
4) According to the locality principle of the program , Place active data in relatively high-speed components .
Difference :
1)Cache It mainly solves the problem of system speed , Virtual memory in order to solve the main memory capacity ;
2)Cache Implemented by hardware , It's hardware memory , Transparent to all programmers ; Virtual memory consists of OS And hardware , It's a logical memory , Opaque to system programmers , Transparent to application programmers ;
3) When the virtual memory system misses, it will have a greater impact on the system performance ;
4)CPU And Cache And main memory have established direct access , Auxiliary storage and CPU No direct access
Characteristics and application of common instruction addressing methods :
1) Address immediately : It is convenient to obtain operands , It is usually used to assign an initial value to a register .
2) Direct addressing : Relative to immediate addressing , The instruction length is shortened .
3) Indirect addressing : Expanded addressing range , Easy to program , Easy to complete subroutine return .
4) Register addressing : The instruction word is short , Instruction execution speed is fast .
5) Register indirection : Expanded addressing range .
6) Base addressing : The addressing range is expanded , Suitable for multi-channel programming , Often used to allocate storage space for programs or data .
7) Addressing : Mainly used to deal with array problems , It is suitable for compiling cycle program .
8) Relative addressing : Used to control the execution sequence of the program 、 Transfer, etc .
CISC And RISC characteristic
CISC The main characteristics of :
1) The instruction system is complex and huge , The number of instructions is generally greater than 200+;
2) The length of the instruction is not fixed , Multiple instruction formats , Multiple addressing modes ;
3) There are no restrictions on the instructions to release the village ;
4) The frequency of use of various instructions varies greatly ;
5) The execution time of various instructions varies greatly , Most instructions require multiple clock cycles to complete ;
6) Most controllers are controlled by microprogram , Some instructions are very complex , Hard wired control ;
7) It is difficult to generate efficient object code programs with optimized compilation .
RISC The main characteristics of :
1) Select the most frequently used simple instructions , The function of complex instructions is realized by the combination of simple instructions ;
2) The instruction length is fixed , There are few types of instruction formats , There are few kinds of addressing modes ;
3) Only Load/Store Instruction access , The operations of other instructions are carried out between registers ;
4)CPU The number of general-purpose registers in is quite large ;
5)RISC Using instruction pipeline technology , Most instructions are completed in one clock cycle ;
6) Mainly hard wiring control , No or less microprogram control ;
7) Pay attention to compilation optimization , Reduce program execution time .
边栏推荐
猜你喜欢

Normality of confidence interval

主数据管理理论与实践

NDK series (6): let's talk about the way and time to register JNI functions

基于原生js实现今日新闻网站
![[C language] address book (dynamic version)](/img/29/3df19c187bee31ee4671e12d7cc7ff.jpg)
[C language] address book (dynamic version)
![[signal processing] weak signal detection in communication system based on the characteristics of high-order statistics with matlab code](/img/a7/8f0d929457d285adc8020c7f5d33ea.png)
[signal processing] weak signal detection in communication system based on the characteristics of high-order statistics with matlab code

Interviewer: let's talk about the specific process of network data transmission

Reinforcement learning - pytorch realizes advantage actor critical (A2C)

My annual salary is 1million, and I don't have clothes more than 100 yuan all over my body: saving money is the top self-discipline

西门子PLC能否实时无线采集多处从站模拟量数据?
随机推荐
2019年全球十大半导体厂商:英特尔重回第一,苹果逆势大涨
Elk log analysis system installation and deployment
携手长江存储,江波龙推出全球最小扩展卡
字符流学习14.3
ZCMU--1720: 死亡如风,我要装逼
Arm32进行远程调试
CPU的控制方式
怎么使用C# Winform实现复制文件显示进度
JUC工具包学习
Which one is better to request to merge -- three skills of interface request merging, and the performance directly explodes the table
7.6万人停工!东芝宣布关闭日本所有工厂
Flutter pull_ to_ refresh-1.6.0/lib/src/internals/slivers. dart:164:13: Error: Method not found: ‘descr
C#委托用法--控制台项目,通过委托实现事件
Redis 哈希Hash底层数据结构
The share price soared 180.46%! Shanghai silicon industry, the leader of domestic large silicon wafers, is listed: the cumulative net profit in recent four years is less than 60million
华为鸿蒙 3 正式发布,这个安全功能解决了一大痛点
Redis的分布式锁
Zabbix4.0 uses SNMP agent to monitor vcenter6.5
数据中台的那些“经验与陷阱”
四次挥手的Socket交互流程