📚 Quick Reference to Key Formulas and Theorems in Year 8 Computing | Year 8 计算机公式定理速查手册
This handbook brings together the essential definitions, conversion rules, and logical principles that every Year 8 computing student needs at their fingertips. Designed with the SQA curriculum in mind, it covers how data is represented, how elementary logic works, and how algorithms are constructed – all in one convenient reference.
本手册汇集了每位 Year 8 计算机学生需要掌握的基本定义、转换规则和逻辑原理。依据 SQA 课程设计,它涵盖了数据表示方式、基本逻辑运算以及算法构造方法,方便您随时查阅。
1. Understanding Bits and Bytes | 理解位与字节
A bit (binary digit) is the smallest unit of data in a computer, able to hold a value of 0 or 1. A byte is a group of 8 bits, which can represent 2⁸ distinct combinations.
位(二进制数字)是计算机中最小的数据单位,可以保存数值 0 或 1。一个字节由 8 位组成,可以表示 2⁸ 种不同的组合。
ique values that can be represented with n bits is given by the formula: Total Values = 2ⁿ
使用 n 位可以表示的唯一值总数由以下公式得出:总数值 = 2ⁿ
For example, with n = 4 bits, the total is 2⁴ = 16 values (0 to 15).
例如,当 n = 4 位时,总数值为 2⁴ = 16 个值(0 到 15)。
2. Binary Number Conversion | 二进制数转换
To convert a binary number to its decimal equivalent, multiply each bit (starting from the rightmost, position 0) by 2ⁿ and add the results together.
要将二进制数转换为十进制,需要将每一位(从最右边位置 0 开始)乘以 2ⁿ,然后把结果相加。
Decimal = Σ (bit × 2ⁿ), n starts at 0 on the right
Example: 1011₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11₁₀
示例:1011₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11₁₀
To convert decimal to binary, repeatedly divide the number by 2 and read the remainders from bottom to top.
要将十进制转换为二进制,反复除以 2,并将余数从下往上读取。
3. Hexadecimal System | 十六进制系统
Hexadecimal (hex) uses base 16, with symbols 0–9 and A (10), B (11), C (12), D (13), E (14), F (15). One hex digit represents exactly 4 bits (a nibble).
十六进制使用基数为 16,符号为 0–9 以及 A(10)、B(11)、C(12)、D(13)、E(14)、F(15)。一个十六进制位正好代表 4 个二进制位(半个字节)。
To convert binary to hex, group the bits into sets of four from the right, then replace each group with its hex equivalent.
要将二进制转换为十六进制,从右边开始将二进制位四位一组分组,然后将每组替换为对应的十六进制值。
Hex to decimal formula: Digit value = (hex digit) × 16ⁿ (sum over all positions).
十六进制转十进制公式:位值 = (十六进制数字)× 16ⁿ(所有位置求和)。
Example: 3F₁₆ = 3×16¹ + 15×16⁰ = 48 + 15 = 63₁₀
示例:3F₁₆ = 3×16¹ + 15×16⁰ = 48 + 15 = 63₁₀
4. Units of Data | 数据单位
Data size is measured from bits to larger multiples. In computing, units are often based on powers of 2 (1024), but some contexts use the SI definition (1000). The most common conversions are shown below.
数据大小从位开始到更大的倍数进行度量。在计算机领域中,单位通常基于 2 的幂(1024),但在某些情况下也使用 SI 定义(1000)。下面是最常见的换算。
| Unit | Equivalent in bytes (binary) |
|---|---|
| 1 Kilobyte (KB) | 2¹⁰ = 1024 bytes |
| 1 Megabyte (MB) | 2²⁰ = 1,048,576 bytes (1024 KB) |
| 1 Gigabyte (GB) | 2³⁰ = 1,073,741,824 bytes (1024 MB) |
| 1 Terabyte (TB) | 2⁴⁰ = 1,099,511,627,776 bytes (1024 GB) |
ger units, multiply by the corresponding binary factor. For example, 5 MB = 5 × 2²⁰ bytes.
要计算给定较大单位对应的总字节数,请乘以相应的二进制因子。例如,5 MB = 5 × 2²⁰ 字节。
5. Character Encoding: ASCII | 字符编码:ASCII
ASCII (American Standard Code for Information Interchange) maps characters to numeric codes. Standard ASCII uses 7 bits, encoding 128 characters; extended ASCII uses 8 bits, allowing 256 characters.
ASCII(美国信息交换标准代码)将字符映射为数值代码。标准 ASCII 使用 7 位,编码 128 个字符;扩展 ASCII 使用 8 位,允许 256 个字符。
Key codes to remember: 'A' = 65, 'B' = 66, ..., 'Z' = 90; 'a' = 97, 'b' = 98, ..., 'z' = 122; '0' = 48, '1' = 49, ..., '9' = 57.
需要记住的关键代码:'A' = 65,'B' = 66,...,'Z' = 90;'a' = 97,'b' = 98,...,'z' = 122;'0' = 48,'1' = 49,...,'9' = 57。
e difference between an uppercase letter and its lowercase counterpart is always 32 (e.g., 'a' - 'A' = 97 - 65 = 32).
大写字母与其对应的小写字母之间的差值始终为 32(例如,'a' - 'A' = 97 - 65 = 32)。
6. Basic Logic Gates | 基本逻辑门
Logic gates form the foundation of digital circuits. The three fundamental gates operate on binary inputs and produce a single binary output.
逻辑门构成了数字电路的基础。三种基本门对二进制输入进行操作并产生一个二进制输出。
The AND gate outputs 1 only when all inputs are 1. The OR gate outputs 1 when at least one input is 1. The NOT gate inverts its single input.
与门仅在所有输入均为 1 时输出 1。或门在至少有一个输入为 1 时输出 1。非门反转其单一输入。
| AND (A ∧ B) | OR (A ∨ B) | NOT (¬A) | |||
|---|---|---|---|---|---|
| A | B | A | B | A | Out |
| 0 | 0 | 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 | ||
| 1 | 1 | 1 | 1 | ||
These truth tables summarise all possible input/output combinations for each gate.
这些真值表总结了每种门所有可能的输入/输出组合。
7. Boolean Algebra Rules | 布尔代数规则
Boolean algebra helps simplify logic expressions. Important laws include identity, complement, and associative rules. Here are the fundamental identities using variables A and B.
布尔代数有助于简化逻辑表达式。重要的定律包括同一律、互补律和结合律。以下是使用变量 A 和 B 的基本恒等式。
Identity: A ∧ 1 = A, A ∨ 0 = A
同一律:A ∧ 1 = A,A ∨ 0 = A
Null: A ∧ 0 = 0, A ∨ 1 = 1
零一律:A ∧ 0 = 0,A ∨ 1 = 1
Idempotent: A ∧ A = A, A ∨ A = A
幂等律:A ∧ A = A,A ∨ A = A
Complement: A ∧ ¬A = 0, A ∨ ¬A = 1
互补律:A ∧ ¬A = 0,A ∨ ¬A = 1
Double negation: ¬(¬A) = A
双重否定律:¬(¬A) = A
De Morgan’s Laws: ¬(A ∧ B) = ¬A ∨ ¬B; ¬(A ∨ B) = ¬A ∧ ¬B
德摩根定律:¬(A ∧ B) = ¬A ∨ ¬B;¬(A ∨ B) = ¬A ∧ ¬B
8. Algorithm Efficiency & Flowchart Symbols | 算法效率与流程图符号
When comparing search algorithms, we estimate the maximum number of steps. For a list of n items:
在比较搜索算法时,我们估算最大步骤数。对于包含 n 个元素的列表:
Linear search (worst case): maximum checks = n
线性搜索(最坏情况):最大检查次数 = n
Binary search (worst case): maximum checks = ⌈log₂(n)⌉ (the smallest integer greater than or equal to log₂ n)
二分搜索(最坏情况):最大检查次数 = ⌈log₂(n)⌉(大于或等于 log₂ n 的最小整数)
Sorting algorithms such as bubble sort make about n²/2 comparisons in the worst case.
排序算法(如冒泡排序)在最坏情况下大约进行 n²/2 次比较。
Flowcharts use standard symbols to represent steps: an oval for start/end, a rectangle for a process, a diamond for a decision, and arrows for flow direction. Knowing these symbols helps when planning programs.
流程图使用标准符号表示步骤:椭圆形表示开始/结束,矩形表示处理过程,菱形表示判断,箭头表示流程方向。了解这些符号有助于规划程序。
Published by TutorHao | Computing Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

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