A-Level OCR Computer Science: Memory and Storage – Key Points | A-Level OCR 计算机:存储器 考点精讲

📚 A-Level OCR Computer Science: Memory and Storage – Key Points | A-Level OCR 计算机:存储器 考点精讲

Welcome to this comprehensive revision guide on memory and storage for A-Level OCR Computer Science. We will break down key concepts from primary memory, secondary storage, cache, virtual memory, to the memory hierarchy, ensuring you are exam-ready.

欢迎阅读这份 A-Level OCR 计算机科学中存储器考点的全面复习指南。我们将剖析主存、辅存、高速缓存、虚拟内存到存储器层次结构等关键概念,助你备考无忧。


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

Memory and storage are fundamental components of a computer system. Memory usually refers to primary storage that directly interacts with the CPU, such as RAM and ROM, while storage often indicates secondary devices like hard drives and SSDs used for long-term data retention.

存储器是计算机系统的基本组成部分。内存通常指与 CPU 直接交互的主存储器,如 RAM 和 ROM;而存储常指用于长期保存数据的辅助设备,如硬盘和固态硬盘。

Primary memory is directly accessible by the CPU and is typically volatile, meaning it loses its contents when power is turned off, with the exception of ROM which retains data.

主存储器可直接由 CPU 访问,并且通常是易失性的,即断电后内容丢失,但 ROM 能保留数据。

Secondary storage is non-volatile, used for storing files and programs persistently. It has larger capacity but slower access speeds compared to primary memory.

辅助存储器是非易失性的,用于持久存储文件和程序。与主存相比,容量更大但访问速度更慢。


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

RAM (Random Access Memory) is volatile memory used to hold data and instructions that the CPU is currently processing. It allows both read and write operations and is often referred to as main memory.

RAM(随机存取存储器)是易失性存储器,用于存放 CPU 当前正在处理的数据和指令。它支持读写操作,常被称为主内存。

ROM (Read-Only Memory) is non-volatile memory that stores firmware and boot instructions, such as the BIOS. The CPU can read from ROM but cannot write to it during normal operation.

ROM(只读存储器)是非易失性存储器,存储固件和引导指令,例如 BIOS。CPU 只能从 ROM 读取,正常运行期间无法写入。

When a computer boots, the CPU reads the BIOS from ROM, which performs a POST (Power-On Self-Test) and then loads the operating system from secondary storage into RAM.

计算机启动时,CPU 从 ROM 读取 BIOS,执行开机自检 (POST),然后将操作系统从辅助存储器加载到 RAM 中。


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

DRAM (Dynamic RAM) stores each bit as a charge in a capacitor within an integrated circuit. It must be refreshed thousands of times per second to retain data, making it slower but cheaper and denser.

DRAM(动态 RAM)利用集成电路中电容的电荷存储每个比特。它需要每秒数千次刷新以保持数据,因此速度较慢,但成本更低、密度更高。

SRAM (Static RAM) uses flip-flop circuits to store bits. It does not need refreshing, so it is faster and consumes less power for active storage, but it is more expensive and takes up more space per bit.

SRAM(静态 RAM)使用触发器电路存储比特。它无需刷新,因此速度更快、有功存储功耗更低,但每比特成本更高且占用空间更大。

In modern systems, DRAM is typically used for main memory modules, while SRAM is reserved for small, high-speed cache memories inside the CPU.

在现代系统中,DRAM 通常用作主内存条,而 SRAM 则用于 CPU 内部的小容量高速缓存。


4. ROM Variants: PROM, EPROM, EEPROM | ROM 的变体:PROM、EPROM、EEPROM

PROM (Programmable ROM) can be programmed once by blowing internal fuses using a special device. Once programmed, it cannot be altered.

PROM(可编程 ROM)可以通过特殊设备熔断内部熔丝进行一次编程。编程后内容不可更改。

EPROM (Erasable Programmable ROM) can be erased by exposure to ultraviolet light through a quartz window and then reprogrammed, allowing updates but requiring removal from the system.

EPROM(可擦除可编程 ROM)可通过石英窗口暴露在紫外线下擦除,然后重新编程,允许更新,但需要从系统中取出。

EEPROM (Electrically Erasable Programmable ROM) can be erased and reprogrammed electrically, even while in the circuit. Flash memory is a type of EEPROM that supports block erasure and is widely used in USB drives, SSDs, and memory cards.

EEPROM(电可擦除可编程 ROM)可使用电信号在电路中擦除并重新编程。闪存是一种支持块擦除的 EEPROM,广泛用于 U 盘、固态硬盘和存储卡。


5. Cache Memory | 高速缓存

Cache is a small, extremely fast memory located close to or inside the CPU. It stores frequently accessed instructions and data to reduce the average time to access main memory.

