← 返回资讯屏轩教育 · 行业资讯

Year 12 CAIE Computer Science Quick Formula & Theorem Handbook | Year 12 CAIE 计算机:公式定理速查手册

2026-07-22 12:55 · 本文部分内容由AI辅助创作

📚 Year 12 CAIE Computer Science Quick Formula & Theorem Handbook | Year 12 CAIE 计算机:公式定理速查手册

This handbook compiles all the essential formulas, conversion rules, and Boolean theorems required for the CAIE AS Computer Science 9618 syllabus. Use it for quick revision before your exam to ensure you can apply the correct calculations to data representation, logic, processor performance, networking, and error detection.

本手册汇编了 CAIE AS 计算机科学 9618 课程中所有必考的公式、转换规则和布尔定理。适合考前快速复习,确保你能在数据表示、逻辑、处理器性能、网络和错误检测等模块中正确应用相关计算。

1. Data Units and Base Conversions | 数据单位与数制转换

(powers of 10) and binary (powers of 2) prefixes are used. In Cambridge assessments, it is critical to identify whether the question expects decimal kilobytes (kB = 10³ bytes) or binary kibibytes (KiB = 2¹⁰ bytes), especially when dealing with file sizes on storage media.

数字存储的基本单位是比特 (b),然后是半个字节 (nibble, 4 bits) 和字节 (B, 8 bits)。对于更大的数量,会使用十进制(10 的幂)和二进制(2 的幂)前缀。在剑桥考试中,必须识别题目要求的是十进制千字节 (kB = 10³ 字节) 还是二进制千字节 (KiB = 2¹⁰ 字节),特别是在处理存储介质上的文件大小时。

UnitDecimal (10ⁿ)Binary (2ⁿ)
1 kilobyte1 kB = 10³ B = 1000 B1 KiB = 2¹⁰ B = 1024 B
1 megabyte1 MB = 10⁶ B1 MiB = 2²⁰ B
1 gigabyte1 GB = 10⁹ B1 GiB = 2³⁰ B
1 terabyte1 TB = 10¹² B1 TiB = 2⁴⁰ B

To convert a binary number to denary, sum the products of each bit and its corresponding power of 2: denary = Σ (bitᵢ × 2ⁱ) where i = 0 for the least significant bit. For hexadecimal, each hex digit maps to a 4‑bit nibble. Convert between binary and hex by grouping bits in fours from the right.

将二进制转十进制时,对每一位的值与对应的 2 的幂相乘再求和:十进制 = Σ (比特ᵢ × 2ⁱ),其中 i = 0 表示最低有效位。对于十六进制,每个十六进制数字对应一个 4 位的半字节。在二进制和十六进制之间转换时,从右侧开始每四位一组进行分组。

₆. For denary to binary, repeatedly divide by 2 and read remainders backwards. For fractions, multiply by 2 and record the integer part.

二进制与十六进制速查:0000₂=0₁₆, 1010₂=A₁₆, 1111₂=F₁₆。十进制转二进制时,反复除以 2 取余数,然后逆序读取。对于小数部分,乘以 2 并记录整数部分。


2. Binary Arithmetic and Two’s Complement | 二进制运算与补码

Binary addition follows the same column‑ t column. An overflow occurs when the result of an addition requires more bits than are available. In signed arithmetic using two’s complement, overflow is detected when the carry into the sign bit differs from the carry out of the sign bit.

二进制加法遵循与十进制相同的列式规则:0+0=0, 0+1=1, 1+0=1, 1+1=0 并向下一列进位 1。当加法结果需要的位数超出可用位数时,会发生溢出。在使用补码的有符号算术中,当进入符号位的进位与离开符号位的进位不同时,即检测到溢出。

Two’s complement representation allows negative integers to be stored. For an n‑bit signed binary number, the most significant bit (MSB) has weight −2ⁿ⁻¹. The decimal value is: Value = −aₙ₋₁×2ⁿ⁻¹ + Σᵢ₌₀ⁿ⁻² aᵢ×2ⁱ. The range of representable numbers is −2ⁿ⁻¹ to +2ⁿ⁻¹ − 1. For example, an 8‑bit two’s complement integer ranges from −128 to +127.

补码表示法允许存储负整数。对于 n 位有符号二进制数,最高有效位 (MSB) 的权重为 −2ⁿ⁻¹。十进制值为:值 = −aₙ₋₁×2ⁿ⁻¹ + Σᵢ₌₀ⁿ⁻² aᵢ×2ⁱ。可表示的数值范围为 −2ⁿ⁻¹ 到 +2ⁿ⁻¹ − 1。例如,8 位补码整数的范围是 −128 到 +127。

btraction is performed by adding the two’s complement of the subtrahend: A − B = A + (−B).

求一个数的补码(取负)时,将所有位取反再加 1。减法通过加上减数的补码来执行:A − B = A + (−B)。


3. Floating‑Point Representation (Normalised Form) | 浮点数表示(规格化形式)

