跳到主要内容

软件

IGCSE 计算机科学 · 第 4 主题

训练
讲义 词汇表
4.1

硬件与软件

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

硬件是物理部件(CPU、键盘);软件是程序(应用、OS)
硬件是物理部件;软件是程序
  • 硬件(hardware)是计算机的物理的(physical)部件——你能触摸的部件。例子:CPU、内存、键盘、屏幕和硬盘。
  • 软件(software)是控制计算机并告诉硬件做什么的程序(programs)。

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

一个计算机主板,带它的芯片、插槽和连接器
主板和附着到它的部件是硬件——你能触摸的物理部件
屏幕上一个桌面操作系统
一个操作系统是软件——告诉硬件做什么的程序
词汇表 训练
英文 中文 拼音
Hardware 硬件 yìng jiàn
physical 物理的 wù lǐ de
Software 软件 ruǎn jiàn
programs 程序 chéng xù
4.1

软件类型与中断

大纲
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

系统软件(system software)控制计算机本身并给其他程序一个运行的基础。例子:

  • 操作系统(operating system,见下面);
  • 编译器(compiler)和链接器(linker,把程序变成计算机能运行的一个形式的工具);
  • 设备驱动程序(device driver)——让操作系统控制一件硬件的软件;
  • 实用程序(utility software)——照料计算机的小工具(例如防病毒、备份、磁盘清理)。

操作系统之下是固件(firmware)——永久存储在 ROM 或闪存上、计算机一开机就运行的软件。BIOS引导程序(bootloader)就是固件:它们测试硬件然后加载操作系统。所以各层堆叠成硬件 → 固件 → 操作系统 → 应用软件,每一层都在它下面的层上运行。

Application software

应用软件(application software)让用户做一个有用的任务。例子:

  • 文字处理(word processing)软件(写文档);
  • 电子表格(spreadsheet)软件(在一个网格中处理数字);
  • 数据库管理系统(database management system,存储和搜索数据);
  • 网页浏览器(web browser,查看网页)。
系统软件 应用软件
工作 运行和管理计算机 帮助用户做一个任务
被谁使用 计算机(在后台) 用户(直接)
例子 操作系统、驱动、实用程序 文字处理器、浏览器、游戏
词汇表 训练
英文 中文 拼音
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
4.1

操作系统

一个操作系统(OS)是主要的系统软件。它控制整个计算机并让硬件、应用软件和用户一起工作。没有一个 OS,计算机很难使用。

四个堆叠的层——用户在顶部,然后应用软件,然后操作系统,然后底部硬件
操作系统坐在硬件和应用软件及用户之间,让它们一起工作

OS 有许多作用:

  • 管理文件——保存、打开、命名、移动和删除文件;
  • 处理中断(见下面);
  • 提供一个用户界面(user interface),所以用户能控制计算机;
  • 管理内存——决定 RAM 中保留什么、在哪里;
  • 管理外围设备(peripherals)及它们的驱动——控制像打印机的设备;
  • 管理多任务处理(multitasking)——让几个程序一次运行;
  • 提供一个平台(platform)用于运行应用软件;
  • 管理安全——用户账户、密码和访问权限。
词汇表 训练
英文 中文 拼音
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
4.1

中断

一个中断(interrupt)是发送给处理器(processor)的一个信号,告诉它某样东西现在需要注意。

一个中断能来自三个来源:

  • 硬件——例如一个键被按下,或一台打印机用完纸;
  • 软件——例如一个程序试图除以零;
  • 用户——例如用户按一个"取消"键。

当一个中断到达时,处理器停止它正在做的事、保存它的位置,并服务(处理)中断。当那完成时,它回到它之前正在做的事。这让计算机对重要的事件快速反应。

一个循环:主程序运行,然后在一个中断上 CPU 保存它的状态、运行中断服务例程、恢复状态并恢复运行
在一个中断上 CPU 保存它的位置、运行中断服务例程,然后恢复它的位置并继续
探索

How the CPU handles an interrupt

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ì
4.2

编程语言类型、翻译程序与集成开发环境(IDE) (IDEs)

大纲
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 languages

一门高级语言(high-level language)用看起来有点像英语的词书写(例如 Python)。它是:

  • 对人们容易读、写和修复;
  • 独立于计算机——同一个程序能在不同类型的计算机上运行。

Low-level languages

一门低级语言(low-level language)接近硬件实际使用的。它包括:

  • 机器码(machine code)——用二进制(0 和 1)书写的指令,CPU 直接运行它;
  • 汇编语言(assembly language)——用短的词代码(助记符)而不是二进制书写的机器码。

