Computer Systems, Sub-systems and Decomposition | 计算机系统、子系统与分解

📚 Computer Systems, Sub-systems and Decomposition | 计算机系统、子系统与分解

A computer system is far more than a box of electronic components. It is a carefully designed combination of hardware and software that follows a simple yet powerful pattern: input, process and output. To understand how it works, and to write our own programs, we also need to master decomposition – the skill of breaking down a large problem into smaller, solvable pieces. This article explains these essential ideas for the IGCSE Computer Science syllabus.

计算机系统远不止是一盒电子元件。它是硬件与软件的精心组合,遵循一个简单而强大的模式:输入、处理和输出。为了理解它的工作原理并编写我们自己的程序,我们还需要掌握“分解”这一技能——将大型问题拆分为更小、可解决的部分。本文为 IGCSE 计算机科学考纲讲解这些基础概念。

1. What is a Computer System | 什么是计算机系统

A computer system is an electronic device or set of devices that accepts data as input, processes it according to stored instructions, and outputs the results. It includes both hardware (the physical components) and software (the programs and instructions that control the hardware).

计算机系统是一种电子设备或设备组合,它接收数据作为输入,根据存储的指令进行处理,并输出结果。它既包括硬件(物理组件),也包括软件(控制硬件的程序和指令)。

The main components of any computer system are:

任何计算机系统的主要组成部分包括:

  • Input devices, such as a keyboard or mouse | 输入设备,例如键盘或鼠标
  • Output devices, such as a monitor or printer | 输出设备,例如显示器或打印机
  • The CPU (Central Processing Unit) | 中央处理器(CPU)
  • Main memory, including RAM and ROM | 主存储器,包括 RAM 和 ROM
  • Secondary storage, such as a hard disk or solid-state drive | 辅助存储设备,例如硬盘或固态硬盘

A computer system is only useful when all of these parts work together. For example, when a user types on a keyboard (input), the CPU processes the keystrokes, and the result appears on the screen (output).

只有当所有这些部件协同工作时,计算机系统才有用。例如,当用户在键盘上打字(输入)时,CPU 处理按键,结果便显示在屏幕上(输出)。


2. Hardware and Software | 硬件与软件

Hardware refers to the physical, tangible parts of a computer system. You can see and touch a keyboard, a memory chip or a printer. Software, on the other hand, is the set of instructions that tells the hardware what to do. Software cannot be touched; it exists as data stored on storage devices and transferred into memory when running.

硬件指计算机系统中物理的、可触摸的部分。你可以看到并触摸键盘、内存芯片或打印机。另一方面,软件是告诉硬件做什么的指令集合。软件无法被触摸;它作为数据存储在存储设备上,并在运行时被转移到内存中。

Software is divided into two main categories:

软件分为两大类别:

  • System software – manages the hardware and provides a platform for running applications. Examples include operating systems such as Windows or Linux, and utility programs such as device drivers. | 系统软件——管理硬件并为运行应用程序提供平台。示例包括 Windows 或 Linux 等操作系统,以及设备驱动程序等实用程序。
  • Application software – performs specific tasks for the user. Examples include word processors, spreadsheets, web browsers and games. | 应用软件——为用户执行特定任务。示例包括文字处理器、电子表格、网页浏览器和游戏。

In an exam, you may be asked to classify a given item as hardware or software, or to identify whether a piece of software is system software or application software. Always read the question carefully.

在考试中,你可能会被要求将给定项目归类为硬件或软件,或判断某一软件属于系统软件还是应用软件。务必仔细审题。


3. The Input-Process-Output Model | 输入-处理-输出模型

Every computer system, from a pocket calculator to a supercomputer, follows the Input-Process-Output (IPO) model. Understanding this model is the foundation of the whole syllabus.

从袖珍计算器到超级计算机,每台计算机系统都遵循输入-处理-输出(IPO)模型。理解这一模型是整个考纲的基础。

Input → Process → Output

  • Input is when raw data is entered into the system using input devices, for example typing text on a keyboard or scanning a barcode. | 输入是使用输入设备将原始数据输入系统的过程,例如在键盘上输入文字或扫描条形码。
  • Process is when the CPU manipulates the data using a set of instructions. This may involve arithmetic calculations, logical comparisons or sorting data. | 处理是 CPU 使用一组指令对数据进行操作的过程。这可能涉及算术计算、逻辑比较或数据排序。
  • Output is when the results are presented to the user through output devices, such as a monitor, speaker or printer. | 输出是通过显示器、扬声器或打印机等输出设备将结果呈现给用户的过程。

Some systems also include a storage stage. Data can be saved to secondary storage so that it can be retrieved and used again later, which is essential for real-world applications.

有些系统还包括存储阶段。数据可以保存到辅助存储设备中,以便日后检索并再次使用,这对于现实应用是必不可少的。


4. Sub-systems of a Computer | 计算机的子系统

A computer system is too complex to be described as a single unit, so it is divided into sub-systems. Each sub-system has a specific role, and they all communicate with one another through buses and controllers.

