RAM、ROM、Flash 存储器硬件

1. 随机读写存储器RAM

  随机存取存储器(Random Access Memory, RAM),有称为“随机存储器”,是与CPU直接交换数据的内部存储器,也叫主存。 

  存储单元的内容可按需随意取出或存入,且存取的速度与存储单元的位置无关的存储器。这种存储器在断电时将丢失其存储内容,故主要用于存储时间使用的程序。

  按照存储信息的不同,随机存储器又分为静态随机存储器(Static RAM, SRAM)和动态随机存储器(Dynamic RAM,DRAM);

  Random-access memory(RAM) is a form of computer data storage. A random-access memory device allows data items to be read and written in roughly the same amount of time regardless of the older in which data items are accessed. In contrast, with other direct access data storage media such as hard disks,  CD-RWs, DVD-RWs and the older drum memory, the time required to read and write data items varies significantly depending on their physical locations on the recording medium, due to mechanical limitations such as media rotation speeds and arm movement delays.

  Today, random-access memory takes the form of integrated circuits. Strictly speaking, modern types of DRAM are not random access, as data is read in bursts, although the name DRAM/RAM has stuck. However, many types of SRAM are still random access even in a strict sense. RAM is normally associated with volatile types of memory (such as DRAM memory modules), where stored information is lost if the power is removed, although many efforts have been made to develop non-volatile RAM chips. Other types of non-volatile memory exist that allow random access for read operations, but either do not allow write operations or have limitations on them. These include most types of ROM and a type of flash memory called NOR-Flash.

Integrated-circuit RAM chips came into the market in the late 1960s, with the first commercially available DRAM chip, the intel 1103, introduced in October 1970.


Types of RAM

The two main forms of modern RAM are static RAM(SRAM), dynamic RAM (DRAM). In SRAM, a bit of data is stored using the state of a flip-flop. This form of RAM is more expensive to produce, but is generally faster and requires less power than DRAM and, in modern computers, is often used as cache memory for the CPU. DRAM stores a bit of data using a transistor and capacitor pair, which together comprise a memory cell. The capacitor holds a high or low charge (1 or 0, respectively), and the transistor acts as a switch that lets the control circuitry on the chip read the capacitor's state of charge or change it. As this form of memory is less expensive to produce than static RAM, it is the predominant form of computer memory used in modern computers. 

Both static and dynamic RAM are considered volatile, as their state is lost or reset when power is removed from the system. By contrast, read-only memory (ROM) stores data by permanently enabling or disabling selected transistors, such that the memory cannot be altered. Writeable variants of ROM (such as EEPROM and flash memory) share properties of both ROM and RAM, enabling data to persist without power and to be  updated without requiring special equipment. These persistent forms of semiconductor ROM include USB flash drives, memory cards for cameras and portable devices, etc. ECC memory (which can be either SRAM or DRAM) includes special circuitry to detect and / or correct random faults (memory errors) in the stored data, using parity bits or error correction code.

In general, the term RAM refers solely to solid-state memory devices (either DRAM or SRAM), and more specifically the main memory in most computers. In optical storage, the term DVD-RAM is somewhat of a misnomer since, unlike CD-RW or DVD-RW it does not need to be erased befor reuse. Nevertheless a DVD-RAM behaves much like a hard disc drive if somewhat slower.


Other uses of RAM

In addition to serving as temporary storage and working space for the operating system and applications, RAM is used in numerous other ways.

(1)Virtual Memory

Most modern operating systems employ a method of extending RAM capacity.

(2)RAM disk

Software can "partition" a portion of a computer's RAM, allowing it to act as a much faster hard drive that is called a RAM disk.

(3)Shadow RAM

Sometimes, the contents of a relatively slow ROM chip are copied to read/write memory to allow for shorter access times.


特点:

(1)随机存取

所谓“随机存取”,指的是当存储器中数据被读取或写入时,所需要的时间与这段信息所在的位置或所写入的位置无关。相对的,读取或写入顺序访问(Sequential Access)存储设备中的信息时,其所需要的时间与位置就会有关系。它主要用来存放操作系统,各种应用程序和数据等。

(2)易失性

当电源关闭时,RAM不能保留数据。

(3)对静电敏感

