📚 Year 12 Cambridge Computer Science: Formula & Theorem Quick Reference Handbook | 剑桥12年级计算机科学公式定理速查手册
This handbook consolidates the essential formulas, theorems, and conversion techniques required for the Cambridge International AS & A Level Computer Science (9618) syllabus. Use it for rapid revision and problem-solving practice, ensuring you always have quick access to the mathematical and logical foundations of the subject.
本手册汇编了剑桥国际AS与A Level计算机科学(9618)课程所需的基本公式、定理和转换技巧。用于快速复习和解题练习,确保你能随时查阅该学科的数学与逻辑基础。
1. Binary to Decimal Conversion | 二进制转十进制
To convert an unsigned binary integer to decimal, multiply each bit by its place value (power of 2) and sum the results. The rightmost bit has weight 20.
将无符号二进制整数转换为十进制时,将每一位乘以其位权(2的幂)并求和。最右边的位权重为20。
Decimal = bn-1 x 2n-1 + bn-2 x 2n-2 + ... + b1 x 21 + b0 x 20
For fractional binary numbers, bits after the point use negative powers of 2: 2-1, 2-2, etc.
对于小数部分,小数点后的位使用2的负次幂:2-1、2-2等。
2. Two's Complement Representation | 补码表示法
Two's complement is used to represent signed integers. The most significant bit (MSB) indicates the sign and carries a negative weight of -2n-1.
补码用于表示有符号整数。最高有效位表示符号,并带有负权重 -2n-1。
Value = -bn-1 x 2n-1 + Σi=0n-2 bi x 2i
To negate a number: invert all bits (one's complement) and add 1 to the least significant bit. The range for n bits is -2n-1 to 2n-1 - 1.
要取反一个数:将所有位取反(反码),然后在最低位加1。n位二进制补码的范围是 -2n-1 到 2n-1 - 1。
3. Floating Point Binary (Normalised) | 规格化浮点数
A normalised floating point number maximises precision by ensuring the mantissa starts with 01 (for positive) or 10 (for negative). The value is determined by mantissa, exponent, and bias.
规格化浮点数通过确保尾数以01(正数)或10(负数)开头来最大化精度。数值由尾数、指数和偏移量决定。
Value = (-1)sign x (1.mantissa) x 2(exponent - bias)
In Cambridge syllabus, stored mantissa is fractional; the leading 1 is implicit after normalisation. For a given mantissa bits M and exponent E with bias, decimal value equals (1 + M) x 2(E - bias) when sign is positive.
在剑桥课程中,存储的尾数是小数部分;规格化后隐含前导1。对于给定的尾数位M和指数E及偏移量,符号为正时十进制值等于 (1 + M) x 2(E - bias)。
4. Logic Gate Truth Tables & Boolean Expressions | 逻辑门真值表和布尔表达式
The fundamental logic gates (NOT, AND, OR, XOR, NAND, NOR) define the building blocks of digital circuits. Their behaviour is described by truth tables and Boolean algebra.
基本逻辑门(非、与、或、异或、与非、或非)定义了数字电路的基本构建块。其行为由真值表和布尔代数描述。
nputs are 1). OR gate: Output = A + B (TRUE when at least one input is 1). XOR: Output = A ⊕ B (TRUE when inputs differ).
对于两输入与门:输出 = A · B (仅当两个输入均为1时输出为真)。或门:输出 = A + B (至少一个输入为1时输出为真)。异或门:输出 = A ⊕ B (输入相异时输出为真)。
NAND and NOR are universal gates; any Boolean function can be implemented using only NAND or only NOR gates.
与非门和或非门是通用门;任何布尔函数都可以仅用与非门或仅用或非门来实现。
5. De Morgan's Theorem | 德摩根定理
De Morgan's theorems provide essential rules for simplifying and transforming Boolean expressions involving negation of conjunctions and disjunctions.
德摩根定理为涉及合取与析取取反的布尔表达式提供简化和转换的基本规则。
¬(A · B) = ¬A + ¬B
¬(A + B) = ¬A · ¬B
The complement of a product equals the sum of the complements; the complement of a sum equals the product of the complements. These theorems are crucial for converting between NAND/NOR implementations and for logic optimisation.
积的补等于补的和;和的补等于补的积。这些定理在NAND/NOR实现转换和逻辑优化中至关重要。
6. Karnaugh Map Simplification | 卡诺图化简
A Karnaugh map (K-map) offers a visual method to simplify Boolean expressions by grouping adjacent 1s in powers of two. Each group corresponds to a product term with eliminated variables.
卡诺图提供了一种可视化方法,通过将相邻的1以2的幂次分组来简化布尔表达式。每个分组对应一个消去变量的积项。
For a 2-variable map, groups of size 2, 4 eliminate 1, 2 variables respectively. The simplified expression is the OR of all prime implicants. Always cover all 1s with the fewest and largest groups.
对于2变量卡诺图,大小为2、4的分组分别消去1个、2个变量。简化表达式为所有质蕴含项的或。始终用最少且最大的组覆盖所有1。
A 'don't care' condition (X) can be treated as 1 or 0 to help form larger groups, reducing circuit complexity further.
无关项(X)可被当作1或0来帮助形成更大的组,进一步降低电路复杂度。
7. Processor Performance Formula | 处理器性能公式
Processor performance is often estimated using execution time, clock speed, and cycles per instruction. The relationship helps in comparing processors and understanding the impact of design choices.
处理器性能通常通过执行时间、时钟速度和每条指令周期数来估算。该关系有助于比较处理器并理解设计选择的影响。
CPU Time = Instruction Count x CPI x Clock Cycle Time
ency (f): Clock Cycle Time = 1 / f. Thus, CPU Time = Instruction Count x CPI / Clock Rate.
时钟周期时间是时钟频率的倒数:时钟周期时间 = 1 / f。因此,CPU时间 = 指令数 x CPI / 时钟频率。
CPI (Cycles Per Instruction) depends on the instruction mix and microarchitecture. Pipelining reduces effective CPI towards 1.
CPI(每条指令周期数)取决于指令组合和微架构。流水线技术可将有效CPI降至接近1。
8. Network Data Transmission Time | 网络数据传输时间
The total time to send a file across a network comprises transmission time, propagation delay, and sometimes processing/queuing delays. For simple link calculations, we focus on transmission and propagation.
通过网络发送文件的总时间包括传输时间、传播延迟,有时还包括处理/排队延迟。对于简单的链路计算,重点关注传输与传播。
Transmission Time = File Size / Bandwidth
Propagation Delay = Distance / Propagation Speed
pagation Delay (ignoring other overheads). Bandwidth is measured in bits per second (bps); ensure consistent units.
总延迟 = 传输时间 + 传播延迟(忽略其他开销)。带宽以比特每秒(bps)为单位;确保单位一致。
9. Relational Database Normal Forms (1NF, 2NF, 3NF) | 关系数据库范式 (1NF, 2NF, 3NF)
Normalisation is a formal process to eliminate data redundancy and update anomalies by applying successive normal forms. Each normal form adds constraints to the table structure.
规范化是通过应用逐级范式来消除数据冗余和更新异常的形式化过程。每个范式对表结构增加约束条件。
First Normal Form (1NF): All attributes contain atomic values; no repeating groups or arrays. A primary key must be identified.
第一范式(1NF): 所有属性都包含原子值;无重复组或数组。必须确定一个主键。
Second Normal Form (2NF): The table is in 1NF, and every non-key attribute is fully functionally dependent on the entire primary key (no partial dependencies).
第二范式(2NF): 表满足1NF,且每个非键属性完全函数依赖于整个主键(无部分依赖)。
Third Normal Form (3NF): The table is in 2NF, and no non-key attribute is transitively dependent on the primary key. All non-key attributes depend on 'nothing but the key'.
第三范式(3NF): 表满足2NF,且没有非键属性传递依赖于主键。所有非键属性仅依赖于键。
10. Boolean Algebra Laws | 布尔代数定律
Boolean algebra is governed by a set of laws that allow manipulation and simplification of logic expressions without constructing truth tables.
布尔代数由一组定律支配,允许在不构建真值表的情况下操作和简化逻辑表达式。
Key identities include: A + 0 = A, A · 1 = A (identity); A + A' = 1, A · A' A (idempotent); A + 1 = 1, A · 0 = 0 (annihilator); A + A·B = A, A·(A+B) = A (absorption).
主要恒等式包括: A + 0 = A,A · 1 = A(同一律);A + A' = 1,A · A' = 0(互补律);A + A = A,A · A = A(幂等律);A + 1 = 1,A · 0 = 0(湮灭律);A + A·B = A,A·(A+B) = A(吸收律)。
A+C). Associative and commutative laws also apply, forming a complete algebraic structure.
分配律: A·(B+C) = A·B + A·C;A + B·C = (A+B)·(A+C)。结合律和交换律同样适用,形成一个完整的代数结构。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

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