Computing Science Formula & Theorem Quick Reference | 计算机科学公式定理速查手册

📚 Computing Science Formula & Theorem Quick Reference | 计算机科学公式定理速查手册

This quick reference guide summarises the essential formulas and theorems for SQA Computing Science at Year 11. Covering data representation, computer systems, algorithms, networking and databases, it provides a concise revision tool to help you solve exam problems with confidence. All key relationships are expressed in a clear, bilingual format with step-by-step examples where helpful.

本速查手册总结了 Year 11 SQA 计算机科学课程的核心公式与定理,涵盖数据表示、计算机系统、算法、网络和数据库。它以简明中英对照的形式呈现所有关键关系,并配有分步示例,助你自信解题、高效备考。


1. Data Storage & File Size Calculations | 数据存储与文件大小计算

File size (bits) = Number of characters × Bits per character

For plain text, the file size in bits equals the total number of characters multiplied by the encoding bits per character (e.g. 7 bits for ASCII, 8 bits for extended ASCII, variable for UTF-8).

对于纯文本,文件大小(比特)等于字符总数乘以每个字符的编码位数(例如 ASCII 为 7 位,扩展 ASCII 为 8 位,UTF-8 为可变长度)。

Uncompressed image size (bits) = Width × Height × Colour depth

This calculates the raw bitmap size, where width and height are in pixels and colour depth is in bits per pixel (e.g. 24 bits for true colour). Note that compressed formats like JPEG reduce this calculated size.

该公式计算原始位图大小,其中宽度和高度以像素为单位,颜色深度是每像素比特数(如真彩色为 24 位)。注意 JPEG 等压缩格式会减小实际文件大小。

Uncompressed sound size (bits) = Sample rate × Sample size × Channels × Duration (s)

Sample rate is in Hz, sample size in bits (e.g. 16), channels are usually 1 (mono) or 2 (stereo). The result gives the total bits for raw audio.

采样率单位为 Hz,采样大小为比特(如 16),声道数通常为 1(单声道)或 2(立体声)。计算结果为原始音频的总比特数。

Uncompressed video size (bits) = W × H × Colour depth × Frame rate × Time (s)

Video is treated as a sequence of still images, so multiply the per-frame size by the frame rate and duration.

视频可视为连续静止图像序列,因此将每帧大小乘以帧率和时长即可得到总大小。


2. Binary & Hexadecimal Number Systems | 二进制与十六进制数字系统

Unsigned range with n bits: 0 to 2ⁿ − 1

An n-bit unsigned integer can represent values from 0 up to 2ⁿ − 1. For example, 8 bits give 0–255.

n 位无符号整数可表示从 0 到 2ⁿ − 1 的值。例如,8 位可表示 0–255。

Two’s complement signed range: −2ⁿ⁻¹ to 2ⁿ⁻¹ − 1

For signed integers using two’s complement, the most negative number is −2ⁿ⁻¹ and the most positive is 2ⁿ⁻¹ − 1.

使用补码的有符号整数表示范围为 −2ⁿ⁻¹ 至 2ⁿ⁻¹ − 1,即最小的负数是 −2ⁿ⁻¹,最大的正数是 2ⁿ⁻¹ − 1。

Binary addition overflow occurs when the result falls outside the representable range. For signed numbers, overflow is detected if the carry into the sign bit differs from the carry out.

当计算结果超出可表示范围时,二进制加法会发生溢出。对于有符号数,若进入符号位的进位与出符号位的进位不同,则检测到溢出。

1 hex digit = 4 bits

Each hexadecimal digit (0–F) represents exactly 4 bits, making conversions straightforward: replace each hex digit with its 4-bit binary equivalent.

每一位十六进制数字(0–F)恰好代表 4 个二进制位,因此转换非常简单:将每位十六进制数字替换为对应的 4 位二进制即可。


3. Boolean Algebra Simplification | 布尔代数化简

Boolean algebra provides a mathematical framework for simplifying logic expressions. The following table summarises the core laws used in SQA Computing Science, where ‘+’ means OR, ‘·’ means AND, and ‘ means NOT.

