Computer Memory and Storage: Key Concepts for IB & CIE | 计算机存储器考点精讲(IB & CIE)

📚 Computer Memory and Storage: Key Concepts for IB & CIE | 计算机存储器考点精讲(IB & CIE)

Memory and storage form the backbone of any computing system, directly influencing performance, capability, and design. Both IB and CIE Computer Science curricula expect students to understand the hierarchy from fast registers and cache to persistent secondary storage, as well as to analyse the trade‑offs between cost, speed, and capacity. This article systematically covers the core concepts, terminology, and typical examination points.

存储器是任何计算机系统的基石,直接影响着性能、能力与设计。IB 和 CIE 的计算机科学课程都要求学生理解从快速寄存器和高速缓存到永久性辅助存储的层次结构,并分析成本、速度与容量之间的权衡。本文将系统梳理核心概念、术语和常见考点。


1. Overview of Memory and Storage | 存储器概述

In computer science, ‘memory’ often refers to components that hold data and instructions the CPU needs to access quickly, typically primary memory (RAM, ROM). ‘Storage’ generally refers to larger‑capacity, non‑volatile devices such as hard drives and solid‑state drives that keep data for the long term. However, the two terms overlap in many exam contexts; you will often see ‘memory’ used as a broad category covering both main memory and secondary storage.

在计算机科学中,“存储器”通常指那些保存 CPU 需要快速访问的数据和指令的部件,一般是主存储器(RAM、ROM)。“存储”通常指大容量、非易失性设备,如硬盘和固态硬盘,用于长期保留数据。不过,在考试语境中这两个词经常重叠;“memory”常被用作涵盖主存和辅助存储的广义范畴。

Key distinctions worth remembering are volatility, access speed, cost per bit, and proximity to the processor. IB and CIE exams frequently ask you to compare these characteristics and justify how different memory types fit together in a modern computer.

值得记住的关键区别包括易失性、存取速度、每位成本和与处理器的距离。IB 和 CIE 考试经常要求你比较这些特征,并论证不同存储器类型如何协同工作在现代计算机中。


2. Primary Memory: RAM and ROM | 主存储器:RAM 与 ROM

RAM (Random Access Memory) is volatile, meaning its contents are lost when power is turned off. It holds the operating system, application programs and data currently in use, enabling the CPU to work quickly. Two common types are SRAM, used for cache memory, and DRAM, used for main system memory. DRAM must be periodically refreshed, whereas SRAM retains its bits as long as power is supplied, making it faster but more expensive.

RAM(随机存取存储器)是易失性的,断电后内容会丢失。它存放着当前使用的操作系统、应用程序和数据,使 CPU 能够快速工作。常见类型有两种:用于高速缓存的 SRAM 和用作主系统内存的 DRAM。DRAM 必须周期性刷新,而 SRAM 只要供电就能保持数据位,因此速度更快但更昂贵。

ROM (Read‑Only Memory) is non‑volatile and stores firmware such as the BIOS or UEFI. Classic ROM cannot be written to during normal operation, but modern variants like EPROM, EEPROM and flash ROM allow reprogramming under specific conditions. In exams you need to explain why ROM is essential for bootstrapping – it provides the first instructions the CPU executes when powered on.

ROM(只读存储器)是非易失性的,用于存储固件,如 BIOS 或 UEFI。经典 ROM 在正常操作中不可被写入,但现代变体如 EPROM、EEPROM 和闪存 ROM 允许在特定条件下重编程。考试中你需要解释为何 ROM 对引导起动至关重要——它提供 CPU 加电时执行的第一批指令。


3. Secondary Storage: Hard Drives, SSDs and Cloud | 辅助存储器:硬盘、固态硬盘与云存储

Secondary storage provides persistent, high‑capacity data retention. Magnetic hard disk drives (HDDs) store data on spinning platters with read/write heads; they offer low cost per gigabyte but are susceptible to mechanical failure and have relatively high access latency. Solid‑state drives (SSDs) use NAND flash memory with no moving parts, delivering much lower latency and higher throughput, albeit at a higher cost per byte.

辅助存储器提供持久、高容量的数据保存。磁性硬盘(HDD)通过旋转盘片和读写头存储数据;它们每 GB 成本低,但存在机械故障风险且访问延迟相对较高。固态硬盘(SSD)采用无活动部件的 NAND 闪存,延迟低得多、吞吐量更高,但每字节成本较高。