高速缓存是位于 CPU 内部或附近的小容量、极快存储器。它存储频繁使用的指令和数据,以减少访问主存的平均时间。

Cache operates on the principle of locality of reference: once a data address is accessed, nearby addresses are likely to be accessed soon (spatial locality), and the same address may be accessed repeatedly (temporal locality).

缓存基于访问局部性原理:一旦访问某个数据地址,相邻地址很可能即将被访问(空间局部性),同一地址可能被多次访问(时间局部性)。

Modern processors have multiple levels of cache: L1 (fastest, smallest), L2 (larger, slightly slower), and sometimes L3 (shared among cores). A cache hit occurs when the required data is found in the cache; a miss requires fetching from slower memory.

现代处理器有多级缓存:L1(最快、最小)、L2(更大、稍慢),有时还有 L3(核心间共享)。当所需数据在缓存中找到时即为缓存命中;未命中则需要从更慢的存储器中获取。


6. Virtual Memory and Paging | 虚拟内存与分页

Virtual memory is a technique that allows a computer to compensate for shortages of physical memory by using a portion of secondary storage (usually an HDD or SSD) as an extension of RAM.

虚拟内存是一种通过将部分辅助存储器(通常是硬盘或固态硬盘)用作 RAM 的扩展,来弥补物理内存不足的技术。

The operating system divides memory into fixed-size blocks called pages. When RAM is full, less frequently used pages are moved to a page file on disk, a process called paging or swapping.

操作系统将内存划分为固定大小的块,称为页。当 RAM 已满,不常使用的页面会被移至磁盘上的页面文件,这个过程称为分页或交换。

When a page that is not in RAM is needed, a page fault occurs, causing the OS to load the required page from disk, possibly writing another page out. Excessive paging can lead to disk thrashing, severely degrading performance.

当需要不在 RAM 中的页面时,会发生缺页,迫使操作系统从磁盘加载所需页面,并可能写出另一页面。过度分页会导致磁盘抖动,严重降低性能。

Virtual memory provides the illusion of a large continuous address space to programs and enables multitasking, security, and isolation between processes.

虚拟内存为程序提供了看似连续的大地址空间,并实现了多任务处理、安全性和进程间隔离。


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

Magnetic storage (e.g., Hard Disk Drives) uses rapidly spinning platters with a magnetic coating and read/write heads. Data is stored by magnetising tiny regions. HDDs offer large capacities at low cost but are susceptible to physical shock and have mechanical latency.

磁存储(如硬盘驱动器)使用高速旋转的磁盘盘片和磁头读写数据。通过磁化微小区域存储数据。HDD 容量大、成本低,但怕物理震动且存在机械延迟。

Optical storage (e.g., CDs, DVDs, Blu-ray) uses lasers to read and write data on reflective surfaces. Pits and lands represent binary values. They are durable and portable but have limited capacity compared to modern magnetic and solid-state drives.

光存储(如 CD、DVD、蓝光)利用激光在反射表面读写数据。凹坑和平面表示二进制值。它们耐用、便携,但容量与现代磁和固态存储相比有限。

Solid-state storage (e.g., SSDs, USB flash drives) uses NAND flash memory (an EEPROM type) with no moving parts. It provides faster access times, lower power consumption, and greater shock resistance, but typically at a higher cost per gigabyte than HDDs.

固态存储(如 SSD、USB 闪存盘)采用 NAND 闪存(一种 EEPROM),无活动部件。访问速度更快、功耗更低、抗冲击性更好,但每 GB 成本通常高于 HDD。


8. Storage Characteristics and Comparison | 存储特性比较

When evaluating storage devices, the key characteristics are volatility, speed (access time / transfer rate), capacity, portability, durability, and cost. The following table summarises typical primary and secondary storage.

评估存储设备时,关键特征包括易失性、速度(访问时间/传输速率)、容量、便携性、耐用性和成本。下表汇总了典型的主存储器和辅助存储器。

Storage Type Volatile? Speed Capacity Cost per GB
Registers Yes Fastest (a few ns) Very small (bytes) Highest
Cache (SRAM) Yes ~1-10 ns KB to MB Very high
RAM (DRAM) Yes ~10-50 ns Several GB Moderate
Solid State (SSD) No ~0.1 ms Tens of GB to TB Moderate
Hard Disk (HDD) No ~5-10 ms Up to many TB Low
Optical (Blu-ray) No Slower (ms) 25-100 GB Very low

In general, the faster the storage, the higher the cost per bit and the smaller the capacity. This trade-off is captured by the memory hierarchy.

一般而言,存储速度越快,每比特成本越高,容量越小。这种权衡通过存储器层次结构体现。


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

The memory hierarchy organises storage types from fastest to slowest, balancing speed, cost, and capacity. From top to bottom: registers, cache, main memory (RAM), solid-state storage, magnetic disk, and optical/tape archives.

