← 返回资讯屏轩教育 · 行业资讯

Memory in Computer Systems: IB & Edexcel Key Concepts | IB Edexcel 计算机:存储器 考点精讲

2026-07-14 06:03 · 本文部分内容由AI辅助创作

📚 Memory in Computer Systems: IB & Edexcel Key Concepts | IB Edexcel 计算机:存储器 考点精讲

Memory is the component of a computer system that stores data and instructions, either temporarily or permanently. Understanding memory hierarchy, types of RAM and ROM, cache mapping, virtual memory, and addressing modes is essential for IB and Edexcel Computer Science exams. This guide breaks down every key concept with clear explanations and exam-focused details.

存储器是计算机系统中用于临时或永久存储数据和指令的部件。理解存储器层次结构、RAM 和 ROM 的类型、缓存映射、虚拟内存以及寻址模式,对于 IB 和 Edexcel 计算机科学考试至关重要。本指南将逐一剖析每个关键概念,提供清晰讲解并紧扣考点。

1. Memory Hierarchy Overview | 存储器层次结构概述

The memory hierarchy organises storage into levels based on speed, cost, and capacity. At the top, registers inside the CPU are fastest but smallest and most expensive per bit. Below them are cache (L1, L2, L3), main memory (RAM), and secondary storage (SSD, HDD). The principle of locality ensures that frequently accessed data moves up the hierarchy.

存储器层次结构根据速度、成本和容量将存储划分为不同级别。最顶层是 CPU 内部的寄存器,速度最快但容量最小、每比特成本最高。其下依次是缓存(L1、L2、L3)、主存储器(RAM)和辅助存储器(SSD、HDD)。局部性原理确保频繁访问的数据向上层移动。

Speed ↑, Cost per bit ↑, Capacity ↓ as we move up the hierarchy.

从底层到顶层:速度 ↑、每比特成本 ↑、容量 ↓。


2. Types of Primary Memory | 主存储器的类型

Primary memory is directly accessed by the CPU and consists of RAM and ROM. RAM is volatile, meaning it loses data when power is off. ROM is non-volatile and retains data permanently. Both are semiconductor-based but serve different roles during boot and program execution.

主存储器由 CPU 直接访问,包含 RAM 和 ROM。RAM 是易失性的,断电后数据丢失。ROM 是非易失性的,可永久保存数据。两者均基于半导体,但在启动和程序执行期间扮演不同角色。

Property / 属性 RAM ROM
Volatility / 易失性 Volatile (data lost on power off) / 易失 Non-volatile (permanent) / 非易失
Read/Write / 读写 Read and write / 可读写 Primarily read-only (some types writable) / 主要只读(某些类型可写)
Typical use / 典型用途 Stores OS, applications, data in use / 存放正在使用的操作系统、应用程序和数据 Firmware, BIOS/UEFI, bootloader / 固件、BIOS/UEFI、引导加载程序

3. SRAM vs DRAM | 静态 RAM 与动态 RAM

RAM is divided into Static RAM (SRAM) and Dynamic RAM (DRAM). SRAM uses flip-flop circuits to store each bit, making it faster and more expensive. DRAM uses capacitors that must be periodically refreshed, offering higher density at lower cost but with slower access times.

RAM 分为静态 RAM(SRAM)和动态 RAM(DRAM)。SRAM 使用触发器电路存储每个比特,速度更快但成本更高。DRAM 使用电容存储数据,必须定期刷新,密度更高、成本更低,但访问速度较慢。


4. Types of ROM | ROM 的类型

ROM chips store firmware and boot programs. Early ROM was mask-programmed at manufacture. Programmable ROM (PROM) can be written once. Erasable PROM (EPROM) can be erased with UV light. Electrically Erasable PROM (EEPROM) can be erased and rewritten electrically, enabling firmware updates. Flash memory is a modern EEPROM variant.

ROM 芯片存储固件和引导程序。早期的 ROM 在制造时通过掩膜编程。可编程 ROM(PROM)只能写入一次。可擦除 PROM(EPROM)可以用紫外光擦除。电可擦除 PROM(EEPROM)可以电气擦除和重写,支持固件更新。闪存是现代 EEPROM 的变体。


5. Cache Memory | 缓存存储器

Cache is a small, fast memory placed between the CPU and main memory to reduce the average memory access time. It exploits the principles of temporal and spatial locality. Modern CPUs have multiple cache levels: L1 (split into instruction and data caches), L2 (unified, larger), and L3 (shared among cores).

缓存是置于 CPU 与主存之间的小容量快速存储器,用于降低平均内存访问时间。它利用了时间局部性和空间局部性原理。现代 CPU 拥有多级缓存:L1(分为指令和数据缓存)、L2(统一、更大)和 L3(多核共享)。


