一个计算机系统由一起工作的两部分构成。

- 硬件(hardware)是计算机的物理的(physical)部件——你能触摸的部件。例子:CPU、内存、键盘、屏幕和硬盘。
- 软件(software)是控制计算机并告诉硬件做什么的程序(programs)。
硬件自己不能做任何有用的事。软件需要硬件来运行。两者都需要。


IGCSE 计算机科学 · 第 4 主题
一个计算机系统由一起工作的两部分构成。

硬件自己不能做任何有用的事。软件需要硬件来运行。两者都需要。


| 英文 | 中文 | 拼音 |
|---|---|---|
| Hardware | 硬件 | yìng jiàn |
| physical | 物理的 | wù lǐ de |
| Software | 软件 | ruǎn jiàn |
| programs | 程序 | chéng xù |
| Candidates should be able to: | Notes and guidance |
|---|---|
| 1 Describe the difference between system software and application software and provide examples of each | • System software provides the services that the computer requires, including operating system and utility software • Application software provides the services that the user requires |
| 2 Describe the role and basic functions of an operating system | • Including: – managing files – handling interrupts – providing an interface – managing peripherals and drivers – managing memory – managing multitasking – providing a platform for running applications – providing system security – managing user accounts |
| 3 Understand how hardware, firmware and an operating system are required to run applications software | • Applications are run on the operating system • The operating system is run on the firmware • The bootloader (firmware) is run on the hardware |
| 4 Describe the role and operation of interrupts | • Including: – how an interrupt is generated – how it is handled using an interrupt service routine – what happens as a result of the interrupts • Software interrupts include division by zero and two processes trying to access the same memory location • Hardware interrupts include pressing a key on the keyboard and moving the mouse |
来源:剑桥国际大纲
软件分成两种类型。

系统软件(system software)控制计算机本身并给其他程序一个运行的基础。例子:
操作系统之下是固件(firmware)——永久存储在 ROM 或闪存上、计算机一开机就运行的软件。BIOS 和引导程序(bootloader)就是固件:它们测试硬件然后加载操作系统。所以各层堆叠成硬件 → 固件 → 操作系统 → 应用软件,每一层都在它下面的层上运行。
应用软件(application software)让用户做一个有用的任务。例子:
| 系统软件 | 应用软件 | |
|---|---|---|
| 工作 | 运行和管理计算机 | 帮助用户做一个任务 |
| 被谁使用 | 计算机(在后台) | 用户(直接) |
| 例子 | 操作系统、驱动、实用程序 | 文字处理器、浏览器、游戏 |
| 英文 | 中文 | 拼音 |
|---|---|---|
| System software | 系统软件 | xì tǒng ruǎn jiàn |
| operating system | 操作系统 | cāo zuò xì tǒng |
| linker | 链接器 | liàn jiē qì |
| device driver | 设备驱动程序 | shè bèi qū dòng chéng xù |
| utility software | 实用程序 | shí yòng chéng xù |
| firmware | 固件 | gù jiàn |
| bootloader | 引导程序 | yǐn dǎo chéng xù |
| Application software | 应用软件 | yìng yòng ruǎn jiàn |
| word processing | 文字处理 | wén zì chǔ lǐ |
| spreadsheet | 电子表格 | diàn zi biǎo gé |
| database management system | 数据库管理系统 | shù jù kù guǎn lǐ xì tǒng |
| web browser | 网页浏览器 | wǎng yè liú lǎn qì |
| providing a user interface | 用户界面 | yòng hù jiè miàn |
| managing peripherals | 外围设备 | wài wéi shè bèi |
| managing multitasking | 多任务处理 | duō rèn wù chǔ lǐ |
| providing a platform | 平台 | píng tái |
一个操作系统(OS)是主要的系统软件。它控制整个计算机并让硬件、应用软件和用户一起工作。没有一个 OS,计算机很难使用。

OS 有许多作用:
| 英文 | 中文 | 拼音 |
|---|---|---|
| user interface | 用户界面 | yòng hù jiè miàn |
| peripherals | 外围设备 | wài wéi shè bèi |
| multitasking | 多任务处理 | duō rèn wù chǔ lǐ |
| platform | 平台 | píng tái |
一个中断(interrupt)是发送给处理器(processor)的一个信号,告诉它某样东西现在需要注意。
一个中断能来自三个来源:
当一个中断到达时,处理器停止它正在做的事、保存它的位置,并服务(处理)中断。当那完成时,它回到它之前正在做的事。这让计算机对重要的事件快速反应。