Cloud storage refers to remote servers accessed via the internet. While not a tangible device inside the local machine, it appears frequently in CIE and IB questions about virtualized storage and data redundancy. The trade‑off here includes bandwidth, latency over networks, and reliance on an internet connection.

云存储指通过互联网访问的远程服务器。它虽不是本地机器内的实体设备,但在 CIE 和 IB 有关虚拟化存储和数据冗余的题目中经常出现。此处的权衡包括带宽、网络延迟以及对互联网连接的依赖。


4. The Memory Hierarchy | 存储器层次结构

The memory hierarchy orders storage technologies by speed and cost. From fastest and most expensive (registers) to slowest and cheapest (magnetic tape or cloud archives), the typical pyramid is: registers → L1 cache → L2 cache → L3 cache → main RAM → solid‑state storage → hard disk → optical/tape. Each level serves as a buffer for the level below, exploiting the principle of locality.

存储器层次结构按速度和成本对存储技术进行排序。从最快且最昂贵(寄存器)到最慢且最廉价(磁带或云归档),典型的金字塔是:寄存器 → L1 缓存 → L2 缓存 → L3 缓存 → 主存 RAM → 固态存储 → 硬盘 → 光盘/磁带。每一层都作为下一层的缓冲,利用了局部性原理。

The principle of locality states that programs tend to access a relatively small portion of their address space repeatedly. Temporal locality means recently accessed data is likely to be accessed again soon; spatial locality means nearby addresses will be accessed together. Caches exploit these behaviours to keep frequently used data close to the CPU.

局部性原理指出,程序倾向于反复访问其地址空间中相对较小的一部分。时间局部性意味着最近访问的数据很可能马上再次被访问;空间局部性意味着邻近的地址会被一起访问。高速缓存利用这些行为将常用的数据保存在 CPU 附近。


5. Cache Memory | 高速缓存

Cache is a small, high‑speed memory placed between the CPU and main memory. It stores copies of frequently accessed data and instructions, dramatically reducing the average time to access memory. Modern processors integrate multiple levels of cache; L1 is split for data and instructions, while L2 and L3 are unified and progressively larger.

高速缓存是位于 CPU 和主存之间的小容量高速存储器。它存储常用数据和指令的副本,显著减少平均内存访问时间。现代处理器集成多级缓存;L1 分为数据缓存和指令缓存,而 L2 和 L3 是统一且逐步增大的。

Cache performance is measured by hit rate, miss rate, and miss penalty. A cache hit occurs when the requested data is found in the cache; a miss requires fetching from a slower level, incurring a delay. Exam questions often ask you to calculate average access time given hit rate and miss penalty, or to explain mappings such as direct‑mapped, fully associative, and set‑associative caches.

缓存的性能通过命中率、缺失率和缺失代价来衡量。缓存命中是指被请求的数据在缓存中找到;缺失则需要从更慢的一级获取,从而引起延迟。考题经常要求你根据命中率和缺失代价计算平均访问时间,或解释直接映射、全相联和组相联等映射方式。


6. Virtual Memory | 虚拟内存

Virtual memory extends the apparent size of main memory by using disk space as an overflow area. The operating system divides memory into fixed‑size pages (or segments) and swaps them between RAM and secondary storage as needed. This allows a computer to run applications that require more memory than is physically installed, and provides isolation between processes.

虚拟内存通过将磁盘空间用作溢出区域,扩展了主存的可用容量。操作系统把内存划分为固定大小的页(或段),并根据需要把它们在 RAM 和辅助存储器之间交换。这使得计算机可以运行需要比物理内存更大空间的应用,且提供进程间的隔离。

Page faults occur when the CPU tries to access a page not currently in RAM. The operating system must then load the required page from disk, which is orders of magnitude slower than a RAM access. Excessive page faults cause thrashing, where the system spends more time swapping than executing, severely degrading performance – a classic exam scenario.

当 CPU 试图访问不在 RAM 中的页面时,会发生缺页。操作系统必须从磁盘加载所需页面,这比 RAM 访问慢好几个数量级。过多的缺页会导致颠簸,系统花在交换上的时间多于执行时间,严重影响性能——这是典型的考试情景。

