📚 KS3 WJEC Computer Science: Formula & Theorem Quick Reference Handbook | KS3 WJEC 计算机:公式定理速查手册
This quick reference guide gathers all the essential formulas and theorems you need for the KS3 WJEC Computer Science course. From number systems and data representation to logic gates and algorithm performance, every key relationship is explained with clear examples. Use it as a revision checklist or a desk companion while solving problems.
这本速查手册汇集了 KS3 WJEC 计算机科学课程中所有必背的公式和定理。从数制转换、数据表示到逻辑门和算法效率,每一种关键关系都配有清晰的解释和例子。无论是考前复习还是做练习时查阅,它都能成为你手边的好帮手。
1. Binary to Denary Conversion | 二进制转十进制
To convert a binary number to denary, write the binary digits under place values (powers of 2) starting from the right. If a digit is 1, add the corresponding place value; if 0, skip it. The sum is the denary value.
要将二进制数转换为十进制,从右向左把二进制数字写在位值(2 的幂)下方。如果是 1,就加上该位值;0 则跳过。最后的总和就是十进制数值。
Denary value = Σ (binary digit × 2position)
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₁₀
2. Denary to Binary Conversion | 十进制转二进制
Divide the denary number repeatedly by 2, writing down the remainder (0 or 1) each time. Read the remainders from bottom to top to get the binary equivalent. Continue until the quotient becomes 0.
将十进制数不断除以 2,记录每次的余数(0 或 1)。从下往上读出余数,就得到了二进制表示。一直除到商为 0 为止。
Example: 6 ÷ 2 = 3 rem 0; 3 ÷ 2 = 1 rem 1; 1 ÷ 2 = 0 rem 1. Remainders: 1, 0, 1, 1. Binary: 1101₂.
例子: 13₁₀ → 13 ÷ 2 = 6 余 1;6 ÷ 2 = 3 余 0;3 ÷ 2 = 1 余 1;1 ÷ 2 = 0 余 1。余数:1, 0, 1, 1。二进制:1101₂。
3. Binary Addition | 二进制加法
, and 1+1+1=1 carry 1. Add column by column from right to left, just like denary addition.
二进制加法遵循以下规则:0+0=0,0+1=1,1+0=1,1+1=0 并向下一位进 1,1+1+1=1 并进 1。像十进制加法一样从右向左逐列相加。
Example: e: 0+1+carry1=0 carry 1; leftmost: 1+0+carry1=0 carry 1; final carry gives the leftmost 1.
例子: 101₂ + 011₂ = 1000₂。解释:最右列:1+1=0 进 1;中间列:0+1+进位1=0 进 1;最左列:1+0+进位1=0 进 1;最后的进位形成最左边的 1。
4. Data Units Conversion | 数据单位换算
byte (GB) = 1024 MB, 1 terabyte (TB) = 1024 GB. Use multiplication or division to move between units.
计算机存储的基本单位是比特(位)。关键换算关系:1 字节 (B) = 8 比特 (bit),1 千字节 (KB) = 1024 字节,1 兆字节 (MB) = 1024 KB,1 吉字节 (GB) = 1024 MB,1 太字节 (TB) = 1024 GB。通过乘除可以在不同单位之间转换。
| Unit | Equivalent in bytes |
|---|---|
| 1 bit | 1/8 byte |
| 1 byte (B) | 1 byte |
| 1 KB | 1024 bytes |
| 1 MB | 1024² bytes (1,048,576 B) |
| 1 GB | 1024³ bytes |
| 1 TB | 1024⁴ bytes |
5. Boolean Logic: AND, OR, NOT Truth Tables | 布尔逻辑:与、或、非真值表
Boolean logic works with TRUE (1) and FALSE (0). The AND gate outputs 1 only when both inputs are 1. The OR gate outputs 1 when at least one input is 1. The NOT gate inverts its input.
布尔逻辑使用真 (1) 和假 (0)。与门 (AND) 仅在两个输入都为 1 时输出 1。或门 (OR) 只要至少有一个输入为 1,就输出 1。非门 (NOT) 将输入取反。
AND truth table: 0 AND 0 = 0; 0 AND 1 = 0; 1 AND 0 = 0; 1 AND 1 = 1.
AND 真值表: 0·0=0;0·1=0;1·0=0;1·1=1。
OR truth table: 0 OR 0 = 0; 0 OR 1 = 1; 1 OR 0 = 1; 1 OR 1 = 1.
OR 真值表: 0+0=0;0+1=1;1+0=1;1+1=1。
NOT truth table: NOT 0 = 1; NOT 1 = 0.
NOT 真值表: ¬0 = 1;¬1 = 0。
6. De Morgan's Laws | 德摩根定律
De Morgan's laws show how to simplify expressions involving AND, OR, and NOT. They state: NOT (A AND B) is the same as (NOT A) OR (NOT B); NOT (A OR B) is the same as (NOT A) AND (NOT B).
德摩根定律说明了如何化简包含 AND、OR 和 NOT 的逻辑表达式。定律指出:NOT (A AND B) 等价于 (NOT A) OR (NOT B);NOT (A OR B) 等价于 (NOT A) AND (NOT B)。
¬(A · B) = ¬A + ¬B
¬(A + B) = ¬A · ¬B
These laws are helpful for simplifying digital circuits and understanding equivalence.
这些定律有助于简化数字电路和理解逻辑等价关系。
7. Image File Size Calculation | 图像文件大小计算
th × height × colour depth. Convert to bytes by dividing by 8, and then to KB by dividing by 1024.
未压缩位图图像的大小取决于像素总数(宽度 × 高度)和颜色深度(每像素比特数)。文件大小(比特)= 宽度 × 高度 × 颜色深度。除以 8 得到字节数,再除以 1024 得到千字节数。
Image size (bits) = width (px) × height (px) × colour depth (bits)
Example: 100 image with 24-bit colour uses 200 × 100 × 24 = 480,000 bits = 60,000 bytes = 58.59 KB.
例子: 一幅 200×100 像素、24位颜色的图像,大小为 200 × 100 × 24 = 480,000 比特 = 60,000 字节 ≈ 58.59 KB。
8. Sound File Size Calculation | 声音文件大小计算
and duration. Size (bits) = sample rate (Hz) × bit depth × channels × duration (seconds).
未压缩的声音文件大小取决于采样率、位深度、声道数和时长。文件大小(比特)= 采样率 (Hz) × 位深度 × 声道数 × 时长(秒)。
Sound size (bits) = sample rate × bit depth × channels × time
Example: ng at 44.1 kHz, 16-bit: 44100 × 16 × 2 × 10 = 14,112,000 bits = 1,764,000 bytes ≈ 1.68 MB.
例子: 一段 10 秒立体声录音,采样率 44.1 kHz,位深 16-bit:44100 × 16 × 2 × 10 = 14,112,000 比特 = 1,764,000 字节 ≈ 1.68 MB。
9. Data Transfer Time Calculation | 数据传输时间计算
ze ÷ transfer speed. Make sure both values use the same units (bits, bytes, etc.). Common speeds are given in bits per second (bps).
传输文件所需时间 = 文件大小 ÷ 传输速率。确保两者使用相同单位(全用比特或全用字节)。常见速率以比特每秒 (bps) 为单位。
Time (s) = file size (bits) ÷ speed (bps)
Example: MB = 10 × 1024 × 1024 × 8 = 83,886,080 bits; time = 83,886,080 ÷ 1,000,000 ≈ 83.9 seconds.
例子: 通过 1 Mbps 的网速传输 10 MB 文件:10 MB = 10 × 1024 × 1024 × 8 = 83,886,080 比特;时间 = 83,886,080 ÷ 1,000,000 ≈ 83.9 秒。
10. Caesar Cipher Encryption Formula | 凯撒密码加密公式
habet. To encrypt a letter with a shift of k: E(x) = (x + k) mod 26, where x is the letter's position (A=0, B=1, ... Z=25). Decryption uses D(y) = (y - k) mod 26.
凯撒密码把每个字母在字母表中向后移动固定位数。移位量为 k 的加密公式:E(x) = (x + k) mod 26,其中 x 为字母的位置(A=0, B=1, ... Z=25)。解密公式为 D(y) = (y - k) mod 26。
Encrypt: E(x) = (x + k) mod 26
Decrypt: D(y) = (y - k) mod 26
Example: Encrypt 'A' (x=0) with shift 3: (0+3) mod 26 = 3 → 'D'. Decrypt 'D' (y=3): (3-3) mod 26 = 0 → 'A'.
例子: 移位 3 加密 'A' (x=0): (0+3) mod 26 = 3 → 'D'。解密 'D' (y=3):(3-3) mod 26 = 0 → 'A'。
11. Linear Search vs Binary Search | 线性搜索与二分搜索的效率比较
Linear search examines each item one by one. In the worst case, it takes N steps for a list of length N. Its time complexity is O(N). Linear search works on unsorted data.
线性搜索逐个检查每个元素。在最坏情况下,对于长度为 N 的列表需要 N 步。时间复杂度为 O(N)。线性搜索可用于未排序的数据。
Binary search works only on sorted lists. It repeatedly divides the search interval in half. Maximum number of steps is log₂(N). Complexity is O(log N), which is much faster for large N.
二分搜索只能用于已排序的列表。它不断将搜索区间对半分。最大步数为 log₂(N)。复杂度为 O(log N),对于大列表要快得多。
| List size N | Linear worst case | Binary worst case |
|---|---|---|
| 10 | 10 | 4 |
| 100 | 100 | 7 |
| 1000 | 1000 | 10 |
| 1,000,000 | 1,000,000 | 20 |
12. ASCII and Unicode Code Ranges | ASCII 与 Unicode 编码范围
ASCII uses 7 bits to represent characters, giving 128 possible codes (0– des control characters, digits, uppercase and lowercase letters, and symbols. For example, 'A' = 65, 'a' = 97, '0' = 48.
ASCII 使用 7 位二进制表示字符,共有 128 个编码(0–127)。标准 ASCII 表包含控制字符、数字、大写字母、小写字母和符号。例如,'A' = 65,'a' = 97,'0' = 48。
Unicode extends ASCII to cover characters from all writing systems. UTF-8 is the most common encoding; it uses 1 to 4 bytes per character. The first 128 Unicode code points match ASCII, ensuring backwards compatibility.
Unicode 扩展了 ASCII,覆盖了所有书写系统的字符。最常用的编码是 UTF-8,每个字符使用 1 到 4 个字节。前 128 个 Unicode 码点与 ASCII 一致,保证了向后兼容。
Tip: To find the ASCII value of a digit, subtract 48 from its code. '5' (code 53) minus 48 gives the integer 5.
提示: 要得到数字字符的数值,从它的编码中减去 48。'5'(编码 53)减去 48 得到整数 5。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

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