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

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

This handbook collates the essential formulas, conversions, and Boolean theorems required for the AS Level CIE Computer Science (9618) syllabus. Use it as a rapid revision tool to reinforce your understanding of data representation, multimedia calculations, processor performance, and logic simplification.

本手册汇集了 AS CIE 计算机科学(9618)课程所需的核心公式、转换规则与布尔定理。可将它作为快速复习工具,巩固对数据表示、多媒体计算、处理器性能以及逻辑简化的理解。

1. Number Systems & Conversions | 数制与转换

A binary number bn-1…b1b0 can be converted to decimal using positional notation.

二进制数 bn-1…b1b0 可用按位权展开的方式转换为十进制。

Decimal = bₙ₋₁ × 2ⁿ⁻¹ + … + b₁ × 2¹ + b₀ × 2⁰

To convert from decimal to binary, repeatedly divide the number by 2 and record the remainders; the binary result is the remainders read from bottom to top.

十进制转二进制时,反复将数字除以 2 并记录余数,从下往上读取余数即为二进制结果。

Hexadecimal uses base 16, where digits A–F represent 10–15. Each hex digit maps directly to a 4-bit nibble.

十六进制以 16 为基数,字母 A–F 代表 10–15。每个十六进制数字直接对应一个 4 位半字节。

1A3F₁₆ = 1×16³ + 10×16² + 3×16¹ + 15×16⁰ = 6719₁₀


2. Binary Arithmetic & Overflow | 二进制算术与溢出

Binary addition follows these basic rules: 0+0=0, 0+1=1, 1+0=1, and 1+1=0 with a carry of 1 into the next column.

二进制加法遵循基本规则:0+0=0,0+1=1,1+0=1,1+1=0 并向高位进位 1。

Overflow occurs when the result of an addition exceeds the maximum value that can be represented with the given number of bits. For example, adding two 8-bit signed integers might produce a 9-bit result, which cannot be stored and causes the sign bit to be corrupted.

当加法结果超出指定位数能表示的最大值时则发生溢出。例如,两个 8 位有符号整数相加可能产生 9 位结果,无法存下并导致符号位被破坏。

01111111₂ + 00000001₂ = 10000000₂ (signed overflow)


3. Two’s Complement Representation | 补码表示

Negative integers in binary are stored using two’s complement. To obtain the negative of a number, invert all bits and add 1.

二进制中的负整数采用补码存储。求某个数的负数时,将所有位取反后加 1。

−N = (NOT N) + 1

The most significant bit acts as the sign bit: 0 for positive, 1 for negative. For an 8-bit two’s complement number, the range is from −128 to +127.

最高位充当符号位:0 表示正,1 表示负。对 8 位补码而言,取值范围为 −128 到 +127。

The decimal value of an n-bit two’s complement number bn-1…b0 is:

n 位补码 bn-1…b0 的十进制值为:

−bₙ₋₁ × 2ⁿ⁻¹ + Σ (bᵢ × 2ⁱ) for i = 0 to n−2


4. Multimedia File Size Calculations | 多媒体文件大小计算

Image file size depends on the resolution (width × height) and colour depth. The uncompressed size in bytes is:

图像文件大小取决于分辨率(宽×高)和色深。未压缩的字节大小为:

Size (bytes) = (Width in pixels) × (Height in pixels) × (Colour depth in bits) ÷ 8

For a bitmap image with 1920×1080 pixels and 24-bit colour, the size is 1920 × 1080 × 24 ÷ 8 = 6,220,800 bytes (≈ 6.22 MB).

对于 1920×1080 像素、24 位色的位图,大小为 1920 × 1080 × 24 ÷ 8 = 6,220,800 字节(约 6.22 MB)。

Sound file size is calculated using sample rate, sample resolution (bit depth), number of channels, and duration:

声音文件大小由采样率、采样分辨率(位深)、声道数和时长计算:

Size (bytes) = Sample rate (Hz) × Sample resolution (bits) × Number of channels × Time (seconds) ÷ 8