Step through an interrupt. The CPU pauses what it's doing, deals with the urgent event, then carries on exactly where it left off — which is how one processor juggles the keyboard, printer and timer at once.
| 英文 | 中文 | 拼音 |
|---|---|---|
| interrupt | 中断 | zhōng duàn |
| processor | 处理器 | chǔ lǐ qì |
| Candidates should be able to: | Notes and guidance |
|---|---|
| 1 Explain what is meant by a high-level language and a low-level language, including the advantages and disadvantages of each | • Advantages and disadvantages include: – ease of reading and writing code, e.g. low-level is hard to read – ease of debugging code – machine independence – direct manipulation of hardware |
| 2 Understand that assembly language is a form of low-level language that uses mnemonics, and that an assembler is needed to translate an assembly language program into machine code | |
| 3 Describe the operation of a compiler and an interpreter, including how high-level language is translated by each and how errors are reported | • A compiler translates the whole code at once before executing it, producing an executable file • An interpreter translates and executes the code line-by-line • A compiler provides an error report for the whole code if errors are detected • An interpreter stops execution when an error is found |
| 4 Explain the advantages and disadvantages of a compiler and an interpreter | • Including an understanding that an interpreter is mostly used when developing a program and a compiler is used to translate the final program |
| 5 Explain the role of an IDE in writing program code and the common functions IDEs provide | • Including: – code editors – run-time environment – translators – error diagnostics – auto-completion – auto-correction – prettyprint |
来源:剑桥国际大纲
所有计算机用中央处理器(central processing unit,CPU)处理数据。要使 CPU 做工作,人们用一门编程语言(programming language)写程序。有两种。
一门高级语言(high-level language)用看起来有点像英语的词书写(例如 Python)。它是:
一门低级语言(low-level language)接近硬件实际使用的。它包括:
一门低级语言与特定的(specific)类型的 CPU 相关,所以为一个 CPU 写的程序可能不在另一个上运行。它在程序员需要对硬件的完全控制或非常快、小的代码时使用。

Classify concrete examples by the computing idea they demonstrate.
| 英文 | 中文 | 拼音 |
|---|---|---|
| central processing unit | 中央处理器 | zhōng yāng chǔ lǐ qì |
| programming language | 编程语言 | biān chéng yǔ yán |
| high-level language | 高级语言 | gāo jí yǔ yán |
| low-level language | 低级语言 | dī jí yǔ yán |
| machine code | 机器码 | jī qì mǎ |
| assembly language | 汇编语言 | huì biān yǔ yán |
| specific | 特定的 | tè dìng de |
CPU 只能运行机器码。一个高级程序必须先被变成机器码。做这个的软件是一个翻译程序(translator)。有三种类型:编译器和解释器(用于高级代码),以及汇编器(用于低级代码)。
一个编译器在程序被运行之前把整个程序翻译成机器码。翻译之后,机器码能被运行许多次而不再翻译。
一个解释器(interpreter)一次一行地翻译并运行程序。
| 编译器 | 解释器 | |
|---|---|---|
| 翻译 | 整个程序一次 | 一次一行 |
| 错误 | 全部在结束时报告 | 在第一个错误停止 |
| 完成程序的速度 | 更快 | 更慢 |
| 以后运行需要? | 否 | 是 |
当你想分享一个快速的、完成的程序时用一个编译器。当你在写和测试一个程序、想容易地找到错误时用一个解释器。
一个汇编器(assembler)把一个低级汇编语言程序(用像 LDA、ADD 这样的助记符写成)翻译成机器码。每个助记符变成一条机器指令——一个直接的一对一翻译,不像处理高级代码的编译器或解释器。

例题。 一个团队正在编写程序。开发期间他们希望快速找到并修复错误;发布时他们希望客户运行得快,并且看不到源代码。每个阶段各适合哪种翻译器?开发时用解释器:它一次翻译并运行一行,遇到第一个错误就停下,所以错误很容易定位。发布时用编译器:它把整个程序一次性翻译成机器码,之后无需翻译器就能快速运行,而且客户拿到的只是可执行文件,不是源代码。两者不是对手 - 要说出阶段并给出理由,因为只写"编译器更快"是得不到分的。
| 英文 | 中文 | 拼音 |
|---|---|---|
| compiler | 编译器 | biān yì qì |
| translator | 翻译程序 | fān yì chéng xù |
| interpreter | 解释器 | jiě shì qì |
| assembler | 汇编器 | huì biān qì |
一个集成开发环境(integrated development environment,IDE)是帮助你写程序的软件。它把许多有用的工具放在一个地方:

| 英文 | 中文 | 拼音 |
|---|---|---|
| integrated development environment | 集成开发环境 | jí chéng kāi fā huán jìng |
| code editor | 代码编辑器 | dài mǎ biān jí qì |
| run time environment | 运行时环境 | yùn xíng shí huán jìng |
| error diagnostics | 错误诊断 | cuò wù zhěn duàn |
| auto-completion | 自动补全 | zì dòng bǔ quán |
| auto-correction | 自动纠错 | zì dòng jiū cuò |
| prettyprinting | 美化打印 | měi huà dǎ yìn |
逐步学习,并即时检测练习。