正如其他精细的集成电路,随机存取存储器对环境的静电荷非常敏感。静电会干扰存储器内电容器的电荷,引致数据流失,甚至烧坏电路。故此触碰随机存取存储器前,应先用手触摸金属接地。

(4)访问速度

现代的随机存取存储器几乎是所有访问设备中写入和读取速度最快的,存取延迟和其他涉及机械运作的存储设备相比,也显得微不足道。

(5)需要刷新(再生)

现代的随机存取存储器依赖电容器存储数据。电容器充满电后代表1(二进制),未充电的代表0。由于电容器或多或少有漏电的情形,若不作特别处理,数据会见见随时间流失。刷新是指定期读取电容器的状态,然后按照原来的状态重新为电容器充电,弥补流失的电荷。需要刷新正好解释了随机存储器的易失性。


类别:

根据存储单元的工作原理不同,RAM分为静态RAM和动态RAM。


静态随机存储器(SRAM)

静态存储单元是在静态触发器的基础上附加门控管而构成的。因此,它是靠触发器的自爆功能存储数据的。


动态随机存储器(DRAM)

动态RAM的存储矩阵由动态MOS存储单元组成。动态MOS存储单元利用MOS管的栅极电容来存储信息,但,由于栅极电容的容量很小,而漏电流有不可能绝对等于0,所以电荷保存的时间有限。为了避免存储信息的丢失,必须定是地给电容补充漏掉的电荷。通常把这种操作称为“刷新”或“再生”,因此,DRAM内部要有刷新控制电路,其操作也比静态RAM复杂。尽管如此,由于DRAM存储单元的结构能做到非常简单,所用元件少,功耗低,已成为大量RAM的主流产品。


ROM (只读内存 Read-Only Memory 简称)

  ROM是只读内存(Read-Only Memory)的简称,是一种智能读出实现所存数据的固态半导体存储器。其特点是一旦存储资料就无法再将之改变或删除。通常用在不需经常变更资料的垫子或电脑系统中,并且资料不会因为电源关闭而消失。

  英文简称ROM。ROM所存数据,一般是装入整机前事先写好的,整机工作过程中只能读出,而不像随机存储器那样能快速地、方便地加以改写。ROM所存数据稳定,断电后,所存数据也不会改变;其结构比较简单,读出较方便,因而常用于存储各种固定程序和数据。除少数品种的只读存储器(如字符发生器)可以通用之外,不同用户所需只读存储器的内容不同。为便于使用和大批量生产,进一步发展了可编程只读存储器(PROM)、可擦可编程序只读存储器(EPROM)和电可擦可编程只读存储器(EEPROM)。例如早起的个人电脑如Apple II 或IBM PC XT/AT的开机程序(操作系统)或是其他各种微电脑系统中的韧体(Firmware)。

  EPROM需用紫外光擦除,使用不方便也不稳定。20世纪80年代制作出的EEPROM,客服了EPROM的不足,但集成度不高,价格较贵。于是又开发出一种新型的存储单元结构同EPROM相似的快闪存储器。其集成度高、功耗低、体积小,又能在线快速擦除,因而获得飞速发展,并有可能取代现行的硬盘和软盘而成为主要的大容量存储媒体。大部分只读存储器用金属-氧化物-半导体(MOS)场效应管制成。


种类

1.ROM

  只读存储器(Read-Only Memory)是一种智能读取资料的存储器。在制造过程中,将资料以一特制光罩(mash)烧录于线路中,其资料内容在写入后就不能更改,所以有时又称为“光罩式只读内存”(mash ROM)。此内存的制造成本较低,常用于电脑中的开机启动如启动光盘,在系统装好的电脑上时,计算机将C盘目录下的操作系统文件读取至内存,然后通过CPU调用各种配件进行工作,这时,系统存放在存储器为RAM。

  Read-Only Memory (ROM) is a class of storage medium used in computers and other electronic devices. Data stored in ROM can only be modified slowly or with difficulty, or not at all, so it is mainly used to distribute firmware (software that is very closely tied to specific hardware, and unlikely to need frequent updates).

  Strictly, read-only memory refers to memory that is hard-wired, such as diode matrix and the later mask ROM. Although discrete circuits  can be altered (in principle), ICs cannot and are useless if the data is bad. The fact that such memory can never be changed is a large drawback; more recently, ROM commonly refers to memory that is read-only in normal operation, while reserving the fact of some possible way to change it.

   Other types of non-volatile memory such as erasable programmable read only memory (EPROM) and electrically erasable programmable read-only memory (EEPROM or Flash ROM) are sometimes referred to, in an abbreviated way, as "read-only memory"(ROM); although these types of memory can be erased and re-programmed multiple times, writing to this memory takes longer and may require different procedures than reading the memory. When used in this less precise way. "ROM" indicates a non-volatile memory which serves functions typically provided by mask ROM, such as storage of program code and nonvolatile data.


