KS3 Cambridge Computer Science: Formula & Theorem Quick Reference | KS3 Cambridge 计算机:公式定理速查手册

📚 KS3 Cambridge Computer Science: Formula & Theorem Quick Reference | KS3 Cambridge 计算机:公式定理速查手册

Welcome to your concise revision companion for KS3 Cambridge Computer Science. This handbook distills the essential formulas, conversion rules, logical identities, and efficiency principles you will encounter in the course. From binary arithmetic to network transfer times, every formula is presented with clear notation and paired explanations to support your exam preparation and computational thinking.

欢迎使用这本 KS3 Cambridge 计算机科学速查手册。本书浓缩了课程中必备的公式、换算规则、逻辑恒等式以及算法效率原理。从二进制算术到网络传输时间,每个公式都以清晰的符号呈现,并配有双语讲解,帮助你备战考试并提升计算思维能力。

1. Binary to Denary Conversion | 二进制转十进制转换

To convert a binary number to its denary equivalent, multiply each bit by its corresponding power of 2, starting from the rightmost bit as 2⁰, then sum all the products. For an 8‑bit binary number b₇b₆b₅b₄b₃b₂b₁b₀, the formula is:

要将二进制数转换为十进制数,请将每一位乘以其对应的 2 的幂(最右边为 2⁰),然后将所有乘积相加。对于一个 8 位二进制数 b₇b₆b₅b₄b₃b₂b₁b₀,公式如下:

Denary = b₇ × 2⁷ + b₆ × 2⁶ + b₅ × 2⁵ + b₄ × 2⁴ + b₃ × 2³ + b₂ × 2² + b₁ × 2¹ + b₀ × 2⁰

For example, 10101100₂ = 1×128 + 0×64 + 1×32 + 0×16 + 1×8 + 1×4 + 0×2 + 0×1 = 172₁₀. Always write the column weights (128, 64, 32, 16, 8, 4, 2, 1) above the bits to avoid mistakes.

例如,10101100₂ = 1×128 + 0×64 + 1×32 + 0×16 + 1×8 + 1×4 + 0×2 + 0×1 = 172₁₀。为避免错误,请始终在位上方标注位权值(128、64、32、16、8、4、2、1)。


2. Denary to Binary Conversion | 十进制转二进制转换

The division‑by‑2 method repeatedly divides the denary number by 2, recording the remainder each time. The remainders read from bottom to top form the binary equivalent. This works for any positive integer.

“除 2 取余法”重复用 2 去除十进制数,每次记录余数。从下往上读取余数,就得到对应的二进制数。此方法适用于任何正整数。

  • Divide the number by 2.
  • Record the remainder (0 or 1).
  • Continue dividing the quotient until it becomes 0.
  • Read the remainders backwards to obtain the binary digits.
  • 将数字除以 2。
  • 记录余数(0 或 1)。
  • 继续除商,直到商变为 0。
  • 反向读取余数,即得二进制位。

Denary number = (remainder sequence)₂ read bottom‑up

十进制数 = (余数序列)₂ 从下往上读

For 89₁₀: 89÷2=44 r1; 44÷2=22 r0; 22÷2=11 r0; 11÷2=5 r1; 5÷2=2 r1; 2÷2=1 r0; 1÷2=0 r1. Reading upwards gives 1011001₂. Add leading zeros to make a full byte if required.

89₁₀ 的转换过程:89÷2=44 余 1;44÷2=22 余 0;22÷2=11 余 0;11÷2=5 余 1;5÷2=2 余 1;2÷2=1 余 0;1÷2=0 余 1。向上读取得到 1011001₂。如需构成完整字节,可补前导零。


3. Binary Addition and Overflow | 二进制加法与溢出

Binary addition follows four simple rules: 0+0=0, 0+1=1, 1+0=1, and 1+1=0 with a carry of 1 to the next column. When adding two 8‑bit numbers, if the result requires 9 bits, the extra bit is lost, causing an overflow error.

二进制加法遵循四条简单规则:0+0=0,0+1=1,1+0=1,1+1=0 且向下一列进位 1。当两个 8 位数相加时,若结果需要 9 位,多出的一位会丢失,从而产生溢出错误。

A B Sum Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1