For a stereo audio track of 3 minutes, 44.1 kHz sample rate, and 16-bit resolution: 44100 × 16 × 2 × 180 ÷ 8 = 31,752,000 bytes (≈ 31.75 MB).

一段 3 分钟立体声音频,采样率 44.1 kHz、16 位分辨率:44100 × 16 × 2 × 180 ÷ 8 = 31,752,000 字节(约 31.75 MB)。

Video file size is the sum of individual frame sizes plus the audio track. For uncompressed video:

视频文件大小是各帧大小与音频轨道之和。未压缩视频:

Size (bytes) = Frame width × Frame height × Colour depth × Frame rate × Duration (s) ÷ 8 + Audio size


5. Data Compression Ratios | 数据压缩比

The compression ratio indicates how much a file has been reduced in size.

压缩比表示文件被缩小的程度。

Compression ratio = Uncompressed size ÷ Compressed size

A ratio of 5:1 means the compressed file is one fifth of the original size. The space saving percentage is calculated as:

5:1 的压缩比意味着压缩后的文件是原始大小的五分之一。空间节省百分比计算如下:

Saving (%) = (1 − (1 ÷ Compression ratio)) × 100%


6. Network Transmission Calculations | 网络传输计算

The time required to send a file over a network depends on the file size and the transmission rate (bandwidth).

通过网络发送文件所需的时间取决于文件大小和传输速率(带宽)。

Transmission time (s) = File size (bits) ÷ Bandwidth (bps)

Remember to convert file size to bits (1 byte = 8 bits) and network speed to bits per second. If propagation delay is significant, total latency adds the time for a signal to travel the physical distance.

注意将文件大小转换为位(1 字节 = 8 位),网络速度转换为位每秒。若传播延迟显著,总延迟需加上信号在物理距离上的传播时间。

Total latency = Transmission time + Propagation delay


7. Processor Performance Formulas | 处理器性能公式

Processor performance is often expressed by the clock speed, cycles per instruction (CPI), and execution time.

处理器性能通常用时钟频率、每条指令周期数(CPI)和执行时间表示。

CPU time (seconds) = (Instruction count × CPI) ÷ Clock rate

Clock rate is measured in Hz; a 3 GHz processor has 3×10⁹ cycles per second. The average CPI depends on the instruction mix and the processor architecture.

时钟频率以 Hz 为单位;3 GHz 处理器每秒 3×10⁹ 个周期。平均 CPI 取决于指令组合和处理器架构。

Another useful metric is MIPS (Million Instructions Per Second):

另一个有用指标是 MIPS(每秒百万条指令):

MIPS = Clock rate ÷ (CPI × 10⁶)


8. Boolean Algebra Laws | 布尔代数定律

Boolean algebra is fundamental for simplifying logic circuits. The key laws and identities are listed below.

布尔代数是简化逻辑电路的基础。以下列出关键定律和恒等式。

Law AND form OR form
Identity A · 1 = A A + 0 = A
Null (Annulment) A · 0 = 0 A + 1 = 1
Idempotent A · A = A A + A = A
Complement A · Ā = 0 A + Ā = 1
Double Negation (Ā)̄ = 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)̄ = Ā + B̄ (A+B)̄ = Ā · B̄

De Morgan’s theorem is particularly important for converting between AND/NAND and OR/NOR logic. Use these laws to reduce the number of gates in a circuit.

德摩根定理对于 AND/NAND 与 OR/NOR 逻辑之间的转换尤为重要。用这些定律可减少电路中门的数量。


9. Logic Gates & Truth Tables | 逻辑门与真值表

The basic logic gates are NOT, AND, OR, NAND, NOR, and XOR. Their Boolean expressions and truth tables are summarised below.

基本逻辑门包括 NOT、AND、OR、NAND、NOR 和 XOR。下面对其布尔表达式和真值表进行总结。