2.PROM

  可编程程序只读内存(Programmable ROM, PROM)之内部有行列式的熔丝,是需要利用电流将其烧断,写入所需的资料,但仅能写录一次。PROM在出厂时,存储的内容全为1,用户可以干呢局需要将其中的某些单元写入数据0(部分的PROM在出厂时,数据全为0,则用户可以将其中的部分单元写入1),以实现对其“编程”的目的。PROM的典型产品是“双极性熔丝结构”,如果,我们想改写某些单元,则可以给这些单元通以足够大的电流,并维持一定的时间,原先的熔丝即可熔断,这样就达到了改写某些位的效果。另外一类经典的PROM为使用“肖特基二极管”的PROM,出厂时,其中的二极管处于反相截止状态,还是用大电流的方法将反相电压加载“肖特基二极管”,早成其永久性击穿即可。


3.EPROM

可抹除可编程只读内存(Erasable Programmable Read Only Memory, EPROM)可利用高电压降资料编程写入,抹除时,将线路曝光于紫外线下,则资料科被清空,并且可重复使用。通常在封装外壳上会预留一个适应透明窗以方便曝光。


4.OTPROM

  一次编程只读内存(One Time Programmable Read Only Memory, OTPROM)之写入原理同EPROM,但是,为了节省成本,编程写入之后就不再抹除,因此,不设置透明窗。


5. EEPROM

    电子式抹除可编程只读内存(Electrically Erasable Programmable Read Only Memory, EEPROM)值运行原理类似于EPROM,但是,抹除的方式是使用高电场来完成,因此不需要透明窗。


6.快闪存储器

    快闪存储器(Flash Memory)的每一个记忆胞都具有一个“控制闸”与“浮动闸”,利用高电场改变浮动闸的临限电压即可进行编程动作。


Types

Semiconductor based

  Classic mask-programmed ROM chips are integrated circuits that physically encode the data to be stored, and thus it is impossible to change their contents after fabrication. Other types of non=volatile solid-state memory permit some degree of modification:

  (1) Programmable read-only memory (PROM), or one-time programmable ROM(OTP), can be written to or programmed via a special device called a PROM programmer. 

  (2) Erasable programmable read-only memory (EPROM) can be erased by exposure to strong ultraviolet light (typically for 10 minutes or longer), then rewritten with a process that again needs higher than usual voltage applied.

  (3) Electrically erasable programmable read-only memory (EEPROM) is based on a similar semiconductor structure to EPROM, but allows its entire contents (or selected banks) to be electrically erased, then rewritten electrically, so that they need not be removed from the computer (or camera, MP3 player, etc.).

       * Electrically alterable read-only memory (EAROM) is a type of EEPROM that can be modified one bit at a time.

       * Flash memory (or simply flash) is a mordern type of EEPROM invented in 1984. Flash memory can be erased and written faster than ordinary EERPOM, and newer designs feature very high endurance (exceeding 1,000,000 cycles). Modern NAND flash makes efficient use of sillicon chip area, resulting in individual ICs with a capacity as high as 32 GB as of 2007; this feature, along with its endurance and physical durability, has allowed NAND flash to replace magnetic in some applications (such as USB flash drives). Flash memory is sometimes called flash ROM or flash EEPROM when used as a replacement for older ROM types, but not in applications that take advantage of its ability to be modified quickly and frequently.


By applying write protection, some types of reprogrammable ROMs may temporarily become read-only memory.


RAM和ROM区别(手机为例)

RAM是Ramdom Acess Memory,这种存储器在断电是将丢失其存储内容,故主要用于存储短时间使用的程序。ROM是Read-Only Memory,是一种只能读出实现所存数据的固态半导体存储器。


