Basic Principles of Computer Systems | 计算机系统基本原理

📚 Basic Principles of Computer Systems | 计算机系统基本原理

Computer systems are built upon a set of fundamental principles that determine how data is processed, stored, and communicated. Understanding these principles — from the central processing unit (CPU) to memory hierarchy and system buses — is essential for any computer science student preparing for board examinations. This guide covers the core concepts in a structured, exam-focused manner.

计算机系统建立在决定数据如何被处理、存储和通信的一系列基本原理之上。从中央处理器(CPU)到存储器层次结构和系统总线,理解这些原理对每一位备战考试的计算机科学学生来说都至关重要。本指南以结构化、紧扣考点的方式覆盖核心概念。


1. The Von Neumann Architecture | 冯·诺依曼体系结构

The Von Neumann architecture is the foundational model for most modern computers. It describes a system where the CPU, memory, and input/output devices are connected through a single shared bus system. Both instructions and data are stored in the same memory unit, and the CPU fetches them sequentially.

冯·诺依曼体系结构是现代大多数计算机的基础模型。它描述了一个由CPU、存储器和输入/输出设备通过单一共享总线系统连接的体系。指令和数据存储在同一个存储器单元中,CPU按顺序取用它们。

  • Stored Program Concept: Instructions and data are stored in the same memory space, allowing programs to be loaded and executed without rewiring the hardware.

  • 存储程序概念:指令和数据存储在同一存储空间中,程序无需重新接线即可被加载和执行。

  • Sequential Execution: The CPU processes instructions one at a time, in a linear sequence determined by the program counter.

  • 顺序执行:CPU一次处理一条指令,按程序计数器决定的线性顺序进行。

  • Single Bus System: A shared system bus carries data, addresses, and control signals between components, which simplifies hardware but can create a bottleneck.

  • 单一总线系统:一条共享系统总线在组件之间传输数据、地址和控制信号,简化硬件但可能形成瓶颈。

The alternative Harvard architecture uses separate memory spaces for instructions and data, allowing simultaneous access. It is commonly found in embedded systems and DSP (digital signal processing) chips where speed is critical.

另一种哈佛体系结构为指令和数据使用独立的存储空间,允许同时访问。它常见于对速度要求苛刻的嵌入式系统和DSP(数字信号处理)芯片中。


2. The Central Processing Unit (CPU) | 中央处理器(CPU)

The CPU is often called the “brain” of the computer. Its primary role is to execute instructions by performing arithmetic, logic, control, and input/output operations.

CPU常被称为计算机的“大脑”,其主要角色是通过执行运算、逻辑、控制和输入/输出操作来处理指令。

Component Function
Arithmetic Logic Unit (ALU) Performs arithmetic operations (+, −, ×, ÷) and logical operations (AND, OR, NOT, XOR).
Control Unit (CU) Decodes instructions and generates control signals to coordinate all components.
Registers High-speed, temporary storage locations within the CPU used during processing.
Cache Small, very fast memory used to store frequently accessed data and instructions.

组件名称与功能:ALU执行算术运算(+、−、×、÷)和逻辑运算(AND、OR、NOT、XOR);控制单元(CU)对指令进行译码并产生控制信号协调各组件;寄存器是CPU内部用于处理过程中的高速临时存储单元;Cache是容量小但速度极快的存储器,用于存储频繁访问的数据和指令。


3. Key Registers in the CPU | CPU中的关键寄存器

Registers are the fastest memory in the computer. Each register has a specific role in the fetch-decode-execute cycle.