Overflow can be detected when the carry into the most significant bit differs from the carry out. In 8‑bit signed representation (two’s complement), crossing the limit of +127 or −128 triggers overflow.

当最高位的进位与向更高位的进位不同时,即可检测到溢出。在 8 位有符号表示(补码)中,超出 +127 或 −128 的范围会触发溢出。


4. Units of Data Storage | 数据存储单位

Digital data is measured using a hierarchy of units whose conversion factors are powers of 2. Knowing the exact multiples and their abbreviations is vital for calculations involving file sizes and memory capacity.

数字数据的计量使用以 2 的幂为换算因子的单位层级。牢记精确的倍数及其缩写,对于涉及文件大小和内存容量的计算至关重要。

  • 1 bit = a single binary digit (0 or 1)
  • 1 Nibble = 4 bits
  • 1 Byte (B) = 8 bits
  • 1 Kibibyte (KiB) = 1024 bytes (2¹⁰)
  • 1 Mebibyte (MiB) = 1024 KiB (2²⁰)
  • 1 Gibibyte (GiB) = 1024 MiB (2³⁰)
  • 1 Tebibyte (TiB) = 1024 GiB (2⁴⁰)
  • 1 比特(bit)= 一个二进制位(0 或 1)
  • 1 半字节(Nibble)= 4 比特
  • 1 字节(Byte,B)= 8 比特
  • 1 Kibibyte(KiB)= 1024 字节(2¹⁰)
  • 1 Mebibyte(MiB)= 1024 KiB(2²⁰)
  • 1 Gibibyte(GiB)= 1024 MiB(2³⁰)
  • 1 Tebibyte(TiB)= 1024 GiB(2⁴⁰)

Note: In some contexts, kB (1000 bytes) and MB (1,000,000 bytes) are used for storage devices, but memory and operating systems typically employ the binary prefixes above. Always check the question’s unit convention.

注意:在某些语境下,存储设备使用 kB(1000 字节)和 MB(1,000,000 字节),但内存和操作系统通常使用上述二进制前缀。请务必确认题目中的单位规范。


5. Calculating Image File Size | 图像文件大小计算

The file size of a bitmap image is determined by its resolution and colour depth. Colour depth dictates how many bits are used to encode the colour of a single pixel. The general formula is:

位图图像的文件大小由其分辨率和色彩深度决定。色彩深度决定了用于编码单个像素颜色所用的比特数。通用公式为:

File Size (bits) = Width × Height × Colour Depth

文件大小(比特)= 宽度 × 高度 × 色彩深度

To express the result in bytes, divide by 8; for KiB, divide by 8 × 1024. A 24‑bit colour depth allows 2²⁴ ≈ 16.7 million colours. A 1‑bit colour depth gives a black‑and‑white image.

若要将结果转换为字节,需除以 8;转换为 KiB 需除以 8 × 1024。24 位色彩深度可呈现 2²⁴ ≈ 1670 万种颜色。1 位色彩深度则产生黑白图像。

Example: A 1920×1080 image with 24‑bit colour produces 1920×1080×24 = 49,766,400 bits. In MiB that is 49,766,400 ÷ 8 ÷ 1024 ÷ 1024 ≈ 5.93 MiB.

例如:一幅 1920×1080、24 位色彩的图像产生 1920×1080×24 = 49,766,400 比特。换算为 MiB 即 49,766,400 ÷ 8 ÷ 1024 ÷ 1024 ≈ 5.93 MiB。


6. Calculating Sound File Size | 声音文件大小计算

The size of an uncompressed audio file depends on the sample rate, bit depth, number of channels, and duration. Each sample represents the amplitude of the sound wave at an instant in time.

无压缩音频文件的大小取决于采样率、位深度、声道数和时长。每个样本记录了声波在某一瞬间的振幅。

File Size (bits) = Sample Rate × Bit Depth × Channels × Duration (seconds)

文件大小(比特)= 采样率 × 位深度 × 声道数 × 时长(秒)

Common sample rates are 44.1 kHz (CD quality) and 48 kHz. Bit depth is typically 16 bits or 24 bits. Stereo sound uses 2 channels. To calculate duration from file size, rearrange the formula.