对比手机中RAM和ROM分别对应电脑的内存和硬盘,内存负责程序的运行以及数据交换,有了它,电脑中的软件才能运行,并有了进程;而硬盘就是一块存储空间,您可以存储各种各样的文件,包括视频、照片、音乐和软件等。

手机中的RAM和ROM与电脑类似,由于RAM被称为随机存取内存,也就是运行内存,它支撑的是手机软件的运行,存放手机软件运行后进行的数据交换等工作。也就是,RAM决定了你的手机可以开多少个后台程序,当然,RAM越大,手机的运行速度也就越快。一旦手机关机,RAM中的数据就丢失,开机后也就不会恢复了。

手机中的ROM被称为只读内存,即只能读不能随意写,也就是只能读取里面的数据,而不能随意修改和删除里面的数据,就像安卓系统Root前是无法修改系统文件的,这都是一个道理。但是,为什么我们可以在里面存储照片呢?其实,现在ROM的概念也包含了可以“写”(删除、修改文件)的概念,尤其在安卓系统中。所以ROM包含了一部分手机系统占据的空间,剩余的空间你就可以用来存储视频、照片和音乐,并且可以随意删除和修改。

手机RAM和ROM在安卓手机中,ROM包含了安卓系统、手机软件和用户文件(照片和视频)。而用户存储的文件只占据ROM空间,是不影响RAM空间的。其次,ROM空间大小对系统运行速度的影响时微乎其微的;影响手机运行速度的最主要因素是RAM。

简单来说,RAM决定了手机可以同时运行多少个应用程序(包括前台和后台);而ROM决定手机可以存储多少视频、音乐和软件。


  ROM 存储器多用来存放固件,比如极端及启动的引导程序,手机、MP3、MP4和数码相机等一些电子产品的相应的自带程序代码,这种用户可以通过刷机方式读写ROM。是COMPACT DISC激光唱片,关盘也属于这种(如: 电脑系统光盘,gost版一般都可以直接在关盘上引导并启动winPE操作系统)。

  综上所述,ROM指的是计算机(包括手机)的文件内存,RAM指的是用了运行系统及应用程序的临时性存储器,比如手机的操作系统、一些应用程序如游戏等。


  EPROM、EEPROM、Flash ROM(NOR Flash 和NAND Flash),性能同ROM,但可改写。一般读出比写入快,写入需要比读出更高的电压(读5V写12V)。而Flash可以在相同电压下读写,且容量大、成本低,如今在U盘、MP3中使用广泛。在计算机系统里,RAM一般用作内存,ROM用来存放一些硬件的驱动程序,也就是固件。


ROM框架

    一个完整的ROM根目录会有以下几个文件夹及文件:data、META-IN、system、boot.img、vendor、sdcard等几个文件夹。

   data是用户安装应用程序所在目录;

   META-IN是系统相关信息所在目录,一般定制一个ROM修改系统版本信息都在这里面;

   system为系统所在目录,相当于PC系统的Windows文件夹;

   boot.img是一个镜像文件,就是所谓的内核核心,一般移植ROM的时候会用到。 