A floating‑point number is expressed as M × 2ᴱ⁻ᵇⁱᵃˢ, where M is the mantissa (fractional part) and E is the exponent. In the binary mantissa–exponent format used by CAIE, the mantissa is a signed binary fraction stored in two’s complement, and the exponent is a signed integer. The number is normalised when the mantissa is adjusted so that its leftmost two bits are different (01 for positive or 10 for negative), maximising precision.

浮点数表示为 M × 2E − bias,其中 M 是尾数(小数部分),E 是指数。在 CAIE 使用的二进制尾数-指数格式中,尾数是以补码形式存储的有符号二进制小数,指数是有符号整数。当尾数调整到最左侧两位不同时(正数为 01,负数为 10),即实现了规格化,从而最大化精度。

To convert a denary number into normalised floating point: first convert the absolute value to a binary fraction with a binary point, then shift the binary point so that the mantissa begins with 01 or 10. The number of shifts (direction taken as positive or negative) becomes the exponent. Then apply the sign bit (0 for positive, 1 for negative) to the mantissa and store both fields in the allocated sizes.

将十进制数转换为规格化浮点数时:先将绝对值转换为带小数点的二进制小数,然后移动小数点,使得尾数以 01 或 10 开头。移动的次数(方向决定正负)成为指数。然后根据符号位(0 表示正,1 表示负)设置尾数,并将两个字段按分配位数存储。

Range and precision depend on the number of bits assigned to the mantissa and exponent. Larger mantissa gives more precision; larger exponent gives greater range. Typical AS exam format may use 8‑bit mantissa and 4‑bit exponent.

范围和精度取决于分配给尾数和指数的位数。尾数越大精度越高;指数越大范围越广。典型的 AS 考试格式可能使用 8 位尾数和 4 位指数。


广告 / Sponsored

4. Image and Sound File Size | 图像与音频文件大小计算

For a bitmap image, the file size in bytes (ignoring metadata) is given by: Image size (bytes) = (width × height × colour depth) / 8. Width and height are in pixels; colour depth is the number of bits used per pixel (e.g. 24 bits for true colour). If the image has a resolution in dots per inch (dpi), use the physical dimensions to find pixel dimensions.

对于位图图像,文件大小(字节数,忽略元数据)由以下公式给出:图像大小 (字节) = (宽度 × 高度 × 色彩深度) / 8。宽度和高度以像素为单位;色彩深度是每个像素使用的位数(例如真彩色为 24 位)。如果图像具有每英寸点数 (dpi) 分辨率,则使用物理尺寸计算像素尺寸。

For an uncompressed sound file, the size is: tes) = sample rate (Hz) × sample size (bits) × duration (seconds) × number of channels / 8. Common sample rates are 44.1 kHz (CD quality) and 48 kHz; sample size is often 16 bits. Stereo means two channels.

对于未压缩的音频文件,大小为:音频大小 (字节) = 采样率 (Hz) × 采样大小 (位) × 时长 (秒) × 声道数 / 8。常见的采样率为 44.1 kHz(CD 质量)和 48 kHz;采样大小通常为 16 位。立体声表示两个声道。

When both video and audio are combined, the total bit rate is the sum of the video bit rate and audio bit rate, and the file size is bit rate × time.

当视频和音频结合时,总比特率是视频比特率与音频比特率之和,文件大小为 比特率 × 时间。


5. Data Compression Ratio | 数据压缩比

Compression ratio measures the effectiveness of a compression algorithm. It is defined as: Compression ratio = uncompressed size / compressed size. A ratio of 4:1 means the compressed file is one quarter of the original. The space saving percentage is (1 − 1/ratio) × 100%.

压缩比衡量压缩算法的效果。定义为:压缩比 = 未压缩大小 / 压缩后大小。比率为 4:1 表示压缩文件是原始文件的四分之一。空间节省百分比为 (1 − 1/比例) × 100%。

Lossless compression (e.g. run‑length encoding, Huffman coding) allows exact reconstruction of the original data. Run‑length encoding replaces consecutive identical values with a count and the value: e.g. 'AAAA' becomes '4A'. The compressed size depends on the data pattern.

无损压缩(如行程编码、霍夫曼编码)允许精确重建原始数据。行程编码用计数值和值本身替换连续的相同值:例如 'AAAA' 变为 '4A'。压缩后的大小取决于数据模式。

Lossy compression (e.g. JPEG, MP3) discards some data that is less noticeable to humans, achieving higher compression ratios but with some quality loss.

有损压缩(如 JPEG、MP3)会丢弃一些人类不太注意的数据,从而实现更高的压缩比,但会损失一些质量。


6. Boolean Algebra Laws and Theorems | 布尔代数定律与定理

Boolean algebra manipulates binary variables. The basic operations are AND (·), OR (+) and NOT ( ¬ or overbar). Key laws and theorems must be memorised for simplification of logic circuits and truth table analysis.

布尔代数处理二进制变量。基本运算为 AND (·)、OR (+) 和 NOT ( ¬ 或上划线)。必须熟记关键定律和定理,以便简化逻辑电路和分析真值表。

Identity: A+0=A, A·1=A    Complement: A+¬A=1, A·¬A=0