布尔代数为化简逻辑表达式提供了数学框架。下表总结了 SQA 计算机科学中使用的核心定律,其中 ‘+’ 表示或,’·’ 表示与,’ 表示非。

Law (English) Expression 中文名称
Identity A + 0 = A   |   A · 1 = A 同一律
Null A + 1 = 1   |   A · 0 = 0 零一律
Idempotent A + A = A   |   A · A = A 幂等律
Complement A + A’ = 1   |   A · A’ = 0 互补律
Involution (A’)’ = A 双重否定律
Commutative A + B = B + A   |   A · B = B · A 交换律
Associative 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) 分配律
Absorption A + A·B = A   |   A·(A + B) = A 吸收律
De Morgan’s (A + B)’ = A’ · B’   |   (A · B)’ = A’ + B’ 德·摩根定律

These laws allow expressions to be reduced, leading to fewer logic gates in a circuit. For instance, A + A·B simplifies directly to A via absorption.

利用这些定律可以化简表达式,从而减少电路中所需的逻辑门数量。例如,A + A·B 可直接通过吸收律简化为 A。


4. Logic Gate Equivalents | 逻辑门等效

NAND = (A · B)’   |   NOR = (A + B)’

NAND and NOR are universal gates — every other gate can be constructed using only NAND, or only NOR. Their behaviour is simply the negation of AND and OR respectively.

NAND 和 NOR 是通用门——仅用 NAND 或仅用 NOR 就能构造出所有其他门。它们的逻辑行为只是与门、或门的取反。

XOR: A ⊕ B = A · B’ + A’ · B

The XOR (exclusive OR) output is 1 when exactly one input is 1. It can be built from AND, OR and NOT gates as shown.

异或门的输出在恰好一个输入为 1 时为 1。它可由与门、或门和非门按上述表达式构建。

XNOR: A ⊙ B = A · B + A’ · B’

The XNOR (equivalence) gate produces 1 when both inputs are equal. It is the complement of XOR.

同或门(等价门)在两个输入相等时输出 1。它是异或门的反函数。


5. CPU Performance Metrics | CPU 性能指标

Clock cycle time: T = 1 / f

The clock period T is the reciprocal of the clock frequency f (in Hz). For example, a 2 GHz processor has T = 1 / (2 × 10⁹) = 0.5 ns.

时钟周期 T 是时钟频率 f(单位 Hz)的倒数。例如,2 GHz 处理器的 T = 1 / (2 × 10⁹) = 0.5 ns。

CPU execution time = Instruction Count × CPI × T

Execution time is the product of the total number of instructions executed (IC), the average clock cycles per instruction (CPI), and the clock cycle time.

CPU 执行时间等于执行的指令总数(IC)乘以平均每条指令时钟周期数(CPI)再乘以时钟周期时间。

MIPS = IC / (Execution time × 10⁶)

MIPS (Million Instructions Per Second) is a raw speed metric. It can also be expressed as MIPS = f / (CPI × 10⁶). Higher MIPS does not always mean better performance across different architectures.

MIPS(每秒百万条指令)是一种粗粒度速度指标,也可表示为 MIPS = f / (CPI × 10⁶)。较高的 MIPS 并不总意味着跨架构的更好性能。


6. Algorithm Efficiency & Big-O Notation | 算法效率与大 O 表示法

Big-O notation characterises an algorithm’s worst-case complexity by describing how the running time or memory grows with input size n. Formally, f(n) = O(g(n)) means there exist constants c and n₀ such that f(n) ≤ c·g(n) for all n ≥ n₀.

大 O 表示法通过描述运行时间或内存如何随输入规模 n 增大来刻画算法的最坏情况复杂度。正式地,f(n) = O(g(n)) 表示存在常数 c 和 n₀,使得对所有 n ≥ n₀,有 f(n) ≤ c·g(n)。

Complexity Growth rate Example 中文示例
O(1) Constant Array index access 数组索引访问
O(log n) Logarithmic Binary searchPublished by TutorHao | Year 11 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