Flash 存储器

  flash 是存储芯片的一种,通过特定的程序可以修改里面的数据。FLASH在垫子以及半导体领域内往往表示Flash Memory的意思,即,平时说的“闪存”,全名叫Flash EEPROM Memory。

  flash存储器又称闪存,它结合了ROM和RAM的长处,不仅具备电子可擦除可编程(EPPROM)的性能,还可以快速读取数据(NVRAM的优势),使数据不会因为断电而丢失。U盘和MP3里用的就是这种存储器。在过去的20年里,嵌入式系统一直使用ROM(EPROM)作为它们的存储设备,然后近年来,Flash全面代替了ROM(EPROM)在嵌入式系统中的地位,用作存储Bootloader以及操作系统或者程序代码,或者直接当硬盘使用(U盘)。

   Flash memory is an electronic non-volatile computer storage medium that can be electrically erased and reprogrammed.

  Introduced by Toshiba in 1984, flash memory was developed from EEPROM (Electrically erasable programmable read-only memory). There are two main types of flash memory, which are named after the NAND and NOR logic gates. The internal characteristics of the individual flash memory cells exhibit characteristics similar to those of the corresponding gates.

  Whereas EPROMs had to be completely erased before being rewritten, NAND type flash memory may be written and read in blocks (or pages) which are generally much smaller than the entire device. NOR type flash allows a single machine word (byte) to be written - to an erased location - or read independently.

  The NAND type is primarily used in main memory, memory cards, USB flash drives, solid-state derives, and similar products, for general storage and transfer of data. The NOR type, which allows true random access and therefore direct code execution, is used as a replacement for the older EPROM and as an alternative to certain kinds of ROM applications, whereas NOR flash memory may emulate ROM primarily at the machine code level; many digital designs need ROM (or PLA) structures for other uses, often at significantly higher speeds than (economical) flash memory may achieve. NAND or NOR flash memory is also often used to store configuration data in numerous digital products, a task previously made prossible by EEPROMs or battery - powered static RAM. One significant disadvantage of flash memory is the finite amount of read/write cycles in a specific block.

  Although flash memory is technically a type of EEPROM, the term "EEPROM" is generally used to refer specifically to non-flash EEPROM which is erasable in small blocks, typically bytes. Because erase cycles are slow, the large block sizes used in flash memory erasing give it a significant speed advantage over non-flash EEPROM when writing large amouts of data. As of 2013, flash memory costs much less than byte-programmable EEPROM and has become the dominant memory type wherever a system requires a significant amount of non-volatile, solid state storage.


   目前Flash主要有两种NOR Flash和NAND Flash。NOR Flash的读取和我们常见的SDRAM的读取是一样的,用户可以直接运行装载在NOR Flash里面的代码,这样可以减少SRAM的容量从而节约了成本。NAND Flash没有采取内存的随机读取技术,它的读取是以一次读取一块的形式进行的,通常是一次读取512字节,采用这种技术的Flash比较廉价。用户不能直接与西宁NAND Flash上的代码,已草拟好多使用NAND Flash的开发板除了使用NAND Flash意外,还加上一块小的NOR Flash来余下你给启动代码。


  Nor Flash 

   In NOR gate flash, each cell has one end connected directly to ground, and the other end connected directly to a bit line. This arrangement is called "NOR flash" because it acts like a NOR gate: when one of the word lines (connected to the cell's CG) is brought high, the corresponding storage transistor acts to pull the output bit line low. NOR flash continues to be the technology of choice for embedded applications requiring a discrete non-volatile memory device. The low read latencies characteristic of NOR devices allow for both direct code execution and data storage in a single memory product.


  NAND flash

  NAND flash also uses floating-gate transistors, but they are connected in a way that resembles a NAND gate: several transistors are connected in series, and the bit line is pulled low only if all word lines are pulled high (above the transistors' Vt). These groups are then connected via some additional transistors to a NOR-style bit line array in the same way that single transistors are linked in NOR flash.


  一般小容量的用NOR Flash,因为其读取速度快,多用来存储操作系统等重要信息,而大容量的用NAND Flash,最长间的NAND Flash 应用是嵌入式系统采用的DOC (Disk On Chip)和我们通常用的“闪盘”,可以在线擦除。目前市场上的Flash主要来自Intel、AMD、Fujitsu和Mxic,而生产NAND Flash的主要厂商有Samsung、Toshiba,Micron和Hynix。


Distinction between NOR and NAND Flash

  NOR and NAND flash differ in two important ways:

  (1) the connections of the individual memory cells are different

  (2) the interface provided for reading and writing the memory is different (NOR allows random-access for reading, NAND allows only page access ).


  These two are linked by the design choices make in the development of NAND flash. A goal of NAND flash development was to reduce the chip area required to implement a given capacity of flash memory, and thereby to reduce cost per bit and increase maximun chip capacity so that flash memory could compete with magnetic storage devices like hard disks.

 NOR and NAND flash get their names from the structure of the interconnections between memory cells. 

 In NOR flash, cells are connected in parallel to the bit lines, allowing cells to be read and programmed individually. The parallel connection of cells resembles the parallel connection of transistors in a CMOS NOR gate. 

 In NAND flash, cells are connected in series, resembling a NAND gate. The series connections consume less space then parallel ones, reducing the cost of NAND flash. It does not, by itself, prevent NAND cells from being read and programmed individually. 







  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值