常见的采样率为 44.1 kHz(CD 质量)和 48 kHz。位深度通常为 16 位或 24 位。立体声使用 2 个声道。若需通过文件大小计算时长,可对公式变形。

For a 3‑minute stereo track at 44.1 kHz with 16‑bit depth: Size = 44,100 × 16 × 2 × 180 = 254,016,000 bits ≈ 30.3 MiB. Always convert minutes to seconds before calculation.

一段 3 分钟、44.1 kHz、16 位立体声轨道:大小 = 44,100 × 16 × 2 × 180 = 254,016,000 比特 ≈ 30.3 MiB。计算前始终将分钟转换为秒。


7. Logic Gates and Truth Tables | 逻辑门与真值表

Logic gates are the building blocks of digital circuits. The three fundamental gates are NOT, AND, and OR. Their behaviour is defined by truth tables, which list output for every possible input combination.

逻辑门是数字电路的基本构件。三种基本门为非门(NOT)、与门(AND)和或门(OR)。它们的特性由真值表定义,真值表列出了所有可能输入组合对应的输出。

A NOT A
0 1
1 0

AND gate: output is 1 only if all inputs are 1. OR gate: output is 1 if at least one input is 1. Boolean expressions: NOT A = Ā or ¬A; A AND B = A·B; A OR B = A+B.

与门:仅当所有输入为 1 时输出才为 1。或门:只要至少一个输入为 1,输出即为 1。布尔表达式:非 A = Ā 或 ¬A;A 与 B = A·B;A 或 B = A+B。

A B A AND B A OR B
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 1

Other gates derived from these include NAND, NOR, XOR, and XNOR. XOR gives 1 when inputs differ; XNOR gives 1 when inputs are equal.

由这些基本门可衍生出与非门(NAND)、或非门(NOR)、异或门(XOR)和同或门(XNOR)。异或门在输入不同时输出 1,同或门在输入相同时输出 1。


8. Boolean Algebra Simplification | 布尔代数化简定律

Boolean algebra provides a set of identities to simplify logic expressions, reducing the number of gates in a circuit. The key laws include identity, complement, commutative, associative, distributive, and absorption rules.

布尔代数提供了一套恒等式用于化简逻辑表达式,从而减少电路中的门数量。核心定律包括恒等律、互补律、交换律、结合律、分配律和吸收律。

A AND 1 = A    A OR 0 = A (Identity)

A 与 1 = A    A 或 0 = A(恒等律)

A AND ¬A = 0    A OR ¬A = 1 (Complement)

A 与 ¬A = 0    A 或 ¬A = 1(互补律)

A AND (A OR B) = A    A OR (A AND B) = A (Absorption)

A 与 (A 或 B) = A    A 或 (A 与 B) = A(吸收律)

De Morgan’s laws are essential for converting between AND/OR and NAND/NOR: ¬(A AND B) = ¬A OR ¬B; ¬(A OR B) = ¬A AND ¬B. These allow easy transformation of circuits using only NAND or NOR gates.

德摩根定律对于 AND/OR 与 NAND/NOR 之间的转换至关重要:¬(A 与 B) = ¬A 或 ¬B;¬(A 或 B) = ¬A 与 ¬B。利用这一定律可轻松转换为仅使用与非门或或非门的电路。


9. Algorithm Efficiency: Linear vs Binary Search | 算法效率:线性搜索与二分搜索

Efficiency describes how the runtime or number of steps of an algorithm grows with input size. Linear search checks each element in turn, while binary search repeatedly halves a sorted list.

效率描述了算法的运行时间或步骤数如何随输入规模增长。线性搜索依次检查每个元素,而二分搜索在有序列表中反复对半查找。

Linear Search worst‑case: n comparisons

线性搜索最坏情况:n 次比较

Binary Search worst‑case: log₂(n) comparisons (for a sorted list of size n)

二分搜索最坏情况:log₂(n) 次比较(列表大小为 n 且已排序)

For a list of 1,024 items, linear search may take up to 1,024 checks; binary search requires at most 10 comparisons because 2¹⁰ = 1024. Binary search is therefore significantly faster for large datasets, but it demands that the data be sorted first.

对于一个包含 1024 项的列表,线性搜索可能最多需要 1024 次检查;二分搜索最多只需 10 次比较,因为 2¹⁰ = 1024。因此,二分搜索对于大规模数据集显著更快,但它要求数据必须先被排序。

