📚 Year 8 CIE Computer Science: Essential Formulas & Principles Quick-Reference Guide | Year 8 CIE 计算机:公式定理速查手册
Welcome to your go-to reference for the key formulas, theorems, and fundamental principles required in the Year 8 Cambridge International (CIE) Computer Science curriculum. This guide distils core concepts into clear, digestible pairings of English and Chinese explanations, helping you build a solid foundation in computational thinking, data representation, and digital systems.
欢迎使用 Year 8 剑桥国际(CIE)计算机科学课程所需的公式、定理和基本原理速查手册。本指南将核心概念提炼为清晰易懂的中英文对照解释,帮助你为计算思维、数据表示和数字系统打下坚实基础。
1. Binary Representation Basics | 二进制表示基础
Binary is a base‑2 number system that uses only the digits 0 and 1. Each position represents a power of two, starting from 2⁰ on the right. Understanding binary is essential because all digital computers store and process data in binary form.
二进制是一种基数为 2 的数字系统,仅使用数字 0 和 1。每一位代表 2 的幂,从最右侧的 2⁰ 开始。理解二进制至关重要,因为所有数字计算机都以二进制形式存储和处理数据。
(1 × 2³) + (0 × 2²) + (1 × 2¹) + (1 × 2⁰) = 8 + 0 + 2 + 1 = 11 in decimal. The subscript ₂ is often used to indicate a binary number.
要将二进制数转换为十进制,将每个二进制数字乘以其位值并求和。例如,二进制数 1011₂ 等于 (1 × 2³) + (0 × 2²) + (1 × 2¹) + (1 × 2⁰) = 8 + 0 + 2 + 1 = 十进制 11。下标 ₂ 通常用于表示二进制数。
A single binary digit is called a bit, and a group of 8 bits is known as a byte. Nibbles (4 bits) are also used as a convenient half‑byte measure.
单个二进制数字称为一位(bit),一组 8 位称为一个字节(byte)。半字节(nibble,4 位)也常用作方便的半个字节度量单位。
2. Denary ↔ Binary Conversion Theorem | 十进制 ↔ 二进制转换定理
Any positive integer can be expressed uniquely as a sum of distinct powers of two. This existence and uniqueness theorem guarantees that every decimal integer has exactly one binary representation when leading zeros are ignored.
任何正整数都可以唯一地表示为不同 2 的幂之和。这个存在与唯一性定理保证了每个十进制整数在忽略前导零时,都有且仅有一个二进制表示。
To convert a denary number to binary, use the repeated division‑by‑ m to top to obtain the binary equivalent. For instance, 13 in decimal: 13 ÷ 2 = 6 remainder 1; 6 ÷ 2 = 3 remainder 0; 3 ÷ 2 = 1 remainder 1; 1 ÷ 2 = 0 remainder 1. Reading upwards gives 1101₂.
要将十进制数转换为二进制,使用重复除二法:将数除以 2,记录余数(0 或 1),继续除商直至商为 0。从下往上读余数即得二进制等价形式。例如,十进制 13:13 ÷ 2 = 6 余 1;6 ÷ 2 = 3 余 0;3 ÷ 2 = 1 余 1;1 ÷ 2 = 0 余 1。向上读得 1101₂。
3. Binary Addition Rules | 二进制加法规则
Binary addition follows four simple rules that mirror denary addition but with a base of 2. These rules underpin the arithmetic logic unit (ALU) operations inside a CPU.
二进制加法遵循四条简单规则,这些规则与十进制加法相似,但基数为 2。这些规则是 CPU 内部算术逻辑单元(ALU)运算的基础。
- 0 + 0 = 0 (0 plus 0 equals 0 / 0 加 0 等于 0)
- 0 + 1 = 1 (0 plus 1 equals 1 / 0 加 1 等于 1)
- 1 + 0 = 1 (1 plus 0 equals 1 / 1 加 0 等于 1)
- 1 + 1 = 10₂, i.e., 0 with a carry of 1 to the next column (1 加 1 等于 10₂,即 0 并向下一列进 1)
When adding multi‑bit numbers, align columns and handle carries as in decimal addition. Overflow occurs when the result exceeds the available number of bits, which is a key concept in understanding fixed‑width binary storage.
多位二进制数相加时,对齐各列并按十进制加法的方式处理进位。当结果超出可用位数时会发生溢出,这是理解定宽二进制存储的关键概念。
An overflow flag in the CPU is set when an arithmetic operation produces a result that is too large to be represented within the allocated bit width. For 8‑bit unsigned numbers, values range from 0 to 255, so 128 + 130 would overflow.
当算术运算产生的结果过大,无法在分配的位宽内表示时,CPU 中的溢出标志会被置位。对于 8 位无符号数,取值范围为 0 到 255,因此 128 + 130 会产生溢出。
4. Logic Gate Truth Tables | 逻辑门真值表
Logic gates are the fundamental building blocks of digital circuits. Each gate implements a specific Boolean function, and its behaviour is completely described by a truth table. CIE Year 8 expects fluency with NOT, AND, OR, NAND, and NOR gates.
逻辑门是数字电路的基本构建模块。每种门实现特定的布尔函数,其行为完全由真值表描述。CIE Year 8 要求熟练掌握 NOT、AND、OR、NAND 和 NOR 门。
The NOT gate (inverter) has one input and produces the opposite logical value. The AND gate outputs 1 only when all inputs are 1. The OR gate outputs 1 when at least one input is 1.
NOT 门(反相器)有一个输入,产生相反的逻辑值。AND 门仅当所有输入为 1 时输出 1。OR 门当至少一个输入为 1 时输出 1。
NAND and NOR are universal gates, meaning any Boolean circuit can be constructed using only NAND gates or only NOR gates. A NAND gate is an AND followed by a NOT; its output is 0 only when all inputs are 1. A NOR gate is an OR followed by a NOT; its output is 1 only when all inputs are 0.
NAND 和 NOR 是通用门,意味着任何布尔电路都可以仅用 NAND 门或仅用 NOR 门构建。NAND 门是 AND 后接 NOT;仅当所有输入为 1 时输出 0。NOR 门是 OR 后接 NOT;仅当所有输入为 0 时输出 1。
| A | B | AND | OR | NAND | NOR |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 | 0 |
5. Boolean Expression Forms | 布尔表达式形式
A Boolean expression can be written in Sum‑of‑Products (SOP) form, where several AND terms are ORed together. The notation uses a dot (·) for AND, a plus (+) for OR, and an overbar or tilde (~) for NOT. For example, (A · B) + (~A · C) is an SOP expression.
布尔表达式可以写成积之和(SOP)形式,即将多个 AND 项进行 OR 运算。此符号体系用点(·)表示 AND,加号(+)表示 OR,上划线或波浪号(~)表示 NOT。例如,(A · B) + (~A · C) 是一个 SOP 表达式。
De Morgan' Laws are critical theorems for simplifying and transforming logic expressions. They state: ~(A · B) = ~A + ~B and ~(A + B) = ~A · ~B. These laws allow conversion between AND‑OR forms and NAND‑NOR forms.
德摩根定律是简化和转换逻辑表达式的关键定理。定律表明:~(A · B) = ~A + ~B 以及 ~(A + B) = ~A · ~B。这些定律允许在 AND‑OR 形式与 NAND‑NOR 形式之间进行转换。
Proof of De Morgan's Laws can be verified using truth tables; all possible input combinations yield identical outputs for both sides of each equation. This is fundamental to digital circuit design and optimization.
德摩根定律的证明可使用真值表验证;所有可能的输入组合在等式两边都产生相同的输出。这是数字电路设计与优化的基础。
6. Storage Units and Data Measurement | 存储单位与数据计量
Digital storage is quantified using a hierarchy of units based on powers of two, although storage manufacturers often use decimal prefixes. The CIE curriculum distinguishes between kibibytes (KiB) and kilobytes (kB).
数字存储使用基于 2 的幂的单位层级来量化,尽管存储制造商常使用十进制前缀。CIE 课程区分千比字节(KiB)和千字节(kB)。
| Unit / 单位 | Symbol / 符号 | Equivalent / 等价 |
|---|---|---|
| bit | b | 0 or 1 |
| byte | B | 8 bits |
| kilobyte (kB) | kB | 10³ bytes = 1000 B |
| kibibyte (KiB) | KiB | 2¹⁰ bytes = 1024 B |
| megabyte (MB) | MB | 10⁶ bytes |
| mebibyte (MiB) | MiB | 2²⁰ bytes |
File size estimations rely on these units. A simple ASCII text file storing 1000 characters requires approximately 1000 bytes, as each character typically occupies 1 byte. High‑resolution colour images can be several megabytes depending on pixel depth and compression.
文件大小估算依赖这些单位。一个存储 1000 个字符的简单 ASCII 文本文件大约需要 1000 字节,因为每个字符通常占用 1 字节。高分辨率彩色图像根据像素深度和压缩方式,可能达到数兆字节。
7. Network Transmission Rate Formula | 网络传输速率公式
e (bits per second, bps). This formula assumes ideal conditions with no packet loss, latency, or protocol overhead.
通过网络传输文件所需的理论时间由以下关系给出:时间(秒)= 文件大小(位)/ 传输速率(位每秒,bps)。此公式假设理想条件,无丢包、延迟或协议开销。
0⁶ bits for decimal definition) before calculation. Always check whether the question expects decimal or binary interpretation.
注意单位转换。若文件大小以兆字节给出,而传输速度以兆位每秒表示,需先将文件大小转换为位(十进制定义下 1 MB = 8 × 10⁶ 位)再计算。务必确认题目要求十进制还是二进制解释。
Latency and bandwidth together determine real‑world transfer performance. Bandwidth is the maximum data transfer rate, while latency is the delay before data begins to arrive after a request.
延迟和带宽共同决定现实世界的传输性能。带宽是最大数据传输速率,而延迟是请求发出后,数据开始到达之前的时延。
8. Algorithm Efficiency: Big O Notation Basics | 算法效率:大 O 表示法基础
Big O notation describes the performance of an algorithm as the input size grows, focusing on the worst‑case scenario. It abstracts away constant factors and gives the order of growth of time or space requirements.
大 O 表示法描述随着输入规模增长时算法的性能,重点关注最坏情况。它抽象掉常数因子,给出时间或空间需求增长的数量级。
Common complexities expected at Year 8 level are O(1) (constant time), O(n) (linear time), and O(n²) (quadratic time). A linear search on an unsorted list runs in O(n), while a simple bubble sort runs in O(n²) comparisons.
Year 8 阶段应掌握的常见复杂度有 O(1)(常数时间)、O(n)(线性时间)和 O(n²)(平方时间)。对未排序列表的线性搜索运行在 O(n),而简单的冒泡排序比较次数为 O(n²)。
Understanding algorithmic complexity helps to choose efficient solutions. For instance, a library database of 10 000 books searched linearly may examine all items on average, whereas a binary search on a sorted list completes in O(log n) steps. Although formal analysis of O(log n) is advanced, the Year 8 student appreciates that repeated halving is much faster.
理解算法复杂度有助于选择高效方案。例如,一个包含 10 000 本书的图书馆数据库,若线性搜索平均需检查所有项,而对已排序列表的二分搜索只需 O(log n) 步即可完成。虽然 O(log n) 的形式分析较深,Year 8 学生可以认识到重复折半快得多。
9. CPU Fetch‑Decode‑Execute Cycle | CPU 取指‑译码‑执行周期
The central processing unit operates in a continuous loop known as the fetch‑decode‑execute cycle. This is the fundamental rhythm of a Von Neumann architecture computer controlling how instructions are processed.
中央处理器在一个称为取指‑译码‑执行周期的连续循环中运行。这是冯·诺依曼架构计算机控制指令处理方式的基本节律。
- Fetch: The control unit retrieves the next instruction from memory (RAM) and places it in the instruction register. The program counter (PC) holds the address and increments. / 取指:控制单元从内存(RAM)中取出下一条指令并放入指令寄存器。程序计数器(PC)保存地址并自增。
- Decode: The control unit interprets the instruction's opcode and determines what operation must be performed. / 译码:控制单元解释指令的操作码,确定必须执行何种操作。
- Execute: The ALU carries out the operation, which may involve reading from or writing to memory locations, performing arithmetic or logic, or changing the program counter for a jump. / 执行:ALU 执行操作,可能涉及读取或写入内存位置、执行算术或逻辑运算、或为跳转更改程序计数器。
Each cycle completes one machine‑level instruction. The clock speed (measured in GHz) determines how many such cycles can occur per second.
每个周期完成一条机器级指令。时钟速度(以 GHz 度量)决定每秒可发生多少个这样的周期。
10. Error Detection: Parity and Checksum Principles | 错误检测:奇偶校验与校验和原理
Data corruption during transmission or storage can be detected using simple redundancy methods. Parity bits and checksums are the two primary techniques introduced at Year 8 level.
传输或存储期间的数据损坏可使用简单的冗余方法进行检测。奇偶校验位和校验和是 Year 8 阶段引入的两种主要技术。
Parity check: An extra bit is appended to a binary sequence to make the total number of 1s either even (even parity) or odd (odd parity). The receiver counts the 1s and flags an error if the parity does not match the expected scheme. For example, '100 0001' (7‑bit ASCII 'A') has two 1s; with even parity the parity bit is 0, giving '0 100 0001'. If a single bit flips during transfer, parity fails. However, if two bits flip, parity may remain consistent, so this method cannot detect all errors.
奇偶校验:在二进制序列后附加一个额外位,使 1 的总数为偶数(偶校验)或奇数(奇校验)。接收方统计 1 的个数,若奇偶性与预期方案不符则标记错误。例如,'100 0001'(7 位 ASCII 中的 'A')有两个 1;采用偶校验时校验位为 0,得到 '0 100 0001'。若传输中单一位翻转,奇偶校验失败。但若两位翻转,奇偶性可能保持一致,故此方法无法检测所有错误。
Checksum: All data bytes are summed, and the low‑order byte of the sum is sent alongside the data. The receiver computes the sum again and compares; a mismatch indicates an error. Checksums detect more complex errors than simple parity but still fail with compensating errors where changes cancel out.
校验和:将所有数据字节求和,将和的低位字节随数据一同发送。接收方重新计算总和并比较;不匹配则指示有错误。校验和能比简单奇偶校验检测更复杂的错误,但在变更相互抵消的补偿性错误下仍会失效。
11. Basic Programming Constructs: Sequence, Selection, Iteration | 基本编程结构:顺序、选择与迭代
The Structured Programming Theorem states that any algorithm can be expressed using only three constructs: sequence (one statement after another), selection (if‑then‑else), and iteration (loops). These constructs form the backbone of all procedural code.
结构化程序定理表明,任何算法都可以仅用三种结构表达:顺序(一条语句接一条)、选择(if‑then‑else)和迭代(循环)。这些结构构成所有过程式代码的骨架。
Sequence executes instructions in the order they appear. Selection controls branching based on Boolean conditions. Iteration repeats a block of code: a for‑loop repeats a known number of times; a while‑loop continues as long as a condition remains true.
顺序结构按指令出现的次序执行。选择结构根据布尔条件控制分支。迭代结构重复一个代码块:for 循环重复已知次数;while 循环只要条件为真就继续执行。
Understanding these constructs allows you to trace through a given piece of pseudocode and predict its output. Practice writing trace tables to follow variable values step‑by‑step, which is a core skill for CIE examinations.
理解这些结构使你能够追踪给定的伪代码片段并预测其输出。练习编写追踪表,逐步跟踪变量值,这是 CIE 考试的核心技能。
12. Data Compression Concepts: Lossy vs Lossless | 数据压缩概念:有损与无损
Data compression reduces file size to save storage space or transmission time. The two fundamental strategies are lossless and lossy compression, and choosing between them involves trade‑offs between quality and size.
数据压缩通过减小文件大小来节省存储空间或缩短传输时间。两种基本策略是无损压缩和有损压缩,在它们之间选择涉及质量与体积之间的权衡。
Lossless compression (e.g., ZIP, PNG, run‑length encoding) preserves the original data exactly; when decompressed, the file is bit‑for‑bit identical. It relies on eliminating statistical redundancy without discarding information. Run‑length encoding replaces repeating sequences with a count and value: 'AAAAA' becomes '5A'.
无损压缩(例如 ZIP、PNG、游程编码)精确保留原始数据;解压后文件逐位完全相同。它依赖消除统计冗余而不丢弃信息。游程编码将重复序列替换为计数和值:'AAAAA' 变为 '5A'。
Lossy compression (e.g., JPEG, MP3) discards less perceptually significant data to achieve far smaller file sizes. The decompressed data is different from the original, but the difference is designed to be imperceptible or acceptable to human senses. The key formula is that greater compression ratios increase compression artefacts.
有损压缩(例如 JPEG、MP3)丢弃感知上不太重要的数据以大幅减小文件大小。解压后的数据与原始数据不同,但这一差异被设计为人类感官不可察觉或可接受。关键公式在于,压缩比越大,压缩伪影越多。
13. Image Representation: Resolution, Colour Depth, File Size | 图像表示:分辨率、色深、文件大小
A bitmap image is a grid of pixels, each assigned a binary colour value. Two key parameters determine image quality and storage requirements: resolution and colour depth.
位图图像是一个像素网格,每个像素分配有一个二进制颜色值。两个关键参数决定图像质量和存储需求:分辨率和色深。
th, measured in bits per pixel (bpp), defines how many distinct colours each pixel can represent. With n bits per pixel, the image supports 2ⁿ distinct colours.
分辨率是像素总数,通常表示为 宽 × 高(例如 1920 × 1080)。色深以每像素位数(bpp)度量,定义每个像素可表示多少种不同颜色。每像素 n 位时,图像支持 2ⁿ 种不同颜色。
ht × colour depth. To convert to bytes, divide by 8. For example, an 800 × 600 image at 24‑ 1 520 000 bits, or 1 440 000 bytes (≈ 1.44 MB). Metadata and headers add a small overhead.
位图的原始未压缩文件大小可估算为:文件大小(位)= 宽 × 高 × 色深。要转换为字节,除以 8。例如,一幅 800 × 600、24 位色的图像需要 800 × 600 × 24 = 11 520 000 位,即 1 440 000 字节(≈ 1.44 MB)。元数据和文件头会增加少量开销。
14. Cybersecurity Principles: CIA Triad | 网络安全原理:CIA 三元组
The CIA triad – Confidentiality, Integrity, and Availability – is the foundational model guiding information security policies and measures. Every cybersecurity control aims to protect one or more of these three properties.
CIA 三元组——保密性、完整性和可用性——是指导信息安全策略与措施的基础模型。每种网络安全控制都旨在保护这三个属性中的一个或多个。
Confidentiality ensures data is accessible only to authorised parties. Encryption, access controls, and two‑factor authentication (2FA) help preserve confidentiality. Integrity ensures data remains accurate and unaltered; hashing algorithms and digital signatures detect unauthorised modifications. Availability means authorised users can access systems and data when needed; redundancy, backups, and DDoS protection support availability.
保密性确保数据仅可由授权方访问。加密、访问控制和双因素认证(2FA)有助于维护保密性。完整性确保数据保持准确且未被篡改;哈希算法和数字签名可检测未经授权的修改。可用性意味着授权用户可以在需要时访问系统和数据;冗余、备份和 DDoS 防护支持可用性。
These three principles often compete: increasing confidentiality (e.g., very strict passwords) may reduce availability if users lock themselves out. Information security seeks an appropriate balance based on context.
这三条原则常相互制约:加强保密性(例如非常严格的密码)可能会降低可用性,如果用户将自己排除在外。信息安全需要在具体情境中寻求适当的平衡。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图