恒等律:A+0=A, A·1=A;互补律:A+¬A=1, A·¬A=0

Idempotent: A+A=A, A·A=A    Annihilator: A+1=1, A·0=0

幂等律:A+A=A, A·A=A;归零律:A+1=1, A·0=0

Commutative: A+B=B+A, A·B=B·A

交换律:A+B=B+A, A·B=B·A

Associative: (A+B)+C=A+(B+C), (A·B)·C=A·(B·C)

结合律:(A+B)+C=A+(B+C), (A·B)·C=A·(B·C)

Distributive: A·(B+C)=A·B+A·C, A+(B·C)=(A+B)·(A+C)

分配律:A·(B+C)=A·B+A·C, A+(B·C)=(A+B)·(A+C)

Absorption: A+(A·B)=A, A·(A+B)=A

吸收律:A+(A·B)=A, A·(A+B)=A

De Morgan’s Theorems: ¬(A·B)=¬A+¬B, ¬(A+B)=¬A·¬B

德摩根定理:¬(A·B)=¬A+¬B, ¬(A+B)=¬A·¬B

These laws allow any logic expression to be simplified, often reducing the number of gates needed. Use De Morgan to convert between NAND/NOR‑only implementations.

这些定律可以简化任何逻辑表达式,通常能减少所需门电路数量。利用德摩根定律可以在纯 NAND 或 NOR 实现之间转换。


7. Processor Clock Speed and Performance | 处理器时钟速度与性能

The clock cycle time is the inverse of the clock frequency: T = 1 / f n hertz (Hz), T is in seconds. For a 3 GHz processor, the period is 1 / (3×10⁹) ≈ 0.33 ns.

时钟周期时间是时钟频率的倒数:T = 1 / f。f 以赫兹 (Hz) 为单位,T 以秒为单位。对于 3 GHz 处理器,周期为 1 / (3×10⁹) ≈ 0.33 ns。

Instructions per second (IPS) is calculated as: IPS = f / CPI, where CPI is the average number of clock cycles per instruction. Execution time for a program can be expressed as: Execution time = instruction count × CPI × T. This formula shows that performance improves with higher frequency, lower CPI, or fewer instructions.

每秒指令数 (IPS) 计算公式为:IPS = f / CPI,其中 CPI 是每条指令的平均时钟周期数。程序的执行时间可以表示为:执行时间 = 指令数 × CPI × T。该公式表明,提高频率、降低 CPI 或减少指令数都能提升性能。

Pipelining and multiple cores improve throughput. The ideal speedup from N pipeline stages is N, but hazards reduce this. For multi‑core processors, the theoretical maximum speedup is limited by Amdahl’s law, though at AS level a qualitative understanding is expected.

流水线和多核技术可提高吞吐量。N 级流水线的理想加速比为 N,但各类冲突会使其降低。对于多核处理器,理论最大加速比受阿姆达尔定律限制,但 AS 阶段仅需了解定性分析。


8. Data Transmission Time and Bit Rate | 数据传输时间与比特率

The time to transmit a file across a network depends on the file size and the bit rate of the channel: Transmission time (s) = file size (bits) / bit rate (bps). Ensure units match: convert file size to bits (multiply bytes by 8) when the bit rate is in bits per second.

通过网络传输文件的时间取决于文件大小和信道的比特率:传输时间 (秒) = 文件大小 (位) / 比特率 (bps)。确保单位一致:当比特率以每秒位数为单位时,将文件大小转换为位(字节数乘以 8)。

In serial communication, the baud rate is the number of signal changes per second. The relationship with bit rate is: Bit rate = baud rate × bits per signal element. For a simple system where each signal level carries one bit, baud rate equals bit rate; in higher‑order modulation, one signal element can represent multiple bits.

在串行通信中,波特率是每秒信号变化的次数。它与比特率的关系是:比特率 = 波特率 × 每信号单元的位数。对于每个信号电平携带一位的简单系统,波特率等于比特率;在高阶调制中,一个信号单元可以表示多个位。

Throughput and latency also affect effective transmission. Propagation delay is distance divided by signal speed; serial transmission overhead includes start and stop bits, which reduce useful data rate.

吞吐量和延迟也会影响有效传输。传播时延是距离除以信号速度;串行传输的开销包括起始位和停止位,这会降低有效数据率。


9. Error Detection: Parity, Checksum, CRC | 错误检测:奇偶校验、校验和、CRC

Parity checking adds a single bit to a binary string so that the total number of 1s is even (even parity) or odd (odd parity). It can detect any single‑bit error but cannot correct it or detect an even number of bit flips. The parity bit is calculated as the XOR

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

广告 / Sponsored
现货 Cambridge International AS & ALevel IT Coursebook剑桥国际IGC…
计算机 备考教辅 · 正版现货 · 与本文内容相关
查看详情 / View on Taobao参考价 ¥467.0

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

备考资讯每日更新,关注不错过
考纲变化 · 科目分析 · 学习方法
扫码关注公众号 tutorhao
在微信里长按二维码识别关注
或截图后用「扫一扫 → 相册」选择本图
公众号:tutorhao