6. Cache Mapping Techniques | 缓存映射技术

A cache mapping function determines where a main memory block can be placed in the cache. The three main techniques are direct mapping, fully associative mapping, and set-associative mapping. Each provides a trade-off between hit rate, complexity, and cost.

缓存映射函数决定了主存块可放置在缓存中的位置。三种主要技术是直接映射、全相联映射和组相联映射。它们在命中率、复杂度和成本之间进行不同的权衡。

In direct mapping, a physical address is split as:

Tag | Index | Block Offset

直接映射中,物理地址划分如下:

标签 | 索引 | 块内偏移


广告 / Sponsored

7. Cache Replacement Policies | 缓存替换策略

When a cache miss occurs and the set is full, a replacement policy decides which existing block to evict. Common policies include Least Recently Used (LRU), First-In First-Out (FIFO), and Random. LRU generally provides the best hit rate but requires extra hardware for tracking usage history.

当缓存未命中且组已满时,替换策略决定驱逐哪个现有块。常见策略包括最近最少使用(LRU)、先进先出(FIFO)和随机替换。LRU 通常提供最佳命中率,但需要额外硬件跟踪使用历史。


8. Virtual Memory | 虚拟内存

Virtual memory is a memory management technique that allows the execution of programs larger than physical RAM by using disk space as an extension. Each process has its own virtual address space; the OS and MMU (Memory Management Unit) translate virtual addresses to physical addresses using page tables.

虚拟内存是一种内存管理技术,通过将磁盘空间作为扩展,允许执行比物理 RAM 更大的程序。每个进程拥有自己的虚拟地址空间;操作系统和内存管理单元(MMU)使用页表将虚拟地址翻译为物理地址。


9. Paging and Page Tables | 分页与页表

Paging divides virtual memory into fixed-size pages and physical memory into frames of the same size. A page table maps virtual page numbers to physical frame numbers. Each entry also contains control bits (valid, dirty, referenced). Translation Lookaside Buffer (TLB) is a small cache for page table entries to speed up translation.

分页将虚拟内存划分为固定大小的页面,物理内存划分为相同大小的帧。页表将虚拟页号映射到物理帧号。每个表项还包含控制位(有效位、脏位、引用位)。快表(TLB)是页表项的小型缓存,用于加速地址翻译。


10. Secondary Storage Technologies | 辅助存储技术

Secondary storage provides non-volatile, long-term data retention. Hard Disk Drives (HDD) use magnetic platters and moving read/write heads, offering high capacity at low cost but slower access due to mechanical latency. Solid State Drives (SSD) use NAND flash memory with no moving parts, delivering much faster random access times but at a higher cost per gigabyte.

辅助存储提供非易失性的长期数据保存。硬盘驱动器(HDD)使用磁性盘片和移动读写头,容量大、成本低,但由于机械延迟访问速度较慢。固态驱动器(SSD)使用无移动部件的 NAND 闪存,随机访问时间快得多,但每 GB 成本更高。


11. Addressing Modes | 寻址模式

Addressing modes define how the operand of an instruction is obtained. Common modes in IB/Edexcel syllabus include immediate, direct, indirect, indexed, and register addressing. Each mode affects instruction execution speed and flexibility.

寻址模式定义了如何获取指令的操作数。IB/Edexcel 考纲中常见模式包括立即寻址、直接寻址、间接寻址、变址寻址和寄存器寻址。每种模式影响指令执行速度和灵活性。


12. Memory Management & Exam Tips | 存储器管理与考试技巧

Good memory management by the OS ensures efficient use of RAM, prevents fragmentation, and supports multitasking. Concepts like segmentation, paging, and virtual memory are frequently tested. In exam questions, always relate specifications to the memory hierarchy: why cache is small but fast, how paging allows multiprogramming, and the difference between volatile and non-volatile storage.

操作系统良好的内存管理能确保高效利用 RAM、防止碎片并支持多任务处理。诸如分段、分页和虚拟内存等概念经常被考查。在试题中,始终将规范与存储器层次结构联系起来:为什么缓存小但快,分页如何实现多道程序设计,以及易失性与非易失性存储器之间的区别。

Published by TutorHao | Computer Science Revision Series | aleveler.com

广告 / Sponsored
IBDP国际文凭计算机科学学生用书 高级及标准水平 Computer Science for the IB Diplo…
计算机 备考教辅 · 正版现货 · 与本文内容相关
查看详情 / View on Taobao参考价 ¥524.0

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

备考资讯每日更新,关注不错过
考纲变化 · 科目分析 · 学习方法
扫码关注公众号 tutorhao
在微信里长按二维码识别关注
或截图后用「扫一扫 → 相册」选择本图
公众号:tutorhao