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

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

This quick reference guide compiles all essential formulas, theorems, and calculation rules you need to memorise for the Cambridge International AS Level Computer Science syllabus. It covers Boolean algebra, number representation, logic circuits, file sizes, data transmission, error detection, and IP networking. Use it as a last-minute revision aid or to reinforce your understanding throughout the course.

本速查手册汇集了剑桥国际 AS 阶段计算机科学课程中所有必须记忆的核心公式、定理和计算规则,涵盖布尔代数、数据表示、逻辑电路、文件大小、数据传输、差错检测和 IP 网络。你可以将它用作考前快速复习,或在平时学习中巩固知识。

1. Boolean Algebra Laws | 布尔代数基本定律

Boolean algebra simplifies logic expressions using a set of fundamental laws. The key identities are shown below with their standard notation — where ‘+’ represents logical OR, ‘·’ represents logical AND, and an overline denotes NOT. These laws underpin logic circuit design and Karnaugh map simplification.

布尔代数通过一组基本定律来简化逻辑表达式。下表给出了核心恒等式,使用标准符号——其中 ‘+’ 表示逻辑或,’·’ 表示逻辑与,上划线表示逻辑非。这些定律是逻辑电路设计和卡诺图化简的基础。

English Law 中文名称 Formula
Identity Law 同一律 A + 0 = A    A · 1 = A
Null Law (Domination) 零一律 A + 1 = 1    A · 0 = 0
Idempotent Law 重叠律 A + A = A    A · A = A
Complement Law 互补律 A + A = 1    A · A = 0
Involution Law 双重否定律 A = A
Commutative Law 交换律 A + B = B + A    A · B = B · A
Associative Law 结合律 (A + B) + C = A + (B + C)
(A · B) · C = A · (B · C)
Distributive Law 分配律 A · (B + C) = A · B + A · C
A + (B · C) = (A + B) · (A + C)
Absorption Law 吸收律 A + A · B = A    A · (A + B) = A
De Morgan’s Law 德·摩根定律 A · B = A + B
A + B = A · B

2. Karnaugh Map Simplification Rules | 卡诺图化简规则

Karnaugh maps (K-maps) provide a visual method for minimising Boolean functions. The map uses Gray code ordering so that adjacent cells differ by only one variable. Groups must be formed in sizes of 1, 2, 4, 8, … and must be rectangular. Each group corresponds to a product term where the variables that remain constant are kept, and those that change are eliminated. Always aim for the largest possible groups and ensure every ‘1’ is covered at least once.

卡诺图提供了一种可视化化简布尔函数的方法。它采用格雷码排列,使得相邻单元仅有一个变量不同。化简时圈出的组必须是 1, 2, 4, 8 … 的矩形。每一组对应一个乘积项:保持不变的变量保留,发生变化的变量消去。应尽可能圈出最大的组,并确保每个 ‘1’ 至少被覆盖一次。

Group Size = 2k → k variables eliminated

圈组大小 = 2k → 消去 k 个变量

A valid K-map simplification can be verified using Boolean algebra. Remember the covering rule: all cells containing a ‘1’ must be included, and cells containing a ‘0’ must not be included in any group. Don’t-care conditions (‘X’) may be treated as 0 or 1 to help make larger groups.

有效的卡诺图化简可以用布尔代数验证。记住覆盖规则:所有含 ‘1’ 的单元必须被包含,含 ‘0’ 的单元不能划入任何组。无关项 (‘X’) 可视为 0 或 1 来帮助形成更大的组。


3. Number Systems & Two’s Complement Arithmetic | 数制与补码运算

Understanding binary, denary and hexadecimal conversions is essential. The two’s complement method is used to represent negative integers. The range of an n-bit two’s complement integer is from -2n-1 to 2n-1-1. To negate a number, invert all bits and add 1.

理解二进制、十进制和十六进制的转换至关重要。二进制补码用于表示负整数。一个 n 位补码整数的表示范围是从 -2n-1 到 2n-1-1。对一个数取反(求负数):先将所有位取反,再加 1。

Two’s complement negation: -X = (bitwise NOT of X) + 1

补码求负:-X = (X 的按位取反) + 1

Subtraction is performed by adding the two’s complement of the subtrahend. Overflow occurs when the result exceeds the representable range, and can be detected when the carry into the sign bit differs from the carry out of the sign bit.

减法通过加上减数的补码来实现。当结果超出可表示范围时发生溢出,当符号位的进位输入与进位输出不同时就可以检测到溢出。

Number of bits (n) Range (two’s complement)
8 -128 to +127
16 -32 768 to +32 767

4. Floating-Point Representation & Normalisation | 浮点表示与规格化

Real numbers are stored in floating-point format: mantissa × 2exponent. Both mantissa and exponent are stored in two’s complement. To maximise precision, the mantissa is normalised — for a positive number it should start as 0.1…, and for a negative number as 1.0… (in two’s complement). The exponent is adjusted accordingly.

