RAM, ROM and memory types · RAM、ROM 及内存类型
| English | 中文 | Pinyin · 拼音 |
|---|---|---|
| RAM/ræm/ | 随机存取存储器 | suí jī cún qǔ cún chǔ qì |
| ROM/rɒm/ | 只读存储器 | zhī dú cún chǔ qì |
| volatile/ˈvɒlətaɪl/ | 易失性 | yì shī xìng |
| non-volatile/nɒn ˈvɒlətaɪl/ | 非易失性 | fēi yì shī xìng |
| firmware/ˈfɜːmweə/ | 固件 | gù jiàn |
| bootstrap/ˈbuːtstræp/ | 引导程序 | yǐn dǎo chéng xù |
| SRAM/ˈesræm/ | 静态RAM | jìng tài RAM |
| DRAM/ˈdiːræm/ | 动态RAM | dòng tài RAM |
| flip-flop/flɪp flɒp/ | 触发器 | chù fā qì |
| capacitor/kəˈpæsɪtə/ | 电容器 | diàn róng qì |
| refreshed/rɪˈfreʃt/ | 刷新 | shuā xīn |
| cache/kæʃ/ | 高速缓存 | gāo sù huǎn cún |
| PROM/prɒm/ | 可编程只读存储器 | kě biān chéng zhī dú cún chǔ qì |
| EPROM/ˈiːprɒm/ | 可擦可编程只读存储器 | kě cā kě biān chéng zhī dú cún chǔ qì |
| EEPROM/ˌiːiːˈprɒm/ | 电可擦可编程只读存储器 | diàn kě cā kě biān chéng zhī dú cún chǔ qì |
Memory woven by hand
- The Apollo Guidance Computer that flew to the Moon kept its programs in core rope memory: wires threaded by hand through or around tiny magnetic rings, one pass for a 1, the other for a 0.
- Once woven, nothing could be changed. It was read-only memory in its purest form, and it meant the flight software had to be finished months before launch.
- Its working data lived in a separate, erasable memory that lost everything when the power went.
- Every computer since has the same two kinds of main memory. This lesson is about telling them apart and choosing between them.
手工编织的存储器
- 飞往月球的阿波罗制导计算机把程序存在磁芯绳存储器里:导线由人手穿过或绕过微小的磁环,穿过代表 1,绕过代表 0。
- 一旦编好,什么都改不了。这是最纯粹形式的只读存储器,也意味着飞行软件必须在发射前几个月就定稿。
- 它的工作数据存放在另一块可擦写的存储器里,断电就全部丢失。
- 从那以后每台计算机都有同样的两种主存储器。这一课讲怎样区分它们,以及怎样在它们之间做选择。
RAM and ROM
- RAM 随机存取存储器 (Random Access Memory) is volatile 易失性: its contents are lost when the power is off. It holds the operating system, the running programs and their data, and it is read and written constantly.
- ROM 只读存储器 (Read-Only Memory) is non-volatile 非易失性: it keeps its contents without power. It is written once, and in normal use it is only read.
- ROM holds the firmware 固件 and bootstrap 引导程序 that start the computer, or the whole program of an embedded system. RAM is large and can usually be increased; ROM is small and fixed.
RAM is volatile and read/write; ROM is non-volatile and read-only
RAM 和 ROM
- RAM(随机存取存储器,Random Access Memory)是易失的(volatile):断电时内容丢失。它保存操作系统、正在运行的程序和它们的数据,并且不断地被读写。
- ROM(只读存储器,Read-Only Memory)是非易失的(non-volatile):没有电也保留内容。它写入一次,正常使用时只被读取。
- ROM 保存启动计算机的固件(firmware)和引导程序(bootstrap),或者嵌入式系统的整个程序。RAM 大而且通常可以增加;ROM 小而固定。

