📚 Computer Systems, Sub-systems and Decomposition | 计算机系统、子系统与分解
In Cambridge IGCSE Computer Science, understanding how a computer system is organised and how complex problems are broken down is essential for designing programs and analysing technology. This article explains systems, sub-systems and decomposition with practical examples.
在剑桥 IGCSE 计算机科学中,理解计算机系统的组织方式以及复杂问题如何分解对于设计程序和分析技术至关重要。本文通过实际示例解释系统、子系统与分解。
1. What is a Computer System? | 什么是计算机系统?
A computer system is a combination of hardware, software and data that works together to process information. It accepts input, processes that input, produces output and often stores data for later use.
计算机系统是硬件、软件和数据协同工作以处理信息的组合。它接受输入、处理该输入、产生输出,并且通常会存储数据以备后用。
Hardware includes physical components such as the processor, memory and storage devices. Software includes the programs and instructions that control the hardware. Data is the raw facts that are processed into useful information.
硬件包括处理器、内存和存储设备等物理组件。软件包括控制硬件的程序和指令。数据是被处理成有用信息的原始事实。
2. The Input, Process, Output and Storage Model | 输入、处理、输出与存储模型
The simplest way to describe any computer system is the input-process-output-storage model. Data enters the system through input devices, the central processing unit (CPU) processes it, output devices display or communicate the result, and storage keeps data either temporarily or permanently.
描述任何计算机系统最简单的方法是输入-处理-输出-存储模型。数据通过输入设备进入系统,中央处理器(CPU)对其进行处理,输出设备显示或传达结果,而存储则临时或永久地保存数据。
For example, a smartphone receives a touch as input, processes the command in its processor, displays the app as output, and stores photos in flash memory. This model can be applied to a whole system or to any smaller part of it.
例如,智能手机将触摸作为输入,在其处理器中处理命令,将应用程序显示为输出,并将照片存储在闪存中。该模型可以应用于整个系统或其任何较小的部分。
The storage sub-system can be temporary, such as RAM, or permanent, such as a hard disk or solid-state drive. Storage allows data and programs to be kept even when the computer is switched off.
存储子系统可以是临时的,例如 RAM,也可以是永久的,例如硬盘或固态硬盘。即使计算机关闭,存储也能保存数据和程序。
3. Systems and Sub-systems | 系统与子系统
A sub-system is a smaller system inside a larger system. Each sub-system has its own input, process and output, but it contributes to the overall purpose of the main system.
子系统是更大系统内部的较小系统。每个子系统都有自己的输入、处理和输出,但它服务于主系统的总体目标。
In a desktop computer, the processor, memory, storage and graphics unit are all sub-systems. The processor itself can be divided into smaller sub-systems such as the control unit and the arithmetic logic unit.
在台式计算机中,处理器、内存、存储和图形单元都是子系统。处理器本身还可以划分为更小的子系统,例如控制单元和算术逻辑单元。
Key sub-systems in a typical computer include the CPU, main memory, secondary storage, input devices and output devices. These sub-systems communicate with each other through buses on the motherboard.
典型计算机中的关键子系统包括 CPU、主存储器、辅助存储器、输入设备和输出设备。这些子系统通过主板上的总线相互通信。
4. Why Decompose a System? | 为什么分解系统?
Decomposition means breaking a large, complex problem or system into smaller, more manageable parts. This process makes a system easier to design, build, test and maintain.
分解是指将一个大型复杂的问题或系统拆分成更小、更易于管理的部分。这个过程使系统更容易设计、构建、测试和维护。
Different teams can work on separate parts at the same time, and a fault is easier to find because it is isolated inside a smaller module. Decomposition also helps programmers understand the problem clearly.
不同团队可以同时处理不同的部分,故障也更容易发现,因为它被隔离在较小的模块中。分解还有助于程序员清晰地理解问题。
Decomposition supports parallel development and reduces complexity. Each smaller part can be understood, solved and tested independently before the whole system is assembled.
分解支持并行开发并降低复杂性。每个较小的部分都可以在组装整个系统之前被独立地理解、解决和测试。
5. Top-down Design | 自顶向下设计
Top-down design is a systematic method of decomposition. It starts from the overall goal and repeatedly breaks the problem into smaller sub-problems until each sub-problem is simple enough to be solved directly.
自顶向下设计是一种系统化的分解方法。它从整体目标开始,反复将问题分解为更小的子问题,直到每个子问题都简单到可以直接解决。
This process produces a hierarchy chart or structure diagram. The top box represents the whole system, and the boxes below show the sub-systems and how they are connected.
这个过程会生成层次图或结构图。顶部的方框代表整个系统,下方的方框表示子系统及其连接方式。
At each refinement step, the designer asks what smaller tasks are needed. The final level is a set of tasks that can be coded directly without further decomposition.
在每一步细化中,设计者都会询问需要哪些更小的任务。最终层是一组可以直接编码而无需进一步分解的任务。
6. Decomposition in Programming | 程序中的分解
In programming, decomposition is implemented by breaking a program into smaller blocks such as functions, procedures and modules. Each block should complete one clear and well-defined task.
在编程中,分解通过将程序拆分为函数、过程和模块等较小的代码块来实现。每个代码块应完成一个清晰且明确的任务。
For example, a calculator program can be decomposed into separate blocks for reading input, performing arithmetic operations, and displaying results. This is much easier to manage than one long sequence of instructions.
例如,一个计算器程序可以分解为读取输入、执行算术运算和显示结果等独立代码块。这比一长串指令更容易管理。
Good decomposition also improves readability. Names such as validate_input or calculate_total tell other programmers exactly what each block does, making the program easier to understand.
良好的分解还能提高可读性。像 validate_input 或 calculate_total 这样的名称可以准确告诉其他程序员每个代码块的功能,使程序更容易理解。
7. Subroutines, Functions and Procedures | 子程序、函数与过程
A subroutine is a named block of code that can be called from a main program. A function is a type of subroutine that returns a value, while a procedure is a subroutine that performs actions but does not return a value.
子程序是一个命名的代码块,可以从主程序中调用。函数是一种返回值的子程序,而过程是执行操作但不返回值的子程序。
In pseudocode, a function might be written as FUNCTION add(a, b) and it returns a + b. A procedure might display a menu on screen. Many programming languages provide both functions and procedures.
在伪代码中,函数可以写作 FUNCTION add(a, b),它返回 a + b。过程可以在屏幕上显示菜单。许多编程语言同时提供函数和过程。
In many languages, a procedure is defined with a name and a body. It is called by writing its name followed by parentheses, and arguments if any are required.
在许多语言中,过程由名称和主体定义。调用时写出其名称,后跟括号,如果需要则加上参数。
8. Parameters and Return Values | 参数与返回值
Parameters are variables passed into a subroutine when it is called. They allow the same subroutine to work with different input data. A return value sends a result from the subroutine back to the caller.
参数是在调用子程序时传入的变量。它们使同一个子程序可以处理不同的输入数据。返回值将结果从子程序发送回调用者。
For example, a function calculate_area(length, width) receives length and width as parameters and returns the product length × width. The caller can use this returned value in further processing.
例如,函数 calculate_area(length, width) 接收 length 和 width 作为参数,并返回乘积 length × width。调用者可以在进一步处理
Published by TutorHao | IGCSE Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导