实数以浮点格式存储:尾数 × 2指数。尾数和指数均以补码形式存放。为最大化精度,尾数必须规格化——对于正数应以 0.1… 开头,对于负数应以 1.0… 开头(补码)。指数需作相应调整。

Value = Mantissa × 2Exponent

数值 = 尾数 × 2指数

Given k bits for the exponent, its range is -2k-1 to 2k-1-1, allowing shifts to represent very large or very small numbers. The precision is determined by the mantissa width.

若指数部分有 k 位,其范围是 -2k-1 到 2k-1-1,通过移位可表示极大或极小的数值。精度则由尾数的位宽决定。


5. Logic Gates & Adders | 逻辑门与加法器

The basic building blocks of digital circuits are logic gates: AND, OR, NOT, NAND, NOR, XOR, XNOR. A half adder adds two bits and produces a sum and carry. A full adder adds three bits (two operands and a carry-in).

数字电路的基本构件是逻辑门:与、或、非、与非、或非、异或、同或。半加器对两个位相加,产生和与进位。全加器则对三个位(两个操作数和一个进位输入)相加。

Half Adder: S = A ⊕ B    Cout = A · B

半加器:S = A ⊕ B    Cout = A · B

Full Adder: S = A ⊕ B ⊕ Cin    Cout = A·B + B·Cin + A·Cin

全加器:S = A ⊕ B ⊕ Cin    Cout = A·B + B·Cin + A·Cin

Multiple full adders can be cascaded to create an n‑bit ripple‑carry adder. The XOR gate is particularly useful for controlled inversion and parity generation.

多个全加器可级联构成 n 位行波进位加法器。异或门在受控取反和奇偶校验生成中尤为有用。


6. Flip-Flop Characteristic Equations | 触发器特征方程

Sequential logic circuits store state information. The next state (Qnext) is defined by the current state and inputs. The most common flip-flops are SR, JK and D types, each described by a characteristic equation.

时序逻辑电路可存储状态信息。下一状态 (Qnext) 由当前状态与输入决定。最常见的触发器是 SR、JK 和 D 触发器,每种都可用特征方程描述。

SR flip-flop: Qnext = S + RQ   (with constraint S·R = 0)

SR 触发器:Qnext = S + RQ   (约束条件 S·R = 0)

JK flip-flop: Qnext = J·Q + K·Q

JK 触发器:Qnext = J·Q + K·Q

D flip-flop: Qnext = D

D 触发器:Qnext = D

JK flip-flops are the most versatile because the invalid 1‑1 input condition is resolved by toggling. The D flip-flop is a simple data latch used in registers.

JK 触发器功能最强,因为 1‑1 输入条件会引发翻转,不再有无效态。D 触发器则是一种简单的数据锁存器,常用于寄存器。


7. File Size Calculations & Sampling Theorem | 文件大小计算与采样定理

Calculating storage requirements is a frequent exam task. The Nyquist theorem states that to avoid aliasing, the sampling frequency must be at least twice the highest frequency present in the analogue signal.

计算存储空间是考试中的常见任务。奈奎斯特定理指出,为避免混叠失真,采样频率至少应为模拟信号中最高频率的两倍。

Nyquist Theorem: fs ≥ 2 × fmax

奈奎斯特定理:fs ≥ 2 × fmax

Sound file size (bits) = sample rate (Hz) × sample resolution (bits) × number of channels × duration (seconds). Image file size = width (pixels) × height (pixels) × colour depth (bits). Text file size (approximately) = number of characters × bits per character.

声音文件大小(位)= 采样率 (Hz) × 采样分辨率 (位) × 声道数 × 时长 (秒)。图像文件大小 = 宽度 (像素) × 高度 (像素) × 色深 (位)。文本文件大小(近似)= 字符数 × 每字符位数。

Media Formula (bits)
Sound (uncompressed) Sample rate × bit depth × channels × time
Image (bitmap) Width × Height × Colour depth
Text (ASCII/Unicode) Characters × bits per character

8. Data Transmission & Bit Rate | 数据传输与比特率

When data is sent serially, the baud rate is the number of signal changes per second. The bit rate is the number of bits transmitted per second. If each signal level encodes multiple bits, the bit rate exceeds the baud rate.

串行传输数据时,波特率是每秒信号变化的次数。比特率是每秒传输的位数。若每个信号电平编码多个位,比特率会高于波特率。

Bit rate (bps) = Baud rate × Number of bits per signal

比特率 (bps) = 波特率 × 每个信号的比特数

Transmission time for a file can be found by dividing the file size (bits) by the effective bit rate. The simple propagation delay is distance divided by the speed of light in the medium.

文件的传输时间

Published by TutorHao | Year 12 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