RAM 是易失的、可读写的;ROM 是非易失的、只读的
Device and storage lab · 设备和存储实验室
Classify computing examples by what job they do in a system. · 根据计算示例在系统中的功能进行分类。
Which statement is true? · 哪项陈述是正确的?
RAM loses its contents without power (volatile); ROM keeps them (non-volatile). · RAM 在没有电源时会丢失内容(易失性);ROM 会保留内容(非易失性)。
ROM typically holds: · ROM 通常包含:
ROM is non-volatile and written once, so it stores the start-up firmware. Running programs live in RAM. · ROM 是非易失性的且只能写入一次,因此它存储启动固件。正在运行的程序位于 RAM 中。
Worked example: two favourite questions
- Explain why a computer with more RAM performs better. It can hold more programs and data in memory at once, so it swaps less between memory and disk, so it runs faster.
- State what ROM is used for in a PC and in a washing machine. In a PC, the start-up code that checks the hardware and loads the operating system. In a washing machine, the entire control program, which never changes.
- Both answers name what is stored and why it must be there.
例题:两道常考题
- *解释为什么 RAM 更多的计算机性能更好。*它能同时在内存里保存更多程序和数据,所以在内存和磁盘之间交换更少,所以运行更快。
- *说出 ROM 在 PC 和洗衣机里分别用来做什么。*在 PC 里,是检查硬件并加载操作系统的启动代码。在洗衣机里,是整个控制程序,它永远不变。
- 两个答案都说出了存储的是什么以及它为什么必须在那里。
A computer with more RAM holds more programs and data at once, so it swaps less between memory and ____, so it runs faster. · 拥有更多 RAM 的计算机可以一次容纳更多程序和数据,因此在内存和 ____ 之间交换的次数更少,运行速度更快。
When RAM is full the operating system moves pages out to secondary storage and back, and every swap is thousands of times slower than a memory access. · 当 RAM 满时,操作系统会将页面移出到辅助存储并换回,每次交换的速度都比内存访问慢数千倍。
The start-up sequence
- Power on. The processor reads its first instructions from ROM, because RAM is still empty.
- The firmware checks the hardware, then loads the operating system from secondary storage into RAM.
- From then on the processor works from RAM. ROM starts the system; RAM holds the active work.
A RAM module: fast, volatile, and empty until the firmware fills it
启动过程
- 通电。处理器从 ROM 读取它的第一批指令,因为 RAM 此时还是空的。
- 固件检查硬件,然后把操作系统从辅助存储器加载到 RAM。
- 从此处理器在 RAM 上工作。ROM 启动系统;RAM 承载正在进行的工作。