Gate Expression Truth Table (A,B → Output)
AND A · B 00→0, 01→0, 10→0, 11→1
OR A + B 00→0, 01→1, 10→1, 11→1
NOT 0→1, 1→0
NAND (A·B)̄ 00→1, 01→1, 10→1, 11→0
NOR (A+B)̄ 00→1, 01→0, 10→0, 11→0
XOR A ⊕ B = Ā·B + A·B̄ 00→0, 01→1, 10→1, 11→0

The XOR gate outputs 1 only when inputs differ. NAND and NOR are called universal gates because any Boolean function can be implemented using only NAND or only NOR gates.

XOR 门仅在输入不同时输出 1。 NAND 和 NOR 被称为通用门,因为任何布尔函数都可以仅用 NAND 或仅用 NOR 门实现。


10. Karnaugh Map Simplification | 卡诺图简化

A Karnaugh map (K-map) is a visual method to simplify Boolean expressions. For two variables A and B, the map has four cells corresponding to minterms Ā·B̄, Ā·B, A·B̄, A·B.

卡诺图(K-map)是一种简化布尔表达式的可视化方法。对于两个变量 A 和 B,图中有四个单元格对应最小项 Ā·B̄、Ā·B、A·B̄、A·B。

F(A,B) = Σ(m₀, m₁, m₂, m₃) grouped as power-of-two rectangles

For three variables (A, B, C), an 8-cell map is used. Group adjacent 1s in sizes of 1, 2, 4, or 8. Each group eliminates the variable that changes within the group.

对于三个变量(A、B、C),使用 8 格卡诺图。将相邻的 1 以 1、2、4 或 8 个一组进行圈组,每组消除其中发生变化的变量。

A typical simplified expression from a K-map reads: F = Ā·C + B·C̄. The map reduces the number of logic gates required and is essential for AS exam optimisation tasks.

卡诺图得到的一个典型简化式如 F = Ā·C + B·C̄。该图能减少所需的逻辑门数量,是 AS 考试中优化任务的必备工具。


11. Parity & Error Detection | 奇偶校验与错误检测

Parity bits help detect single-bit errors during data transmission. An even parity bit is set so the total number of 1s in the data (including the parity bit) is even.

奇偶校验位能检测数据传输中的单比特错误。设置偶校验位,使得数据(含校验位)中 1 的总个数为偶数。

Even parity bit = XOR of all data bits

Odd parity makes the total number of 1s odd. If the received code has an incorrect parity, an error is flagged. Parity cannot correct errors or detect an even number of flipped bits.

奇校验使 1 的总数为奇数。若接收到的编码奇偶性错误,则标记错误。奇偶校验无法纠正错误,也无法检测偶数个比特翻转。

A 7-bit ASCII character with even parity: for ‘A’ (1000001₂), the parity bit is 0 because there are two 1s. The transmitted byte is 01000001. At the receiver, the parity is recomputed; a mismatch indicates a transmission error.

带偶校验的 7 位 ASCII 字符:’A’(1000001₂)有 2 个 1,故校验位为 0,发送字节为 01000001。接收端重新计算奇偶性,不一致则表明传输出错。


12. Floating-Point Representation | 浮点数表示

Floating-point numbers store real values using a mantissa and an exponent. The general form for normalised binary floating-point is:

浮点数用尾数和指数存储实数值。一般形式的规格化二进制浮点数为:

Value = (−1)ˢ × 1.M × 2^(E − bias)

where s is the sign bit, M is the fractional mantissa, E is the stored exponent, and the bias is typically 127 for single precision (or 2^(k−1) − 1 for k exponent bits). The mantissa is normalised so that it begins with 1 (binary point after the first 1).

其中 s 为符号位,M 为尾数的小数部分,E 为存储的指数,偏置值通常单精度为 127(对于 k 位指数,偏置为 2^(k−1) − 1)。尾数被规格化,使二进制小数点前为 1(即 1.M 形式)。

Published by TutorHao | AS 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课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply

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

Exit mobile version