📚 AQA Year 7 Computer Science Formula & Theorem Quick Reference | AQA 七年级计算机科学公式定理速查手册
This quick reference handbook brings together the essential formulas, rules and theorems you will meet in Year 7 AQA Computer Science. From binary arithmetic and Boolean logic to file size calculations and search algorithms, every topic is presented as a clear English–Chinese pair so you can check definitions and equations quickly during revision.
这本速查手册汇集了 AQA 七年级计算机科学课程中的核心公式、规则与定理。从二进制运算、布尔逻辑到文件大小计算和基础算法,每个主题都采用中英对照的方式呈现,方便你快速查阅定义、方程和关键关系。
1. Binary to Denary Conversion | 二进制转十进制
Each binary digit (bit) has a place value that doubles from right to left. To convert a binary number to denary, multiply each bit by its place value and sum the results.
每个二进制位(比特)从右向左的位权值依次翻倍。将二进制数转为十进制时,用每一位(0 或 1)乘以所在位的权值,然后求和。
Denary = d7×27 + d6×26 + ... + d0×20
number 01001101 is converted as: 0×128 + 1×64 + 0×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1 = 77.
例如,8 位二进制数 01001101 的转换过程为:0×128 + 1×64 + 0×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1 = 77。
2. Denary to Binary Conversion | 十进制转二进制
Repeatedly divide the denary number by 2 and record the remainder. Read the remainders from bottom to top to obtain the binary equivalent.
将十进制数反复除以 2,记录每次的余数。从下往上读取余数,即得二进制数。
Binary = (Quotient₀ Rk) ... (Quotientk R1) with R1 as most significant bit
R0; 11 ÷ 2 = 5 R1; 5 ÷ 2 = 2 R1; 2 ÷ 2 = 1 R0; 1 ÷ 2 = 0 R1. Reading upwards gives 101101.
以十进制数 45 为例:45 ÷ 2 = 22 余 1;22 ÷ 2 = 11 余 0;11 ÷ 2 = 5 余 1;5 ÷ 2 = 2 余 1;2 ÷ 2 = 1 余 0;1 ÷ 2 = 0 余 1。从下往上读取得到 101101。
3. Binary Addition & Overflow | 二进制加法与溢出
Binary addition follows four simple rules. When a result exceeds the maximum value a fixed number of bits can represent, an overflow error occurs.
二进制加法遵循四条简单规则。当结果超出固定位数所能表示的最大值时,会产生溢出错误。
- 0 + 0 = 0 无进位
- 0 + 1 = 1 无进位
- 1 + 0 = 1 无进位
- 1 + 1 = 0, carry 1 进位 1
- 1 + 1 + 1 = 1, carry 1 进位 1
In an 8-bit system, adding 11111111 (255) + 00000001 (1) gives 100000000, which is 9 bits — the leading 1 is lost, giving 00000000 (0). This is overflow.
在 8 位系统中,11111111(255)与 00000001(1)相加得到 100000000(9 位),最前面的 1 丢失,结果变成 00000000(0),这就是溢出。
4. Boolean Truth Tables – AND, OR, NOT | 布尔真值表——与、或、非
The three fundamental logic gates have fixed truth tables. You must know them to analyse circuits and Boolean expressions.
三种基本逻辑门的真值表是固定的,必须熟练掌握,用于分析逻辑电路和表达式。
| A | B | A AND B | A OR B | NOT A |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 |
The NOT gate simply inverts the input. In expressions, AND is written as A·B, OR as A+B, and NOT as ¬A or A'.
非门直接反转输入。表达式中,与运算写作 A·B,或运算写作 A+B,非运算写作 ¬A 或 A'。
5. Simplifying Boolean Expressions | 化简布尔表达式
Several laws allow us to reduce complex Boolean expressions to simpler, equivalent forms. The most common ones for Year 7 are commutativity, associativity, distributivity and absorption.
利用若干定律可以将复杂的布尔表达式化简为等价的简单形式。七年级常用的定律包括交换律、结合律、分配律和吸收律。
- Commutativity 交换律: A·B = B·A ; A+B = B+A
- Associativity 结合律: (A·B)·C = A·(B·C) ; (A+B)+C = A+(B+C)
- Distributivity 分配律: A·(B+C) = A·B + A·C ; A+(B·C) = (A+B)·(A+C)
- Absorption 吸收律: A+(A·B) = A ; A·(A+B) = A
- Identity 同一律: A·1 = A ; A+0 = A
- Null 零一律: A·0 = 0 ; A+1 = 1
- Idempotent 幂等律: A·A = A ; A+A = A
- Complement 互补律: A·¬A = 0 ; A+¬A = 1
- De Morgan's Laws 德摩根定律: ¬(A·B) = ¬A + ¬B ; ¬(A+B) = ¬A · ¬B
Apply these step by step to reduce gate count and simplify circuit logic.
逐步使用这些定律能够减少逻辑门数量,简化电路逻辑。
6. Data Storage Unit Conversions | 数据存储单位换算
Computer storage and memory are measured in bits and bytes. Conversions between units follow powers of 2 (binary) or sometimes powers of 10 (decimal) for marketing; in computing theory we use binary prefixes.
计算机的存储与内存以比特和字节为基本单位。理论课程中采用二进制的换算关系(以 2 为底)。
1 byte = 8 bits
1 KiB = 210 bytes = 1,024 bytes
1 MiB = 220 bytes = 1,048,576 bytes
1 GiB = 230 bytes ≈ 1.07 × 109 bytes
To convert a larger unit to a smaller one, multiply. E.g., 5 MiB to bytes = 5 × 220 = 5,242,880 bytes. To convert upwards, divide.
从大单位转换为小单位时相乘,如 5 MiB 转字节 = 5 × 220 = 5,242,880 字节。反向转换时除以相应的幂次。
7. Image File Size Calculation | 图像文件大小计算
The size of a bitmap image file can be estimated from the image resolution and colour depth. Colour depth is the number of bits used to encode the colour of a single pixel.
位图图像文件的大小可由图像分辨率和颜色深度估算。颜色深度是编码单个像素颜色所用的比特数。
Image file size (bits) = Width × Height × Colour depth
Image file size (bytes) = (Width × Height × Colour depth) ÷ 8
its ≈ 6.22 MiB. Often there is also metadata, but the raw pixel data follows this formula.
例如,一张分辨率为 1920×1080、24 位色彩深度的图片,原始像素数据大小为 1920 × 1080 × 24 = 49,766,400 比特,约合 6.22 MiB。实际文件还包含元数据,但原始数据遵循此公式。
8. Sound File Size Calculation | 声音文件大小计算
Uncompressed audio file size depends on sample rate, bit depth, number of channels and duration. This formula gives the raw audio data size before compression.
未压缩的音频文件大小取决于采样频率、采样位数、声道数和时长。该公式给出压缩前的原始音频数据量。
Sound file size (bits) = Sample rate (Hz) × Bit depth × Channels × Duration (seconds)
Sound file size (bytes) = (Sample rate × Bit depth × Channels × Duration) ÷ 8
ality audio: 44,100 Hz × 16 bits × 2 channels × 300 seconds = 423,360,000 bits ≈ 50.5 MiB.
以 CD 音质的立体声为例:44,100 Hz × 16 位 × 2 声道 × 300 秒 = 423,360,000 比特,约 50.5 MiB。
9. Caesar Cipher Encryption | 凯撒密码加密
The Caesar cipher is a substitution cipher that shifts each letter by a fixed number of places in the alphabet. Encryption and decryption use modular arithmetic.
凯撒密码是一种替换式密码,它将字母表中的每个字母按照固定的偏移量进行移位。加密和解密都使用模运算。
Encrypted letter = (Plain letter position + Shift) mod 26
Decrypted letter = (Cipher letter position − Shift) mod 26
ns A (0) into D (3), B (1) into E (4), and X (23) wraps around to A ( (23+3) mod 26 = 0 ).
设定 A=0, B=1, ..., Z=25,偏移 3 时,A (0) 变成 D (3),B (1) 变成 E (4),X (23) 回绕为 A((23+3) mod 26 = 0)。
10. Algorithm Efficiency: Search & Sort | 算法效率:查找与排序
When comparing algorithms, we often count the number of comparisons or swaps required. This helps us choose the best method for a given task.
在比较算法时,常计算所需的比较次数或交换次数,这有助于选择最适合当前任务的方法。
Linear search maximum comparisons = n (worst case)
Binary search maximum comparisons ≈ log2(n)
Bubble sort number of passes = n−1
Bubble sort total comparisons ≈ n(n−1)/2
For a list of 100 items, linear search may need 100 comparisons, whereas binary search needs at most 7 (since 27 = 128). Bubble sort completes in 99 passes with about 4,950 comparisons in the worst case.
对于包含 100 个元素的列表,线性查找最多需要 100 次比较,而二分查找最多只需 7 次(因为 27 = 128)。冒泡排序需要 99 趟,最坏情况下的总比较次数约为 4,950 次。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

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