Simple sorting algorithms like bubble sort have an efficiency of approximately n²/2 comparisons and swaps in the worst case, while more advanced algorithms are faster but beyond KS3 scope.

简单排序算法(如冒泡排序)在最坏情况下的比较和交换次数约为 n²/2,更高级的算法虽然更快,但超出了 KS3 的范畴。


10. Data Transmission Time and Network Speeds | 数据传输时间与网络速度

When transferring a file over a network, the time required depends on the file size and the transmission speed. The basic relationship is:

通过网络传输文件时,所需时间取决于文件大小和传输速度。基本关系为:

Time (seconds) = File Size (bits) ÷ Transmission Rate (bits per second)

时间(秒)= 文件大小(比特) ÷ 传输速率(比特/秒)

Network speeds are often given in Mbps (megabits per second). Remember that 1 Mbps = 1,000,000 bits per second when using the decimal prefix, but some contexts may use 1,048,576 bits per second. Always convert all units to bits before applying the formula.

网络速度通常以 Mbps(兆比特/秒)表示。请记住,使用十进制前缀时 1 Mbps = 1,000,000 比特/秒,但某些语境下也可能使用 1,048,576 比特/秒。在应用公式之前,务必将所有单位转换为比特。

Example: A 2 MiB file (2 × 1024 × 1024 × 8 = 16,777,216 bits) transferred over a 4 Mbps connection takes 16,777,216 ÷ 4,000,000 ≈ 4.19 seconds in ideal conditions. Real‑world factors (latency, protocol overhead) will increase this time.

示例:一个 2 MiB 的文件(2 × 1024 × 1024 × 8 = 16,777,216 比特)通过 4 Mbps 的连接传输,在理想条件下需要 16,777,216 ÷ 4,000,000 ≈ 4.19 秒。现实因素(延迟、协议开销)会延长此时间。


11. Compression Ratios and Redundancy | 压缩比与冗余

Data compression reduces file size by removing redundancy. The compression ratio compares the original size to the compressed size, while the space saving percentage indicates how much space has been freed.

数据压缩通过消除冗余来减小文件大小。压缩比是原始大小与压缩后大小之比,而节省空间百分比则表明节省了多少空间。

Compression Ratio = Original Size ÷ Compressed Size

压缩比 = 原始大小 ÷ 压缩后大小

Space Saving (%) = (1 − Compressed Size ÷ Original Size) × 100%

节省空间百分比 = (1 − 压缩后大小 ÷ 原始大小) × 100%

For a 500 KiB image compressed to 80 KiB, the compression ratio is 500 ÷ 80 = 6.25:1, and the space saving is (1 − 80/500) × 100% = 84%. Lossless compression retains all original data; lossy compression discards some data to achieve higher ratios.

对于一张 500 KiB 的图像压缩至 80 KiB,压缩比为 500 ÷ 80 = 6.25:1,节省空间为 (1 − 80/500) × 100% = 84%。无损压缩保留所有原始数据;有损压缩会丢弃部分数据以获得更高压缩比。


12. Error Detection: Parity Bits | 错误检测:奇偶校验位

A parity bit is a simple error‑checking mechanism added to a binary string to ensure the total number of 1s is even (even parity) or odd (odd parity). It can detect a single‑bit error but cannot correct it.

奇偶校验位是一种附加在二进制串中的简单错误检测机制,以确保 1 的总数为偶数(偶校验)或奇数(奇校验)。它可以检测出单比特错误,但无法纠正。

Even parity bit = 0 if count of 1s is already even, else 1

偶校验位 = 若 1 的个数已为偶数则为 0,否则为 1

When the receiver counts the 1s including the parity bit, a mismatch indicates an error. Parity is used in RAM and data communication to flag transmission faults.

当接收方统计包含校验位在内的 1 的个数时,若不匹配则表示出错。奇偶校验常用于 RAM 和数据通信中,以标记传输故障。


Published by TutorHao | Computer Science Revision Series | aleveler.com

更多咨询请联系16621398022(同微信)

Comments

屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from aleveler.com

Subscribe now to keep reading and get access to the full archive.

Continue reading