寄存器是计算机中最快的存储器。每个寄存器在取指-译码-执行周期中扮演特定角色。

  • Program Counter (PC): Holds the memory address of the next instruction to be fetched. After each fetch, the PC is incremented to point to the next instruction.

  • 程序计数器(PC):保存下一条待取指令的存储器地址。每次取指后,PC递增以指向下一条指令。

  • Memory Address Register (MAR): Holds the address of a memory location that is to be accessed for reading or writing.

  • 存储器地址寄存器(MAR):保存将要被读写的存储器单元的地址。

  • Memory Data Register (MDR): Holds the data that has been read from memory or is to be written to memory.

  • 存储器数据寄存器(MDR):保存已从存储器读出的数据或将要写入存储器的数据。

  • Accumulator (ACC): Temporarily stores results of arithmetic and logic operations performed by the ALU.

  • 累加器(ACC):临时保存ALU执行的算术和逻辑运算的结果。

  • Current Instruction Register (CIR): Holds the instruction currently being decoded and executed.

  • 当前指令寄存器(CIR):保存当前正在被译码和执行的指令。


4. The Fetch-Decode-Execute Cycle | 取指-译码-执行周期

The fetch-decode-execute cycle is the fundamental process by which the CPU executes a single instruction. The cycle repeats continuously while the computer is running.

取指-译码-执行周期是CPU执行一条指令的基本过程。当计算机运行时,该周期不断重复。

Fetch → Decode → Execute → (repeat)

Fetch (取指):

1. The address stored in the PC is copied to the MAR. 2. The MAR places the address on the address bus. 3. A read control signal is sent on the control bus. 4. The memory location is read, and data is placed on the data bus. 5. The data is loaded into the MDR. 6. The MDR holds the data until it is transferred to the CIR. 7. The PC is incremented to point to the next instruction.

取指阶段:1. PC中保存的地址被复制到MAR。2. MAR将地址放到地址总线上。3. 控制总线上发出读控制信号。4. 读取存储单元,数据被放到数据总线上。5. 数据被加载到MDR中。6. MDR保存数据直至其被传送到CIR。7. PC递增以指向下一条指令。

Decode (译码): The instruction in the CIR is decoded by the Control Unit, which interprets the opcode and determines which operands are needed.

译码阶段:CIR中的指令由控制单元译码,控制单元解释操作码并确定需要哪些操作数。

Execute (执行): The decoded operation is carried out. This may involve the ALU performing calculations, reading/writing memory, or communicating with an I/O device.

执行阶段:被译码的操作被执行。这可能涉及ALU进行计算、读写存储器或与I/O设备通信。


5. Main Memory: RAM and ROM | 主存储器:RAM与ROM

Main memory is directly accessible by the CPU. It consists primarily of RAM and ROM, which serve different purposes.

主存储器是CPU可以直接访问的存储器,主要由RAM和ROM构成,二者用途不同。

Feature RAM ROM
Volatility Volatile — content lost when power is off Non-volatile — content is retained
Writable Yes, read/write Read-only in normal operation
Purpose Stores running programs and data Stores boot-up instructions (BIOS/firmware)

RAM的特点是易失性(断电后内容丢失)、可读写,用于存储正在运行的程序和数据;ROM的特点是非易失性(断电后内容保留)、常规操作只读,用于存储启动指令(BIOS/固件)。

Note that modern systems also use flash memory (e.g., SSDs, USB drives), which is non-volatile and electrically erasable — a bridge between speed and permanence.

注意现代系统还使用闪存(如SSD、U盘),它非易失且可电擦除——介于速度与持久性之间。


6. Secondary Storage | 辅助存储器

Secondary storage provides large-capacity, non-volatile storage for data and programs that are not currently being used. It is slower than main memory but far cheaper per unit of storage.

辅助存储器为当前未使用的数据和程序提供大容量、非易失的存储。它比主存储器慢,但单位存储成本远低得多。

  • Magnetic Storage (e.g., HDD): Uses magnetised regions on a spinning platter to represent binary data. Offers large capacity at low cost, but has moving parts and is slower.

  • 磁存储(如HDD):利用旋转盘片上磁化区域表示二进制数据。容量大、成本低,但有运动部件且速度较慢。

  • Optical Storage (e.g., CD, DVD, Blu-ray): Uses laser light to read and write data encoded as pits and lands on a reflective surface.

  • 光存储(如CD、DVD、蓝光):利用激光读写刻录在反射表面上的凹坑和平面所编码的数据。

  • Solid-State Storage (e.g., SSD): Uses NAND flash memory with no moving parts. Faster, more durable, and more energy-efficient than HDDs.

  • 固态存储(如SSD):使用NAND闪存,无运动部件。比HDD更快、更耐用、更节能。

