当前位置:网站首页>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 .
边栏推荐
- urllib.error. URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: un
- 为什么 Redis 集群要使用反向代理? 看这篇就明白了
- 基于mediapipe的姿态识别和简单行为识别
- 【C语言】通讯录(动态版本)
- Smartrefresh nested multiple recycleview sliding conflicts and incomplete layout display
- 字符流学习14.3
- Lua基础语法学习
- File & recursion 14.1
- 数据中台的那些“经验与陷阱”
- Zabbix4.0 uses SNMP agent to monitor vcenter6.5
猜你喜欢

2022夏暑假每日一题(五)

消息队列常见的几种使用场景介绍

置信区间之正态
Software test function test full set of common interview questions [function test] interview summary 4-2

Calling dht11/22 temperature and humidity sensor in Proteus simulation Arduino

真的很难理解?RecyclerView 缓存机制到底是几级缓存?

给网站套上Cloudflare(以腾讯云为例)

TOGAF10标准读书会首场活动圆满举办,精彩时刻回顾!

详解分布式系统的幂等

Master data management theory and Practice
随机推荐
加速IGBT国产化!比亚迪半导体将独立上市,市值或达300亿元!
File & recursion 14.1
技术认证 | 图扑软件携手华为云再创合作共赢新局面
使用灰度滤镜
Calling dht11/22 temperature and humidity sensor in Proteus simulation Arduino
C#委托用法--控制台项目,通过委托实现事件
主数据管理理论与实践
消息队列常见的几种使用场景介绍
总投资600亿!富士康半导体高端封测项目正式落户青岛
低代码开发前景如何,大家都真的看好低代码开发吗?
Flutter pull_to_refresh-1.6.0/lib/src/internals/slivers.dart:164:13: Error: Method not found: ‘descr
File&递归14.1
NB-IoT产业的现状与未来:跨过1亿出货门槛,奔向5G大连接!
Error:svn: E155010: ‘/Users/.../Desktop/wrokspace/xxx‘ is scheduled for addition, but is missing
基于mediapipe的姿态识别和简单行为识别
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: un
台积电3nm细节曝光:晶体管密度高达2.5亿个/mm²,性能及能效大幅提升
西门子PLC能否实时无线采集多处从站模拟量数据?
15million per day! BYD masks won a US $1billion order in California
urllib.error. URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: un