存储器层次结构按速度从快到慢组织存储类型,平衡速度、成本和容量。从上到下依次为:寄存器、缓存、主存 (RAM)、固态存储、磁盘和光/磁带归档。

As we move down the hierarchy, access time increases, but cost per bit decreases and capacity grows. Data that is accessed most frequently is kept in the highest, fastest levels.

随着层次向下移动,访问时间增加,但每比特成本降低且容量增长。访问最频繁的数据保存在最高、最快的层次中。

The design ensures that the CPU typically works with data in registers or cache, while large programs and files are held in main memory and secondary storage, giving the illusion of both speed and size.

这种设计确保 CPU 通常处理寄存器或缓存中的数据,而大型程序和文件存储在内存和辅存中,从而兼顾速度与容量。


10. Registers and Memory Addressing | 寄存器与内存寻址

Within the CPU, special registers interface directly with memory. The Memory Address Register (MAR) holds the address of the memory location to be read from or written to. The Memory Data Register (MDR) holds the actual data or instruction.

在 CPU 内部,专用寄存器直接与内存接口。存储器地址寄存器 (MAR) 存放要读写的内存位置地址。存储器数据寄存器 (MDR) 存放实际的数据或指令。

The address bus carries the memory address from the MAR to main memory; it is unidirectional. The data bus carries the content between MDR and memory; it is bidirectional. The control bus carries timing and control signals like read/write.

地址总线将存储器地址从 MAR 传输到主存,是单向的。数据总线在 MDR 和存储器之间传输内容,是双向的。控制总线传递时序和控制信号,如读/写信号。

If the address bus has n lines, the CPU can address 2ⁿ unique memory locations. The word length (typically 32 or 64 bits) determines the size of data each location can hold. Total capacity is often given as 2ⁿ × word size bits.

如果地址总线有 n 根线,则 CPU 可寻址 2ⁿ 个唯一的内存位置。字长(通常 32 或 64 位)决定了每个位置可容纳的数据大小。总容量通常表示为 2ⁿ × 字长的比特数。

Addressable locations = 2ⁿ,   Capacity = 2ⁿ × word size


11. The Fetch-Decode-Execute Cycle and Memory | 取指-译码-执行周期与内存

Memory plays a central role in the FDE cycle. During Fetch, the Program Counter (PC) sends the address of the next instruction to the MAR, the instruction is retrieved from RAM into the MDR, and then copied to the Current Instruction Register (CIR).

内存在取指-译码-执行周期中扮演核心角色。在取指阶段,程序计数器 (PC) 将下一条指令的地址送入 MAR,指令从 RAM 取出到 MDR,然后复制到当前指令寄存器 (CIR)。

During Decode and Execute, the CPU may need to read operands from memory or write results back to memory, again using the MAR and MDR. Hence, the speed of memory directly affects the overall performance of the processor.

在译码和执行阶段,CPU 可能需要从内存读取操作数或将结果写回内存,同样使用 MAR 和 MDR。因此,内存速度直接影响处理器的整体性能。


12. Exam Tips and Common Mistakes | 考试技巧与常见错误

Clearly distinguish between ‘memory’ (primary, typically RAM/ROM) and ‘storage’ (secondary, non-volatile). Many mark schemes penalise mix-ups. Remember RAM is volatile, ROM is not.

清楚区分“内存”(主存,通常是 RAM/ROM)和“存储”(辅助,非易失性)。许多评分标准会因混淆而扣分。牢记 RAM 是易失性的,ROM 不是。

Be precise when describing virtual memory: it uses a page file on secondary storage to swap pages, not the whole program at once. Mention paging, page faults, and thrashing for full marks.

描述虚拟内存时要精确:它使用辅助存储器上的页面文件交换页面,而不是一次交换整个程序。提到分页、缺页和抖动才能获得满分。

For storage device comparisons, always reference at least three characteristics: speed, capacity, portability, durability, cost. Use comparative language (e.g., ‘faster than’, ‘higher cost per GB’).

在比较存储设备时,始终至少提及三个特性:速度、容量、便携性、耐用性、成本。使用比较性语言(如“比……更快”、“每 GB 成本更高”)。

Explain cache using locality of reference, and link cache levels to the memory hierarchy. Never just say ‘cache is fast memory’; explain why it improves performance.

用访问局部性解释缓存,并将缓存级别与存储器层次结构联系起来。不要只说“缓存是快速存储器”;要解释它为何能提高性能。

Understand address bus width calculation: n bits → 2ⁿ addresses. Be able to compute memory capacity given address bus width and word size, using correct units (KiB, MiB, GiB).

理解地址总线宽度的计算:n 位 → 2ⁿ 个地址。能够根据地址总线宽度和字长计算内存容量,并使用正确单位(KiB、MiB、GiB)。


Published by TutorHao | 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