Both IB and CIE syllabi expect you to distinguish between paging, segmentation, and the combination of both. Understand translation lookaside buffers (TLBs), page tables, and how virtual addresses are translated into physical addresses.

IB 和 CIE 大纲都要求你区分分页、分段以及二者的结合。需理解快表(TLB)、页表以及虚拟地址如何转换为物理地址。


7. Memory Addressability and Address Spaces | 存储器寻址与地址空间

Addressability refers to the size of the unit accessed by a single address – often one byte. The address space is determined by the width of the address bus. For example, a 32‑bit address bus can directly address 2³² unique memory locations; if each location holds one byte, that’s 4 GB of addressable memory. A 64‑bit address bus theoretically supports 2⁶⁴ bytes, though practical limits are lower.

可寻址性是指单个地址所访问单元的大小——通常是一个字节。地址空间由地址总线的宽度决定。例如,32 位地址总线可以直接寻址 2³² 个唯一存储位置;若每个位置存一个字节,则可寻址 4 GB 内存。64 位地址总线理论上支持 2⁶⁴ 字节,但实际限制要小一些。

To calculate memory capacity from address lines, use:

Number of addressable locations = 2n (where n = number of address lines)

如需根据地址线计算存储容量,可使用:

可寻址单元数 = 2ⁿ(n = 地址线数)

And total storage = addressable locations × word size. CIE past papers often include exercises where you deduce the number of address lines required for a given memory chip.

总存储量 = 可寻址单元数 × 字长。CIE 历年真题常包含要求你根据给定存储芯片推断需要多少根地址线的练习。


8. Measuring Performance: Latency, Bandwidth, and Access Time | 性能衡量:延迟、带宽和存取时间

Memory performance is measured by several metrics. Access time (latency) is the time between initiating a request and receiving the data. Memory bandwidth is the volume of data transferred per unit time, often expressed in GB/s. Both are affected by the speed of the memory technology and the width of the data bus.

存储器性能由若干指标衡量。访问时间(延迟)是从发起请求到获得数据之间的间隔。内存带宽是单位时间内传输的数据量,常用 GB/s 表示。两者均受存储器技术速度和数据总线宽度的影响。

For example, DDR4‑3200 RAM has a peak transfer rate of approximately 25.6 GB/s per channel (8 bytes × 3.2 billion transfers per second). In contrast, a typical SATA SSD may deliver around 500 MB/s read speed, illustrating the huge gap between primary and secondary storage.

例如,DDR4‑3200 RAM 每通道峰值传输率约 25.6 GB/s(8 字节 × 32 亿次/秒)。相比之下,典型的 SATA SSD 读取速度约为 500 MB/s,体现出主存和辅助存储之间的巨大差距。

Understand the difference between sequential and random access times, especially for HDDs and SSDs; this distinction often appears in data storage comparison questions.

理解顺序访问和随机访问时间的差别,特别是对于 HDD 和 SSD;这种区分经常出现在数据存储比较题中。


9. Volatile vs Non‑volatile Memory | 易失性与非易失性存储器

Volatile memory requires power to retain data; RAM is the classic example. Non‑volatile memory retains data without power, making it suitable for firmware, secondary storage, and portable devices. ROM, flash memory, EEPROM, and magnetic/optical storage are non‑volatile.

易失性存储器需要通电才能保持数据;RAM 是典型例子。非易失性存储器在断电后仍保留数据,适用于固件、辅助存储和便携设备。ROM、闪存、EEPROM 以及磁/光存储都是非易失性的。

Exams frequently ask you to identify which type is used for the BIOS or to explain why RAM must be volatile (speed and cost reasons). Also, note that the cache inside an SSD is often DRAM (volatile) while the main flash memory is non‑volatile; some hybrid memory technologies like Intel Optane attempt to bridge this gap.

考试经常要求你识别 BIOS 使用哪种类型,或解释 RAM 为何必须是易失性的(出于速度和成本原因)。还请注意,SSD 内部的缓存通常是 DRAM(易失性),而主闪存是非易失性的;像 Intel 傲腾这样的混合存储器技术正试图填补这一鸿沟。


10. Firmware and Boot Process (BIOS/UEFI) | 固件与启动过程(BIOS/UEFI)