Exam tip: Be ready to compare storage types in terms of capacity, speed, portability, durability, and cost.

考试提示:要准备从容量、速度、便携性、耐用性和成本等方面比较存储类型。


7. System Buses | 系统总线

A bus is a set of parallel wires that transfers data between components. The CPU communicates with memory and I/O devices via three buses.

总线是一组在组件之间传输数据的并行导线。CPU通过三条总线与存储器和I/O设备通信。

  • Address Bus: Carries memory addresses from the CPU to memory or I/O devices. It is unidirectional. The width of the address bus determines the maximum addressable memory. For example, a 32-bit address bus can address 2³² = 4 GB of memory.

  • 地址总线:将存储器地址从CPU传送到存储器或I/O设备。它是单向的。地址总线的宽度决定了最大可寻址存储器空间。例如,32位地址总线可寻址2³² = 4 GB内存。

  • Data Bus: Carries actual data being transferred between the CPU, memory, and I/O devices. It is bidirectional. A wider data bus allows more data to be transferred per clock cycle.

  • 数据总线:在CPU、存储器和I/O设备之间传输实际数据。它是双向的。更宽的数据总线允许每个时钟周期传输更多数据。

  • Control Bus: Carries control signals (e.g., read/write enable, interrupt requests, clock signals) from the Control Unit to other components. It is bidirectional.

  • 控制总线:携带控制信号(如读/写使能、中断请求、时钟信号)从控制单元传送到其他组件。它是双向的。

Maximum addressable memory = 2ⁿ bytes (n = address bus width)

最大可寻址内存 = 2ⁿ 字节(n = 地址总线宽度)


8. Input and Output Systems | 输入与输出系统

Input devices convert external data into a form the computer can process; output devices convert processed data back into human-readable or usable forms.

输入设备将外部数据转换为计算机可处理的形式;输出设备将处理后的数据转换回人类可读或可用的形式。

  • Input Devices: Keyboard, mouse, microphone, scanner, barcode reader, sensors. Each device produces digital data that is sent to the CPU via the appropriate interface or port.

  • 输入设备:键盘、鼠标、麦克风、扫描仪、条码阅读器、传感器。每个设备产生数字数据,通过相应接口或端口发送到CPU。

  • Output Devices: Monitor, printer, speaker, actuators. These devices translate binary data into visual, printed, auditory, or physical output.

  • 输出设备:显示器、打印机、扬声器、执行器。这些设备将二进制数据转换为视觉、打印、听觉或物理输出。

I/O interaction is managed through methods such as polling, interrupt-driven I/O, and direct memory access (DMA). DMA allows hardware devices to transfer data directly to/from memory without involving the CPU, improving efficiency.

输入/输出交互通过轮询、中断驱动I/O和直接存储器访问(DMA)等方式管理。DMA允许硬件设备不经过CPU而直接与存储器传输数据,从而提高效率。


9. Factors Affecting CPU Performance | 影响CPU性能的因素

Several key factors influence how quickly a CPU can execute instructions. Understanding these helps explain real-world performance differences between processors.

几个关键因素影响CPU执行指令的速度。理解这些因素有助于解释真实世界中处理器之间的性能差异。

  • Clock Speed: Measured in hertz (Hz) — the number of clock cycles per second. A higher clock speed generally means more instructions executed per second, though other bottlenecks may limit gains.

  • 时钟频率:以赫兹(Hz)为单位——每秒钟时钟周期数。更高的时钟频率通常意味着每秒钟执行更多指令,但也可能存在其他瓶颈限制收益。

  • Cache Size: A larger cache reduces the average time to access frequently used data, since cache access is much faster than RAM access.

  • 缓存容量:更大的缓存减少了访问频繁使用数据的平均时间,因为缓存访问比RAM访问快得多。

  • Number of Cores: Multi-core processors can execute multiple instructions or threads in parallel, significantly improving throughput.

  • 核心数量:多核处理器可以并行执行多道指令或线程,显著提高吞吐量。

  • Word Length: The number of bits a CPU can process in one operation (e.g., 32-bit or 64-bit). A longer word allows larger data to be processed at once.

  • 字长:CPU一次操作可以处理的位数(如32位或64位)。更长的字允许一次处理更大的数据。


