📚 Year 10 WJEC Computer Science: Quick Reference Handbook of Formulas and Theorems | Year 10 WJEC 计算机:公式定理速查手册
Welcome to your go-to reference for all the essential formulas, laws, and conversion techniques you need in Year 10 WJEC Computer Science. This handbook condenses key binary, hexadecimal, file size, Boolean logic, and network equations into a clear bilingual format. Use it to speed up revision, check your calculations, and solidify core concepts.
欢迎使用这本专为 Year 10 WJEC 计算机科学课程准备的公式与定理速查手册。手册以清晰的双语形式浓缩了二进制、十六进制、文件大小、布尔逻辑和网络等核心方程。用它来加速复习、核对计算并巩固基本概念。
1. Binary and Decimal Conversion | 二进制与十进制转换
To convert a binary number to decimal, multiply each bit by the corresponding power of 2 and sum the results. The rightmost bit represents 2⁰, the next 2¹, then 2², and so on. For example, binary 1011₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11 in decimal.
将二进制数转换为十进制时,将每一位乘以对应的 2 的幂次然后求和。最右侧的位代表 2⁰,向左依次为 2¹、2² 等。例如,二进制 1011₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 十进制 11。
Decimal = Σ (bᵢ × 2ⁱ) for i = 0 to n-1
To convert a decimal number to binary, repeatedly divide the number by 2 and record the remainders; reading remainders from bottom to top gives the binary representation. A quick verification can be done using an 8‑bit place value table (128, 64, 32, 16, 8, 4, 2, 1).
将十进制数转换为二进制时,反复除以 2 并记录余数;从下往上读取余数即可得到二进制表示。可使用 8 位位权值表(128, 64, 32, 16, 8, 4, 2, 1)快速验证。
2. Hexadecimal and Binary Conversion | 十六进制与二进制转换
Each hexadecimal digit corresponds to exactly four binary digits (a nibble). Convert by splitting the binary number into groups of four from the right, then replace each group with its hex symbol: 0‑9 and A‑F for 10‑15. For instance, binary 1101 0111₂ becomes D7₁₆.
每个十六进制位恰好对应四位二进制位(一个半字节)。转换时将二进制数从右至左每四位一组分组,然后用十六进制符号(0‑9 和 A‑F 表示 10‑15)替换每组。例如,二进制 1101 0111₂ 即为 D7₁₆。
Binary → Hex: group 4 bits, then convert; Hex → Binary: expand each digit to 4 bits.
When converting from hexadecimal to decimal, multiply each digit by 16ᵖ, where p is the position from the right (starting at 0). For example, D7₁₆ = 13×16¹ + 7×16⁰ = 208 + 7 = 215₁₀.
将十六进制转换为十进制时,每位数字乘以 16 的 p 次幂,p 为从右起的位置(从 0 开始)。例如 D7₁₆ = 13×16¹ + 7×16⁰ = 208 + 7 = 215₁₀。
3. Binary Shifts and Overflow | 二进制移位与溢出
A left logical shift by one place multiplies an unsigned binary number by 2. A right logical shift divides by 2, discarding the least significant bit. For example, 0000 0101₂ (5) shifted left once becomes 0000 1010₂ (10). Shifting right once turns 0000 1010₂ into 0000 0101₂.
将无符号二进制数逻辑左移一位相当于乘以 2;逻辑右移一位相当于除以 2,并丢弃最低有效位。例如,0000 0101₂(5)左移一位变成 0000 1010₂(10);右移一位则 0000 1010₂ 变回 0000 0101₂。
Left Shift: value × 2ⁿ | Right Shift: value ÷ 2ⁿ (integer division)
Overflow occurs when the result of an addition exceeds the fixed bit width. In an 8‑bit register, adding 1111 1111₂ (255) and 0000 0001₂ (1) gives 1 0000 0000₂, but only the lower 8 bits (0000 0000₂) are stored, setting the overflow flag. Always check carry‑out beyond the most significant bit.
当加法结果超出固定位宽时发生溢出。在 8 位寄存器中,1111 1111₂(255)与 0000 0001₂(1)相加得到 1 0000 0000₂,但只有低 8 位(0000 0000₂)被存储,溢出标志被置位。务必检查最高位之外的进位。
4. Data Units and Conversions | 数据单位与换算
| Unit | Abbreviation | Relation |
|---|---|---|
| bit | b | smallest unit of data |
| nibble | – | 4 bits |
| byte | B | 8 bits |
| kilobyte | kB | 1 000 B or 10³ B (decimal) |
| kibibyte | KiB | 1 024 B or 2¹⁰ B (binary) |
| megabyte | MB | 10⁶ B or 1 000 000 B |
| mebibyte | MiB | 2²⁰ B or 1 048 576 B |
| gigabyte | GB | 10⁹ B or 1 000 000 000 B |
In WJEC exams, you may be asked to convert between bits, bytes, kilobytes, and megabytes using both decimal (×10³) and binary (×2¹⁰) definitions. Always read the question wording carefully to decide which conversion factor to apply.
在 WJEC 考试中,你可能需要根据十进制(×10³)和二进制(×2¹⁰)两种定义在位、字节、千字节和兆字节之间转换。务必仔细读题,确定使用哪一种换算因子。
5. Image File Size Calculation | 图像文件大小计算
The size of an uncompressed bitmap image depends on its resolution (width × height in pixels) and colour depth (bits per pixel). The basic formula is:
一幅未压缩位图的大小取决于其分辨率(宽度 × 高度,以像素计)和颜色深度(每像素位数)。基本公式为:
File Size (bits) = Width × Height × Colour Depth
Convert the result to bytes by dividing by 8, and further to kB or MB as required. For example, an 800×600 image with 24‑bit colour depth uses 800 × 600 × 24 = 11 520 000 bits = 1 440 000 bytes ≈ 1.44 MB (decimal).
将结果除以 8 得到字节数,再根据需要转换为 kB 或 MB。例如,一幅 800×600 且颜色深度为 24 位的图像占用 800 × 600 × 24 = 11 520 000 位 = 1 440 000 字节 ≈ 1.44 MB(十进制)。
If the image has a palette of 256 colours, the colour depth is 8 bits because 2⁸ = 256. Always identify the colour depth before applying the formula.
如果图像采用 256 色调色板,颜色深度为 8 位,因为 2⁸ = 256。在套用公式前始终要先确定颜色深度。
6. Sound File Size Calculation | 声音文件大小计算
Digital audio size is determined by sample rate (Hz), duration (seconds), bit depth (bits per sample), and the number of channels (mono = 1, stereo = 2).
数字音频的大小由采样率(Hz)、时长(秒)、采样深度(每样本位数)以及声道数(单声道 = 1,立体声 = 2)决定。
File Size (bits) = Sample Rate × Duration × Bit Depth × Channels
For instance, a 10‑second stereo recording at 44.1 kHz with 16‑bit samples would be: 44 100 × 10 × 16 × 2 = 14 112 000 bits = 1 764 000 bytes ≈ 1.76 MB.
例如,一段 10 秒、44.1 kHz 采样率、16 位采样深度的立体声录音大小为:44 100 × 10 × 16 × 2 = 14 112 000 位 = 1 764 000 字节 ≈ 1.76 MB。
Remember to convert minutes to seconds and to check whether sample rate is given in Hz (samples per second). Sometimes you may need to estimate file size using a bit rate (e.g. 320 kbps) instead.
记得将分钟转换为秒,并确认采样率是否以 Hz(每秒采样数)给出。有时也需要使用比特率(如 320 kbps)来估算文件大小。
7. Data Transmission Time | 数据传送时间
The time required to transmit data over a network can be found by dividing the total data size by the transmission speed (bit rate).
通过网络传送数据所需的时间可以用数据总量除以传输速率(比特率)求得。
Transmission Time (s) = Data Size (bits) / Transfer Rate (bps)
Always ensure that data size and transfer rate use the same unit (bits). For example, a 5 MB file sent over a 10 Mbps connection: 5 MB = 5 000 000 bytes = 40 000 000 bits; time = 40 000 000 / 10 000 000 = 4 seconds.
始终确保数据大小与传输速率使用相同的单位(位)。例如,通过 10 Mbps 连接发送 5 MB 文件:5 MB = 5 000 000 字节 = 40 000 000 位;时间 = 40 000 000 / 10 000 000 = 4 秒。
If overheads such as packet headers are mentioned, add them to the data size before calculating. In many exam questions, however, an idealised no‑overhead scenario is assumed.
若题目提到数据包头部等额外开销,需在计算前将其加入到数据大小中。但多数考题假设无开销的理想场景。
8. Compression Ratio | 压缩比计算
Compression ratio compares the original file size to the compressed file size. It is a useful measure of how much space is saved.
压缩比将原文件大小与压缩后文件大小进行比较,是衡量节省空间的有效指标。
Compression Ratio = Original Size / Compressed Size
For example, if a 200 kB image is compressed to 50 kB, the compression ratio is 200/50 = 4:1. A higher ratio indicates more effective compression. Lossless compression can usually achieve a lower ratio than lossy compression for the same file type.
例如,若 200 kB 的图像被压缩至 50 kB,压缩比为 200/50 = 4:1。比值越高表明压缩效果越好。相同文件类型下,无损压缩能达到的压缩比通常低于有损压缩。
You may also be asked to calculate the compressed size given a target ratio. Rearrange the formula: Compressed Size = Original Size / Ratio.
你也可能需要根据目标压缩比计算压缩后大小。调整公式:压缩后大小 = 原始大小 / 压缩比。
9. Boolean Algebra Laws | 布尔代数基本定律
Boolean algebra rules simplify logic expressions using the operators AND (· or ∧), OR (+ or ∨), and NOT (¬ or an overbar). The fundamental identity and annihilator laws are:
布尔代数规则使用 AND(· 或 ∧)、OR(+ 或 ∨)和 NOT(¬ 或上划线)对逻辑表达式进行化简。基本的同一律和归零律如下:
A·0 = 0, A·1 = A, A+0 = A, A+1 = 1, A·A = A, A+A = A, A·¬A = 0, A+¬A = 1
The commutative laws state A·B = B·A and A+B = B+A. The associative laws state (A·B)·C = A·(B·C) and (A+B)+C = A+(B+C). The distributive laws are A·(B+C) = (A·B)+(A·C) and A+(B·C) = (A+B)·(A+C).
交换律为 A·B = B·A 且 A+B = B+A;结合律为 (A·B)·C = A·(B·C) 且 (A+B)+C = A+(B+C);分配律为 A·(B+C) = (A·B)+(A·C) 且 A+(B·C) = (A+B)·(A+C)。
Absorption laws help reduce redundancy: A+(A·B) = A and A·(A+B) = A. These are often tested in gate simplification questions.
吸收律有助于消除冗余:A+(A·B) = A 以及 A·(A+B) = A。这些在门电路化简题中经常出现。
10. De Morgan’s Laws and Logic Gates | 德摩根定律与逻辑门
De Morgan’s theorems provide a powerful way to transform between AND and OR gates with inverted inputs. They are expressed as:
德摩根定理为在带反相输入的 AND 与 OR 门之间进行转换提供了有力方法,表达式为:
¬(A·B) = ¬A + ¬B and ¬(A+B) = ¬A · ¬B
In circuit design, this means a NAND gate is equivalent to an OR gate with both inputs inverted, and a NOR gate is equivalent to an AND gate with inverted inputs.
在电路设计中,这意味着与非门等效于输入均反相后的或门,或非门等效于输入均反相后的与门。
These laws are essential for creating any logic circuit using only NAND or only NOR gates, which is a common requirement in examinations.
这些定律对于仅用与非门或仅用或非门构建任意逻辑电路至关重要,这也是考试中的常见要求。
11. Common Logic Gate Truth Tables | 常见逻辑门真值表
The standard logic gates and their symbols appear frequently. The truth tables for two‑input AND, OR, NOT, NAND, NOR, and XOR are summarised below.
标准逻辑门及其符号经常出现。以下汇总了二输入 AND、OR、NOT、NAND、NOR 和 XOR 的真值表。
| Gate | Symbol expression | Truth table (A,B → Q) |
|---|---|---|
| AND | Q = A·B | 00→0, 01→0, 10→0, 11→1 |
| OR | Q = A+B | 00→0, 01→1, 10→1, 11→1 |
| NOT | Q = ¬A | 0→1, 1→0 |
| NAND | Q = ¬(A·B) | 00→1, 01→1, 10→1, 11→0 |
| NOR | Q = ¬(A+B) | 00→1, 01→0, 10→0, 11→0 |
| XOR | Q = A⊕B | 00→0, 01→1, 10→1, 11→0 |
The tri‑state buffer and the controlled NOT gate may also appear, but the six listed above form the core of digital logic at GCSE level. You should be able to draw each gate symbol and complete its truth table from memory.
三态缓冲器和受控非门也可能出现,但上列六种门构成了 GCSE 阶段数字逻辑的核心。你应当能够凭记忆画出每种门的符号并填写其真值表。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导