计算机系统过于复杂,无法作为单一整体来描述,因此它被划分为多个子系统。每个子系统有特定职责,它们通过总线和控制器相互通信。

Sub-system | 子系统 Main Function | 主要功能
CPU (Central Processing Unit) | 中央处理器 Executes instructions, performs calculations and controls the flow of data | 执行指令、执行计算并控制数据流
Main Memory (RAM & ROM) | 主存储器(RAM 与 ROM) Stores data and instructions temporarily (RAM) and permanently (ROM) | 临时(RAM)或永久(ROM)存储数据与指令
Input Devices | 输入设备 Allow data to be entered into the system, e.g. keyboard, mouse, microphone | 允许数据输入系统,例如键盘、鼠标、麦克风
Output Devices | 输出设备 Present the results to the user, e.g. monitor, printer, speakers | 向用户呈现结果,例如显示器、打印机、扬声器
Secondary Storage | 辅助存储设备 Stores data permanently when the computer is switched off, e.g. HDD, SSD, USB drive | 在计算机关闭时永久保存数据,例如硬盘、固态硬盘、U 盘

Each sub-system can itself be broken down further. For example, the CPU contains the ALU (Arithmetic Logic Unit), the Control Unit and registers. This idea of breaking systems into smaller parts leads naturally to decomposition.

每个子系统本身还可以进一步拆分。例如,CPU 包含算术逻辑单元(ALU)、控制单元和寄存器。这种将系统拆分为更小部分的思想自然引出了“分解”的概念。


5. What is Decomposition | 什么是分解

Decomposition is the process of breaking down a complex problem or system into smaller, more manageable parts. Each part, often called a module or sub-problem, can then be analysed, solved and tested independently.

分解是将一个复杂问题或系统拆分成更小、更易于管理的部分的过程。每个部分(通常称为模块或子问题)随后可以被独立地分析、解决和测试。

For example, the task “write a program to manage a school library” is far too large to write in one go. However, it can be decomposed into smaller tasks such as “track borrowed books”, “calculate overdue fines” and “search for a book by title”. Each of these can be solved step by step.

例如,“编写一个管理学校图书馆的程序”这个任务太大,无法一气呵成。然而,它可以被分解为更小的任务,如“跟踪借出的图书”“计算逾期罚款”和“按书名搜索图书”。每个任务都可以逐步解决。

Decomposition is one of the core principles of computational thinking, alongside abstraction and algorithmic thinking. It is the first step in solving almost any programming problem.

分解是计算思维的核心原则之一,与抽象化和算法思维并列。它几乎是解决任何编程问题的第一步。


6. How to Decompose a Problem | 如何分解问题

To decompose a problem effectively, follow these steps:

要有效分解问题,请遵循以下步骤:

  • Identify the main problem – understand exactly what the final solution must achieve. | 确定主要问题——准确理解最终解决方案必须达到什么目标。
  • Break it into large sub-problems – divide the main problem into a few significant parts. | 将其分解为较大的子问题——将主要问题划分为几个重要部分。
  • Break each sub-problem further – continue dividing until each part is simple enough to be solved directly. | 进一步拆分每个子问题——继续划分,直到每个部分都简单到可以直接解决。
  • Write down the order of steps – consider which parts must be completed first and which depend on others. | 写出步骤顺序——考虑哪些部分必须首先完成,哪些部分依赖于其他部分。

The final result of decomposition is a hierarchy of tasks. At the top is the whole problem; at the bottom are small, clear tasks that can be turned directly into code.

分解的最终结果是一个任务层次结构。最顶层是整个问题;最底层是清晰的小任务,可以直接转化成代码。


7. Benefits of Decomposition | 分解的好处

Decomposition is not just a neat idea – it brings practical benefits that make programming faster, more reliable and easier to maintain.

分解不仅仅是一个巧妙的想法——它带来了实际的好处,使编程更快、更可靠、也更容易维护。

  • Easier to understand – small modules are much simpler to read and analyse than one giant program. | 更易于理解——与一个巨大的程序相比,小模块更易于阅读和分析。
  • Easier to test and debug – each module can be tested separately, so errors are easier to locate and fix. | 更易于测试和调试——每个模块可以单独测试,因此错误更容易定位和修复。
  • Allows teamwork – different programmers can work on different modules at the same time. | 支持团队协作——不同的程序员可以同时处理不同的模块。
  • Code reuse – a well-written module can be used again in other programs, saving time and effort. | 代码复用——编写良好的模块可以在其他程序中再次使用,节省时间和精力。
  • Easier maintenance – if a program needs updating, only the affected module needs to be changed. | 易于维护——如果程序需要更新,只需修改受影响的模块。

These benefits are exactly why large software projects, such as operating systems and banking software, are always developed using decomposition.

正因为这些好处,诸如操作系统和银行软件等大型软件项目总是使用分解来开发。


8. Top-Down Design | 自顶向下设计

