ROM, RAM Intensive

ROM ( Read Only Memory) and RAM ( Random Access Memory ) refer to both semiconductor memories. ROM can still retain data when the system is powered off, while RAM usually loses data after a power failure. A typical RAM is the computer's RAM.


There are many kinds of ROM. PROM is programmable ROM. The difference between it and EPROM (erasable programmable ROM) is that PROM is one-time, that is, after the software is poured in, it cannot be modified. This is an early product. , is no longer used, and EPROM is a general-purpose memory that erases the original program through ultraviolet light. Another type of EEPROM is electronically erased, which is expensive, takes a long time to write, and is slow to write.


For example, the mobile phone software is generally stored in the EEPROM. When we make a call, some of the last dialed numbers are temporarily stored in the SRAM, instead of writing the call record immediately (the call record is saved in the EEPROM), because there is a very important work (call) at that time. ) to do, if writing, the long wait is unbearable for the user.


There are two types of RAM , one is called static RAM (Static RAM/SRAM). SRAM is very fast and is currently the fastest storage device for reading and writing. It is also very expensive, so it is only used in demanding places. For example, the CPU's first-level buffer and second-level buffer.


The other is called dynamic RAM (Dynamic RAM/DRAM). DRAM retains data for a short time and is slower than SRAM, but it is still faster than any ROM, but DRAM is cheaper than SRAM in terms of price. Many, computer memory is DRAM.


There are many kinds of DRAM , the common ones are FPRAM/FastPage, EDORAM, SDRAM, DDR RAM, RDRAM, SGRAM and WRAM, etc. Here is one of the DDR RAMs.


DDR RAM (Date-Rate RAM) is also called DDR SDRAM. This improved RAM is basically the same as SDRAM, except that it can read and write data twice in one clock, which doubles the data transfer speed. .


This is the most used memory in computers today, and it has a cost advantage over Intel's other memory standard, Rambus DRAM. On many high-end graphics cards, high-speed DDR RAM is also equipped to increase bandwidth, which can greatly improve the pixel rendering capability of 3D accelerator cards.

A brief analysis of the working principle of memory


Memory is used to store data and programs that are currently in use (that is, in execution). The computer memory we usually refer to refers to dynamic memory (ie DRAM). The so-called "dynamic" in dynamic memory refers to When we write data into DRAM, after a period of time, the data will be lost, so an additional circuit is required to perform the memory refresh operation.


The specific working process is as follows: whether a DRAM memory cell stores 0 or 1 depends on whether the capacitor has charge, with charge representing 1, and no charge representing 0. But over time, the capacitor representing 1 will discharge, and the capacitor representing 0 will absorb charge, which is the reason for data loss; 


The refresh operation regularly checks the capacitor. If the power is greater than 1/2 of the full power, it is considered to represent 1, and the capacitor is fully charged; if the power is less than 1/2, it is considered to represent 0, and the capacitor is discharged. to maintain data continuity.


Comparison of NAND Flash and NOR Flash


Commonly used Flash types are: NOR Flash and NAND Flash. NOR Flash was invented by Intel Corporation in 1988 to replace the EPROM and EEPROM that dominated the market at that time. NANDFlash was invented by Toshiba in 1989. The main differences between the two are shown in the table below.


                       


NOR

NAND

capacity

1~32MB

16~512MB

XIP

Yes

No

performance

erase

very slow (5s)

Fast (3ms)

Write

slow

quick

read

quick

quick

reliability

Relatively high, the proportion of bit inversion is less than 10% of NAND Flash

Relatively low: Bit inversion is more common, and verification measures must be taken, such as " 1-4 bit EDC/ECC "; there must be bad block management measures

erasable times

10000~100000

100000~1000000

生命周期

低于NAND Flash的10%

是NOR Flash的10倍以上

接口

与RAM接口相同

I/O接口

访问方法

随机访问

顺序访问

易用性

容易

复杂

主要用途

常用于保存代码和关键数据

用于保存数据

价格

 NOR/NAND Flash的差别


NOR Flash支持XIP,即代码可以直接在NOR Flash上执行,无需拷贝到内存中。这是由于NOR Flash的接口与RAM完全相同,可以随机访问任意地址的数据。在NOR Flash上进行读操作的效率非常高,但是擦除和写操作的效率很低;另外,NOR Flash的容量一般比较小。


NAND Flash进行擦除和写操作的效率更高,并且容量更大。一般而言,NOR Flash用于存储程序,NAND Flash用于存储数据。基于NAND Flash的设备通常也要搭配NOR Flash以存储程序。


Flash存储器件由擦除单元(也称为块)组成,当要写某个块时,需要确保这个块已经被擦除。NOR Flash的块大小范围为64KB~128KB;NAND Flash的块大小范围为8KB~64KB,擦/写一个NOR Flash块需4S,而擦/写一个NAND Flash块仅需2ms。


NOR Flash的块太大,不仅增加了擦写时间,对于给定的写操作,NOR Flash也需要更多的擦除操作——特别是小文件,比如一个文件只有1KB,但是为了保存它却需要擦除大小为64KB~128KB的NOR Flash块。


NOR Flash的接口与RAM完全相同,可以随意访问任意地址的数据。而NAND Flash的接口仅仅包含几个I/O引脚,需要串行地访问。NAND Flash一般以512字节为单位进行读写。这使得NOR Flash适合于运行程序,而NAND Flash更适合于存储数据。


容量相同的情况下,NAND Flash的体积更小,对于空间有严格要求的系统,NAND Flash可以节省更多空间。市场上NOR Flash的容量通常为1~4MB(也有32MB的NOR Flash),NANDFlash的容量为8~512MB。容量的差别也使得NOR Flash多用于存储程序,NAND Flash多用于存储数据。


对于Flash存储器件的可靠性需要考虑3点:位反转、坏块和可擦除次数。所有Flash器件都遭遇位反转的问题:由于FLASH固有的电器特性,在读写数据过程中,偶然会产生一位或几位数据错误——这种概率很低,而NAND Flash出现的概率远大于NOR Flash。当位反转发生在关键的代码、数据上时,有可能导致系统崩溃。


当仅仅是报告位反转,重新读取即可;如果确实发生了位反转,则必须有相应的错误检测/恢复措施。在NAND Flash上发生位反转的概率更高,推荐使用EDC/ECC进行错误检测和恢复。


NAND Flash上面会有坏块随机分布,在使用前需要将坏块扫描出来,确保不再使用它们,否则会使产品含有严重的故障。NAND Flash每块的可擦除次数通常在100000次左右,是NOR Flash的10倍。另外,因为NAND Flash的块大小通常是NOR Flash的1/8,所以NAND Flash的寿命远远超过NOR Flash。


linux对NOR、NAND Flash的软件支持都很成熟。在NOR Flash上常用jffs2文件系统,而在NAND Flash上常用yaffs文件系统。在更底层,有MTD驱动程序实现对它们的读、写、擦除操作,它也实现了EDC/ECC校验。

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325430039&siteId=291194637
RAM