RAM 模块:快速、易失,在固件填充它之前是空的
Put the start-up sequence in order. · 按顺序排列启动序列。
ROM is non-volatile so its firmware is there at power-on; it then loads the OS into volatile RAM. · ROM 是非易失性的,因此其固件在通电时即存在;随后它将 OS 加载到易失性的 RAM 中。
SRAM and DRAM
- SRAM 静态RAM (static RAM) stores each bit in a flip-flop 触发器 of several transistors. It is fast and uses little power when idle, but it is expensive and holds fewer bits per chip.
- DRAM 动态RAM (dynamic RAM) stores each bit as charge on one tiny capacitor 电容器 with one transistor. It is cheaper and denser, but slower, and the charge leaks away, so every cell must be refreshed 刷新 thousands of times a second.
- So SRAM is used for the processor's small, fast cache 高速缓存, and DRAM for the large main memory.
SRAM 和 DRAM
- SRAM(静态RAM,static RAM)把每个比特存在由几个晶体管组成的触发器(flip-flop)里。它快,空闲时耗电少,但贵,而且每个芯片容纳的比特更少。
- DRAM(动态RAM,dynamic RAM)把每个比特以电荷的形式存在一个微小的电容器(capacitor)和一个晶体管上。它更便宜、更密,但更慢,而且电荷会漏掉,所以每个单元必须每秒被刷新(refresh)几千次。
- 所以 SRAM 用于处理器小而快的高速缓存(cache),DRAM 用于大容量的主存储器。
SRAM is fast but expensive, so it is mainly used for: · SRAM 速度快但昂贵,因此主要用于:
SRAM (flip-flops) is fast but not dense, ideal for small fast cache. DRAM is used for large main memory. · SRAM(触发器)速度快但密度低,适合用作小型高速缓存。DRAM 用于大容量主存。
DRAM must be refreshed (rewritten) thousands of times a second to keep its data. · DRAM 必须每秒刷新(重写)数千次以保持数据。
DRAM stores each bit as charge on a capacitor, which leaks away — so it is constantly refreshed. SRAM does not need this. · DRAM 将每个位存储为电容上的电荷,电荷会泄漏——因此它需要不断刷新。SRAM 不需要这样做。
Match each memory type to its key trait. · 将每种内存类型与其关键特性匹配。
RAM/ROM split on volatility; SRAM/DRAM split on speed vs density. · RAM/ROM 按易失性区分;SRAM/DRAM 按速度与密度区分。
Worked example: why this memory here?
- Explain why an embedded system uses DRAM for its main memory. It needs a large amount of memory at low cost in a small space, and its speed requirement is modest, so the cheaper, denser DRAM is the right choice.
- Explain why the processor's cache is SRAM. The cache is small and must be as fast as possible, and SRAM needs no refresh cycle to slow it down, so its higher cost per bit is worth paying.
- One answer argues from cost and density, the other from speed. Say which matters for the device in the question.
例题:为什么这里用这种存储器?
- *解释为什么嵌入式系统用 DRAM 作主存储器。*它需要在小空间里以低成本获得大量存储器,而它对速度的要求不高,所以更便宜、更密的 DRAM 是正确的选择。
- *解释为什么处理器的高速缓存是 SRAM。*高速缓存很小,必须尽可能快,而 SRAM 不需要拖慢它的刷新周期,所以它每比特更高的成本值得付出。
- 一个答案从成本和密度论证,另一个从速度论证。要说出题目中的设备看重哪一个。
Why does an embedded system use DRAM rather than SRAM for its main memory? Select all · 所有 that apply. · 为什么嵌入式系统在其主存中使用 DRAM 而不是 SRAM?选择 所有 适用项。
Cost and density are DRAM's advantages. It is slower and it does need refreshing; the device accepts both because its speed requirement is modest. · 成本和密度是 DRAM 的优势。它较慢且确实需要刷新;设备接受这两点是因为其速度要求不高。
PROM, EPROM and EEPROM
- PROM 可编程只读存储器 (Programmable ROM) is written once by the user with a programmer, by burning fuses. It cannot be erased.
- EPROM 可擦可编程只读存储器 (Erasable Programmable ROM) is erased by strong ultraviolet light through a quartz window, the whole chip at once, and it must be taken out of the circuit to do it.
- EEPROM 电可擦可编程只读存储器 (Electrically Erasable Programmable ROM) is erased and rewritten electrically, a byte at a time, while it stays in the circuit. Flash memory is a derivative optimised for erasing whole blocks quickly.
PROM、EPROM 和 EEPROM
- PROM(可编程只读存储器,Programmable ROM)由用户用编程器烧断熔丝、一次性写入。它不能被擦除。
- EPROM(可擦可编程只读存储器,Erasable Programmable ROM)用透过石英窗口的强紫外光擦除,整块芯片一起,而且必须从电路中取出来做。
- EEPROM(电可擦可编程只读存储器,Electrically Erasable Programmable ROM)以电的方式、一次一个字节地擦除和重写,同时留在电路里。闪存是它的衍生品,针对快速整块擦除做了优化。
EEPROM differs from EPROM because it can be: · EEPROM 与 EPROM 的不同之处在于它可以:
EEPROM is erased electrically a byte at a time in place; EPROM needs UV to erase the whole chip; PROM is write-once. · EEPROM 可在电路中以电方式逐字节擦除;EPROM 需要紫外线擦除整个芯片;PROM 是一次性写入的。
Worked example: "give two differences"
- Give two differences between EPROM and EEPROM. Each difference is stated for both types.
- EPROM is erased by ultraviolet light, whereas EEPROM is erased by an electrical signal.
- EPROM erases the whole chip at once and must be removed from the circuit, whereas EEPROM erases a byte at a time and stays in place.
- A difference given for one side only is half an answer.
例题:"给出两个不同"
- *给出 EPROM 和 EEPROM 的两个不同。*每个不同都要对两种类型分别说明。
- EPROM 用紫外光擦除,而 EEPROM 用电信号擦除。
- EPROM 一次擦除整块芯片并且必须从电路中取出,而 EEPROM 一次擦一个字节并且留在原位。
- 只说一边的"不同"只算半个答案。
Match each ROM type to how it is erased or rewritten. · 将每种 ROM 类型与其擦除或重写方式匹配。
The names say it: Programmable, Erasable Programmable, Electrically Erasable Programmable. · 名字即说明:可编程、可擦除可编程、电可擦除可编程。
Choosing the memory for the job
- Processor cache: SRAM, because it must be fastest and can be small.
- Main memory of a PC, phone or embedded system: DRAM, because it must be large and cheap.
- Firmware that may need updating in the field: EEPROM or flash, so a fix can be installed without opening the device.
- Firmware that must never change, made in millions: mask ROM or PROM, cheapest and safest.
为任务选择存储器
- 处理器高速缓存:SRAM,因为它必须最快,而且可以很小。
- PC、手机或嵌入式系统的主存储器:DRAM,因为它必须大而便宜。
- 可能需要现场更新的固件:EEPROM 或闪存,这样不用打开设备就能安装修补。
- 永远不变、以百万计生产的固件:掩模 ROM 或 PROM,最便宜、最安全。
A router's firmware may need a security update after it is sold. Which memory should hold it? · 路由器出厂后可能需要安全更新固件。应将其保存在哪种内存中?
It must survive without power, so not RAM, and it must be rewritable in place, so not PROM. EEPROM or flash can be reprogrammed electrically without opening the device. · 它必须在断电后保存,所以不是 RAM;并且必须在原位可重写,所以不是 PROM。EEPROM 或闪存可以通过电方式重新编程而无需打开设备。
Marks that slip away
- "ROM cannot be written" is only true of mask ROM. PROM is written once; EPROM and EEPROM can be rewritten, in the ways above.
- Refresh belongs to DRAM only. SRAM holds its bit in a flip-flop and needs none.
- SRAM and DRAM are kinds of RAM; PROM, EPROM and EEPROM are kinds of ROM. Do not cross the lists.
- "Volatile" is about power, not speed. Say "loses its contents when the power is removed".
容易丢掉的分
- "ROM 不能写入"只对掩模 ROM 成立。PROM 可写一次;EPROM 和 EEPROM 可以按上面的方式重写。
- 刷新只属于 DRAM。SRAM 用触发器保存比特,不需要刷新。
- SRAM 和 DRAM 是 RAM 的种类;PROM、EPROM 和 EEPROM 是 ROM 的种类。不要把两张名单混在一起。
- "易失"说的是电源,不是速度。要说"断电时内容丢失"。
SRAM must be refreshed thousands of times a second to keep its contents. · SRAM 必须每秒刷新数千次以保持内容。
Refresh is a DRAM requirement, because a capacitor's charge leaks. A flip-flop holds its state for as long as the power is on. · 刷新是 DRAM 的要求,因为电容电荷会泄漏。触发器只要通电就能保持状态。
You've got it
- RAM volatile, read/write, holds running programs; ROM non-volatile, read-only, holds firmware; ROM starts the system, RAM does the work
- SRAM flip-flops, fast, no refresh → cache; DRAM capacitor, denser and cheaper, needs refresh → main memory
- PROM written once; EPROM UV-erased, whole chip, out of circuit; EEPROM electrically erased, byte at a time, in circuit (flash = block erase)
- a "difference" answer states both sides; a "why this memory" answer argues from speed or from cost and density
你掌握了
- RAM 易失、可读写、保存运行中的程序;ROM 非易失、只读、保存固件;ROM 启动系统,RAM 做工作
- SRAM 触发器、快、无刷新 → 高速缓存;DRAM 电容器、更密更便宜、需要刷新 → 主存储器
- PROM 写一次;EPROM 紫外擦除、整块、离线;EEPROM 电擦除、逐字节、在线(闪存 = 整块擦除)
- "不同"题两边都要说;"为什么用这种存储器"题从速度或从成本和密度论证