Top-down design is a method of problem-solving in which the programmer starts with the overall problem and then refines it step by step into smaller components. It is the practical application of decomposition.

自顶向下设计是一种问题解决方法,程序员从整体问题出发,然后逐步将其细化为更小的组件。它是分解的实际应用。

The process works like this:

该过程如下:

  1. Start with the main task at the highest level. | 从最高层的主要任务开始。

  2. Decide which smaller tasks are needed to complete it. | 确定完成它需要哪些更小的任务。

  3. Repeat the process for each smaller task until the tasks are simple enough to implement directly. | 对每个更小的任务重复这一过程,直到任务简单到可以直接实现。

Top-down design is closely related to modular programming, where a program is built from procedures and functions, each corresponding to one module in the design.

自顶向下设计与模块化编程密切相关。在模块化编程中,程序由过程和函数组成,每个过程或函数对应设计中的一个模块。


9. Structure Diagrams | 结构图

A structure diagram is a graphical tool that shows the top-down decomposition of a problem. It is drawn as a hierarchy, with the main task at the top and subtasks branching below it. Each branch can be divided further until the smallest tasks are shown.

结构图是一种图形化工具,用于展示问题的自顶向下分解。它以层次结构绘制,主任务位于顶部,子任务在下方分支。每个分支可以继续划分,直到显示出最小的任务。

For example, the problem “Make a cup of tea” can be shown as follows:

例如,“泡一杯茶”这个问题可以表示如下:

Make a cup of tea | 泡一杯茶
Boil water
烧水
Prepare cup
准备杯子
Add tea bag
放入茶包
Pour water
倒水
Add milk & sugar
加牛奶和糖

In an exam, you may be given a problem and asked to draw a structure diagram. Remember to show every level of detail and use clear labels. A good rule is: if a sub-task still sounds complicated, it probably needs to be divided again.

在考试中,你可能会被给出一道题目并要求绘制结构图。记住要显示每个细节层次并使用清晰标签。一个好规则是:如果某个子任务听起来仍然复杂,它很可能需要再次拆分。


10. Decomposition in Programming | 编程中的分解

In programming, decomposition is implemented using procedures and functions. A large program is split into smaller modules, each written as a separate procedure or function that performs a single, well-defined task.

在编程中,分解通过过程和函数来实现。一个大型程序被拆分为较小的模块,每个模块作为一个单独的过程或函数编写,执行单一且明确定义的任务。

For example, a program that calculates the average mark of a class of students could be decomposed into the following modules:

例如,一个计算全班学生平均成绩的程序可以分解为以下模块:

  • InputMarks – read the marks from the user | InputMarks——从用户处读取成绩
  • CalculateTotal – add up all the marks | CalculateTotal——将所有成绩相加
  • CalculateAverage – divide the total by the number of students | CalculateAverage——将总分除以学生人数
  • OutputResult – display the average on the screen | OutputResult——在屏幕上显示平均分

Each of these modules is small enough to write, test and debug independently. Once all modules are working, they are combined to form the complete program. This approach greatly reduces the chance of errors and makes the final code far easier to read.

这些模块中的每一个都足够小,可以独立编写、测试和调试。当所有模块都正常工作时,再将它们组合成完整的程序。这种方法大大降低了出错的可能性,并使最终代码更易于阅读。


11. Real-World Example: Systems and Decomposition in Action | 实际案例:系统中的分解

Let us combine both ideas – sub-systems and decomposition – in one practical scenario. Consider a supermarket checkout system.

让我们将这两个概念——子系统与分解——结合到一个实际场景中。考虑一个超市收银系统。

As a computer system: the barcode reader and keyboard are input sub-systems; the CPU and main memory process the item prices and calculate the total; the monitor and receipt printer are output sub-systems; the hard drive stores the product database and daily sales records.

作为计算机系统:条形码扫描器和键盘是输入子系统;CPU 和主存储器处理商品价格并计算总额;显示器和收据打印机是输出子系统;硬盘存储商品数据库和每日销售记录。

As a decomposed program: the checkout program can be broken down into modules such as “scan item”, “look up price”, “calculate total”, “apply discount” and “print receipt”. Each module is developed and tested separately, then linked together.

作为分解后的程序:收银程序可以分解为“扫描商品”“查询价格”“计算总额”“应用折扣”和“打印收据”等模块。每个模块单独开发和测试,然后链接在一起。

This example shows that a computer system is itself a hierarchy of sub-systems, and that the programs running on it are built using the same principle of decomposition.

这个例子表明,计算机系统本身就是一个子系统的层次结构,而运行在系统上的程序也是运用相同的分解原则构建的。


12. Exam Tips and Common Pitfalls | 考试提示与常见错误

Decomposition and computer systems are favourite topics in IGCSE exams, and they appear in both Paper 1 and Paper 2. Here are the most important tips:

分解与计算机系统是 IGCSE 考试中的热门考点,出现在 Paper 1 和 Paper 2 中。以下是最重要的提示:

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