Firmware is low‑level software stored in non‑volatile memory (typically flash ROM) that initialises hardware and provides runtime services. The traditional BIOS is being replaced by UEFI, which offers faster boot times, larger disk support via GPT, and a more modern interface. Both serve as the intermediary between the OS and the hardware.

固件是存储在非易失性存储器(通常是闪存 ROM)中的底层软件,负责初始化硬件并提供运行时服务。传统的 BIOS 正被 UEFI 取代,后者提供更快的启动时间、通过 GPT 支持更大的磁盘和更现代的接口。二者都充当操作系统与硬件之间的中介。

In the boot sequence, the CPU first reads the firmware from ROM, performs a power‑on self‑test (POST), loads the bootloader from the specified storage device into RAM, and transfers control. Understanding this sequence is a common multiple‑choice or short‑answer topic.

在引导序列中,CPU 首先从 ROM 读取固件,执行开机自检(POST),从指定存储设备将引导加载程序加载到 RAM,并移交控制权。理解这个序列是多项选择或简答题的常见考点。


11. Memory Technologies: SRAM, DRAM, Flash, and More | 存储器技术:SRAM、DRAM、闪存等

SRAM (Static RAM) uses flip‑flop circuits to hold bits; it is fast, power‑hungry, and expensive, ideal for CPU caches. DRAM (Dynamic RAM) uses capacitors that leak charge and must be refreshed thousands of times per second; it is denser and cheaper, hence used for main memory. Flash memory (NAND/NOR) is a non‑volatile semiconductor technology used in SSDs, USB drives, and memory cards. NOR flash supports random read access and is suitable for firmware; NAND flash offers higher density and faster write/erase cycles, perfect for mass storage.

SRAM(静态 RAM)使用触发器电路保持数据位;速度快、功耗较高且昂贵,是 CPU 缓存的理想选择。DRAM(动态 RAM)使用会漏电的电容,必须每秒刷新数千次;更密集且便宜,因此用于主存。闪存(NAND/NOR)是一种非易失性半导体技术,用于 SSD、U 盘和存储卡。NOR 闪存支持随机读取,适合固件;NAND 闪存提供更高密度和更快的写入/擦除周期,非常适合大容量存储。

Emerging technologies such as MRAM, ReRAM, and 3D XPoint promise to combine speed and non‑volatility. While not always examined, they illustrate the trend toward storage‑class memory that blurs the line between memory and storage.

MRAM、ReRAM 和 3D XPoint 等新兴技术有望结合速度与非易失性。虽然不常考,但它们说明了存储级内存模糊存储与存储器界限的趋势。


12. Comparison Tables and Exam Tips | 比较表格与考试技巧

The following table summarises must‑know comparisons for both IB and CIE papers:

下表总结了 IB 和 CIE 试卷中必须掌握的对比:

Feature / 特性 RAM (DRAM) ROM / Flash SSD (NAND) HDD
Volatility / 易失性 Volatile / 易失 Non‑volatile / 非易失 Non‑volatile / 非易失 Non‑volatile / 非易失
Speed / 速度 Very fast / 极快 (ns) Read moderate, write slow / 读中等,写慢 Fast / 快 (µs read) Slow / 慢 (ms seek)
Cost per GB / 每GB成本 High / 高 Higher than HDD / 高于 HDD Medium / 中等 Low / 低
Typical role / 典型用途 Main memory / 主存 Firmware / 固件 Primary/secondary storage / 主/辅助存储 Bulk storage / 海量存储

Finally, common pitfalls to avoid: confusing volatile and non‑volatile, forgetting that cache is usually SRAM, and mixing up the impact of address bus width. Practise past paper questions that require you to calculate memory sizes, justify the choice of storage for a given scenario, or explain how virtual memory interacts with the page table.

最后,要避免的常见误区:混淆易失性与非易失性,忘记缓存通常是 SRAM,以及混淆地址总线宽度的影响。练习历年真题,要求你计算存储器大小,为给定场景选择存储类型并说明理由,或解释虚拟内存如何与页表交互。

Published by TutorHao | IB & CIE Computer Science Revision Series | aleveler.com

更多咨询请联系16621398022(同微信)

Comments

屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from aleveler.com

Subscribe now to keep reading and get access to the full archive.

Continue reading