一门低级语言与特定的(specific)类型的 CPU 相关,所以为一个 CPU 写的程序可能不在另一个上运行。它在程序员需要对硬件的完全控制或非常快、小的代码时使用。

三个堆叠的层:高级语言在顶部,然后汇编,然后底部机器码
高级语言接近人类语言并在任何计算机上运行;低级语言(汇编和机器码)接近硬件并绑定到一种类型的 CPU
探索

Computing concept lab

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
4.2

翻译程序

CPU 只能运行机器码。一个高级程序必须先被变成机器码。做这个的软件是一个翻译程序(translator)。有三种类型:编译器和解释器(用于高级代码),以及汇编器(用于低级代码)。

Compiler

一个编译器在程序被运行之前整个程序翻译成机器码。翻译之后,机器码能被运行许多次而不再翻译。

  • 翻译一次性发生,完整地;
  • 它在翻译结束时一起报告所有的错误;
  • 完成的程序运行快,而且不需要编译器来运行。

Interpreter

一个解释器(interpreter)一次一行地翻译并运行程序。

  • 它在它找到的第一个错误停止,这在测试时有帮助;
  • 程序运行更慢,因为它每次运行都被翻译;
  • 每次程序运行时解释器都必须在场。
编译器 解释器
翻译 整个程序一次 一次一行
错误 全部在结束时报告 在第一个错误停止
完成程序的速度 更快 更慢
以后运行需要?

当你想分享一个快速的、完成的程序时用一个编译器。当你在写和测试一个程序、想容易地找到错误时用一个解释器

Assembler

一个汇编器(assembler)把一个低级汇编语言程序(用像 LDAADD 这样的助记符写成)翻译成机器码。每个助记符变成一条机器指令——一个直接的一对一翻译,不像处理高级代码的编译器或解释器。

编译器把整个程序一次翻译成运行许多次的机器码,对一个解释器一次一行地翻译并运行
一个编译器把整个程序一次翻译成机器码;一个解释器一次一行地翻译并运行

例题。 一个团队正在编写程序。开发期间他们希望快速找到并修复错误;发布时他们希望客户运行得快,并且看不到源代码。每个阶段各适合哪种翻译器?开发时用解释器:它一次翻译并运行一行,遇到第一个错误就停下,所以错误很容易定位。发布时用编译器:它把整个程序一次性翻译成机器码,之后无需翻译器就能快速运行,而且客户拿到的只是可执行文件,不是源代码。两者不是对手 - 要说出阶段并给出理由,因为只写"编译器更快"是得不到分的。

词汇表 训练
英文 中文 拼音
compiler 编译器 biān yì qì
translator 翻译程序 fān yì chéng xù
interpreter 解释器 jiě shì qì
assembler 汇编器 huì biān qì
4.2

集成开发环境(IDE)

一个集成开发环境(integrated development environment,IDE)是帮助你写程序的软件。它把许多有用的工具放在一个地方:

  • 一个代码编辑器(code editor)——用于键入你的程序;
  • 一个运行时环境(run time environment)——用于运行程序以测试它;
  • 一个翻译程序(translator)——一个编译器或解释器把你的代码变成机器码;
  • 错误诊断(error diagnostics)——帮助你找到并理解错误的消息;
  • 自动补全(auto-completion)和自动纠错(auto-correction)——IDE 在你键入时完成或修复代码;
  • 美化打印(prettyprinting)——用颜色和缩进整齐地布置代码,使它容易阅读。
Source code in an editor: an IDE combines editor, debugger and run tools in one place
Source code in an editor: an IDE combines editor, debugger and run tools in one place
词汇表 训练
英文 中文 拼音
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
4.2

考试技巧

  • 硬件是物理部件;软件是程序。系统软件运行计算机(OS、驱动、实用程序);应用软件为用户做一个任务。
  • 一个编译器把整个程序一次翻译(完成的程序运行快,而所有错误在结束时报告);一个解释器逐行翻译(它在第一个错误停止、运行更慢,而且每次都需要)。
  • 高级语言接近英语并在任何计算机上运行;低级语言(汇编、机器码)绑定到一种类型的 CPU。
  • 一个中断是使 CPU 停止、保存它的位置、服务事件,然后在它离开的地方继续的一个信号。
  • 学习操作系统的作用:管理文件、内存、外围设备、多任务处理、安全和用户界面。

本主题的互动课程

逐步学习,并即时检测练习。

IGCSE 计算机科学历年真题

IGCSE 计算机科学的更多主题

登录或创建账号

IGCSE, A-Level & AP