10. Embedded Systems | 嵌入式系统

An embedded system is a computer system designed for a specific, dedicated function within a larger device. Unlike general-purpose computers, embedded systems run a fixed set of tasks, usually with a real-time constraint.

嵌入式系统是为大型设备中的特定专用功能而设计的计算机系统。与通用计算机不同,嵌入式系统运行固定的任务集,通常带有实时约束。

  • Characteristics: Limited memory, low power consumption, no user interface, dedicated hardware, and often use ROM or flash for program storage.

  • 特点:内存有限、功耗低、无用户界面、专用硬件,通常使用ROM或闪存存储程序。

  • Examples: Washing machines, microwave ovens, car engine control units (ECUs), pacemakers, digital cameras, and IoT devices.

  • 实例:洗衣机、微波炉、汽车发动机控制单元(ECU)、心脏起搏器、数码相机和物联网设备。

  • Programming consideration: Embedded software must be highly reliable, efficient in memory and energy usage, and often written in C or C++ for direct hardware control.

  • 编程考虑:嵌入式软件必须高度可靠、在内存和能耗方面高效,通常用C或C++编写以便直接控制硬件。


11. Parallel Processing and Multi-Core Systems | 并行处理与多核系统

Parallel processing uses multiple processing units to execute independent instructions simultaneously, reducing total computation time. Board exams often test the distinction between parallel and concurrent execution.

并行处理利用多个处理单元同时执行相互独立的指令,从而减少总计算时间。考试经常考查并行与并发执行之间的区别。

  • Parallelism: Multiple instructions are executed at exactly the same instant on different cores or processors.

  • 并行性:多条指令在同一时刻于不同核心或处理器上执行。

  • Concurrency: Multiple tasks make progress over the same time period, but not necessarily simultaneously — achieved by time-slicing on a single core.

  • 并发性:多个任务在同一时间段内推进,但不一定同时——通过单核上的时间分片实现。

  • Amdahl’s Law: P = Pₛ + Pₚ/(N), where speedup is limited by the fraction of code that cannot be parallelised. This explains why adding cores has diminishing returns.

  • 阿姆达尔定律:P = Pₛ + Pₚ/(N),并行加速的上限受程序无法并行化的部分所占比例制约。这解释了为何增加核心的回报会递减。

Speedup limit → 1 / (1 − fₚ) where fₚ is the fraction of code that is parallelisable

加速上限 → 1 / (1 − fₚ),其中fₚ是可并行化代码的比例


12. Summary and Revision Checklist | 总结与复习清单

To succeed in the computer systems topic, ensure you can explain each concept from first principles and apply the knowledge to unfamiliar scenarios. Below is a concise checklist.

要在计算机系统主题上取得好成绩,请确保你能从基本原理出发解释每个概念,并将知识应用于陌生情境。以下是简明复习清单。

Concept Key Point
Von Neumann architecture Single memory for data + instructions, sequential execution
CPU registers PC, MAR, MDR, ACC, CIR — know each function
Fetch-Decode-Execute Understand each phase in the correct order
RAM vs ROM Volatile vs non-volatile, read/write vs read-only
Buses Address (unidirectional), Data (bidirectional), Control (bidirectional)
Performance factors Clock speed, cache size, cores, word length
Embedded systems Dedicated function, limited resources, real-time constraints

Review past paper questions on diagram labelling, bus direction, binary arithmetic in the ALU, and comparison tables. Practice explaining each step of the fetch-decode-execute cycle without looking at your notes — this is the most commonly assessed skill.

复习往年试题中的图示标注、总线方向、ALU中的二进制运算和比较表。练习不看笔记解释取指-译码-执行周期的每一步——这是最常考查的技能。

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课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply

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

Exit mobile version