当前位置:网站首页>[embedded foundation] memory (cache, ram, ROM, flash)
[embedded foundation] memory (cache, ram, ROM, flash)
2022-06-28 01:39:00 【White embedded】
1. Preface
Recently I was watching a chip from cypress CYW8019 Specifications , There are several key words in memory ( As shown in the top right of the figure below ), This article will talk about their meaning and function .
2. Cache
Cache It is integrated. CPU Internal cache . In general , Its access speed is almost comparable to CPU.CPU During a visit to Cache There's hardly any time to waste , however , The increase in speed is at the cost of capacity , Very small capacity .
Why Cache ? When CPU When accessing memory , The memory it wants to access is not immediately accessible , But there is a “WaitState” The process of . that , Put commonly used data in Cache in ,CPU Visit directly when visiting Cache That's it , No need to spend time accessing memory .
When reading memory ,CPU First reading Cache, See if you have the data you want “ copy ”, If so, read it directly , If not, you are reading the memory . When writing memory ,CPU Write the data in Cache in ,Cache Update to memory when full , At the same time to empty Cache.
3. RAM
RAM(Random Access Memory) Ram . Content is freely accessible on demand , And the access speed is independent of the location of the storage unit , Power loss and data loss .
Depending on the information stored , Divided into static stacked memory (Static RAM,SRAM) And dynamic random access memory (Danamic RAM,DRAM).
SRAM The data can be saved without refreshing the circuit ;DRAM Every once in a while , Need to refresh and charge once , Otherwise, the internal data will disappear .
SRAM It has high performance , But the integration is low , Of the same capacity DRAM Memory can be designed to be smaller , and SRAM It takes a lot of volume , And high power consumption .
SRAM Very fast , It's the fastest storage device to read and write at present , And there is no need to refresh . The disadvantage is that the price is relatively expensive , So it's only used in very demanding places , such as CPU First level cache of , Second level cache .
DRAM The time to keep the data is short , It's faster than SRAM slow , But still better than any ROM Be quick , Compared with the price SRAM It's a lot cheaper , Computer memory is DRAM Of .
SDRAM(Synchronous DRAM) Synchronous dynamic random access memory . Synchronization means that the work needs to synchronize the clock , Internal command sending and data transmission are based on it ; Dynamic means that the storage array needs constant refresh to ensure that the data is not lost ; Random means that the data is not stored in a linear way , It is free to specify the address for data reading .
DDR RAM(Date-Rate RAM) Also known as DDR SDRAM, This improved RAM and SDRAM It's basically the same , The difference is that it can read data twice in one clock , This doubles the transmission speed . This is the most used memory in computers at present , And it has a cost advantage .
The other is PSAM,Pseudo static random access memory, It refers to pseudo-static random access memory . Internal memory particles follow SDRAM The particles are similar , But the external interface is similar to SRAM be similar , Unwanted SDRAM That responsible controller and refresh mechanism ,PSRAM Interface with SRAM The interface is the same .
4. ROM
ROM(Read-Only Memory) read-only memory , It is a solid-state semiconductor memory that can only read out the data stored in advance , Power down without losing data .ROM There are many kinds ,PROM It's programmable ROM,PROM and EPROM( Erasable programmable ROM) The difference between the two is :PROM It's disposable , That is, after the software is burned , You can't change it , This is an early product , Now it's impossible to use ; and EPROM It is to erase the original program by ultraviolet radiation , It's a universal memory .
There is another kind. EEPROM By electronic erasure , The price is very high , It takes a long time to write . Mobile software is usually placed in EEPROM in .
5. Falsh
Flash memory , It's a kind of long life non-volatile ( Do not lose data in case of power failure ) The memory of , Data deletion is not in single bytes but in fixed blocks ( Be careful :NOR Flash Store... For bytes ), Blocks are generally 256K To 20MB.
Flash There are two main types :NOR Flash and NAND Flash.
Mission Flash The write operation of the device can only be carried out in the empty or erased cell , So most of the time , An erase operation must be performed before a write operation .NAND Flash Erasure is very simple , and NOR Flash It is required to write all bits in the target block before erasing 1.
5.1 NOR Flash
NOR Flash Read and we're familiar with SDRAM The reading of is the same , Users can directly run the load on NOR Flash Code inside , This can reduce SRAM Capacity to save costs .
It's usually used for small capacity NOR Flash, Because it reads fast , It is mostly used to store important information such as operating system .
5.2 NAND Flash
NAND Flash There's no random access to memory , It is read one at a time , It's usually a read 512 Bytes , Using this technology Flash It's cheaper , stay NAND Flash Cannot run code on .
Generally, large capacity is used NAND Flash.
5.3 NOR Flash and NAND Flash Performance comparison
- NOR The device is erased with 64 ~ 128KB It's done in blocks , Perform a write / The erasing time is 5 second ;NAND The device is based on 8 ~ 32KB It's done in blocks , To do the same thing, at most 4ms.
- NOR Reading speed ratio of NAND A little faster .
- NOR Programs can be executed on-chip .
- NAND Is faster than NOR Much faster .
- Most write operations require erasing the ,NOR It is required to write all bits in the target block as before erasing 1.
- NAND The erasing unit is smaller , The corresponding erase circuit is less .
5.4 NOR Flash and NAND Flash Interface comparison
- NOR Flash with SRAM Interface , There are enough address pins to address , You can easily access every byte inside it .
- NAND Flash Use complex I/O To access data serially , Methods may vary from product to product or vendor to vendor .8 Two pins are used to transmit control 、 Address and data information .
6. summary
As a qualified embedded Engineer , The concept and application scenarios of memory are the knowledge points that must be understood . Understand the concept of memory , It is more convenient to be familiar with the architecture of the whole system .
边栏推荐
- Arrays. Aslist() pit
- What problems should be evaluated before implementing MES management system
- golang 猴子吃桃子,求第一天桃子的数量
- Réseau neuronal pour la solution détaillée Multi - diagrammes de fondation zéro
- How to build an e-commerce platform at low cost
- 力扣今日题-522. 最长特殊序列
- Golang monkeys eat peaches and ask for the number of peaches on the first day
- The research group of Xuyong and duanwenhui of Tsinghua University has developed an efficient and accurate first principles electronic structure deep learning method and program
- Maimai hot post: Why are big factories keen on making wheels?
- 去哪儿网(Qunar) DevOps 实践分享
猜你喜欢
Evaluation - rank sum ratio comprehensive evaluation
如何在您的Shopify商店中添加实时聊天功能?
Cloud assisted privacy collection intersection (server assisted psi) protocol introduction: Learning
Squid proxy server (Web cache layer for cache acceleration)
TIA botu_ Concrete method of making analog input and output Global Library Based on SCL language
Maimai hot post: Why are big factories keen on making wheels?
DeepMind | 通过去噪来进行分子性质预测的预训练
评价——灰色关联分析
SQL Server 2016 detailed installation tutorial (with registration code and resources)
数据库查询优化:主从读写分离及常见问题
随机推荐
万字长文看懂商业智能(BI)|推荐收藏
Arrays.asList()坑
Is it safe to open a stock account online now? Select a listed securities firm, and the fastest time to open an account is 8 minutes
Evaluation - rank sum ratio comprehensive evaluation
从小到大为何一谈学习就愁眉苦脸
Which securities speculation account opening commission is the cheapest and safest
【牛客讨论区】第四章:Redis
Summary of attack methods of attack team
【MySQL】-【函数】
awk注意的几个问题
Solve storage problems? WMS warehouse management system solution
现在网上开股票账户安全吗?选择上市券商,最快8分钟开户成功
What is the application scope and function of the conductive slip ring of single crystal furnace
国外LEAD赚钱的一些习惯
Ten thousand words long article understanding business intelligence (BI) | recommended collection
I/O限制进程与CPU限制进程
Interview guide for data person | prepare these points to be prepared!
Proe/creo product structure design - continuous research
Transformer论文逐段精读
Want to open an account to buy stock, is it safe to open an account on the Internet?