IGCSE CIE Computer Science: Formulae Handbook | IGCSE CIE 计算机科学公式汇总手册

📚 IGCSE CIE Computer Science: Formulae Handbook | IGCSE CIE 计算机科学公式汇总手册

This handbook brings together all the key formulae and conversions you need for the CIE IGCSE Computer Science examinations. Use it for quick revision and as a reference when solving past paper questions. Each section explains the formula in plain English, followed by its Chinese equivalent, so you can master both the concept and the terminology.

本手册汇总了 CIE IGCSE 计算机科学考试中所有关键公式与换算方法。可用于快速复习,也可作为刷真题时的参考。每个部分先用通俗英语解释公式,再给出对应中文说明,帮助你同时掌握概念和术语。

1. Data Unit Conversion | 数据单位换算

All file size and transfer speed calculations start from bits. In IGCSE Computer Science, storage units are based on powers of 2, where 1 kibibyte (KiB) = 210 bytes, but the syllabus conventionally uses the terms kilobyte (KB), megabyte (MB), gigabyte (GB) and terabyte (TB) with the values 1024, 1048576, etc. Always verify the context of the question.

所有文件大小和传输速率的计算都从位(bit)开始。IGCSE 计算机科学中,存储单位基于 2 的幂,1 KiB = 210 字节,但考纲习惯使用千字节(KB)、兆字节(MB)、吉字节(GB)和太字节(TB),其值分别为 1024、1048576 等。务必根据题目上下文确认。

1 byte = 8 bits
1 KB = 1024 bytes
1 MB = 1024 KB = 1048576 bytes
1 GB = 1024 MB = 1073741824 bytes
1 TB = 1024 GB

To convert between units, multiply when moving to a smaller unit and divide when moving to a larger unit. For instance, to express 4 MB in bits: 4 × 1024 × 1024 × 8 = 33554432 bits.

进行单位换算时,向更小单位转换用乘法,向更大单位转换用除法。例如,将 4 MB 转换为位:4 × 1024 × 1024 × 8 = 33554432 位。

Always check whether the question requires the answer in bits, bytes, kilobytes, etc. Many marks are lost through simple unit conversion errors.

一定要检查题目要求答案的单位是位、字节还是千字节等。很多失分都是由简单的单位换算错误造成的。


2. Image File Size | 图像文件大小

The uncompressed size of a bitmap image depends on its pixel dimensions and colour depth. Colour depth is the number of bits used to represent the colour of each pixel.

位图图像的无压缩大小取决于像素尺寸和色深。色深是用来表示每个像素颜色的位数。

Image file size (bits) = image width (pixels) × image height (pixels) × colour depth (bits per pixel)

For example, an image of 800 × 600 pixels with 24-bit colour depth requires: 800 × 600 × 24 = 11520000 bits. To express this in megabytes: 11520000 ÷ (8 × 1024 × 1024) ≈ 1.37 MB.

例如,一张 800 × 600 像素、24 位色深的图像所需大小为:800 × 600 × 24 = 11520000 位。换算为兆字节:11520000 ÷ (8 × 1024 × 1024) ≈ 1.37 MB。

If the image has a separate alpha channel or uses an indexed palette, the colour depth may differ. Always read the question carefully to identify whether bits per pixel (bpp) is given.

如果图像带有单独的 Alpha 通道或使用索引调色板,色深可能不同。应仔细审题,确认题目给出的每像素位数(bpp)。


3. Sound File Size | 声音文件大小

Uncompressed audio file size is determined by the sample rate, sample resolution (bit depth), number of channels and duration.

无压缩音频文件大小由采样率、采样分辨率(位深度)、声道数和时长共同决定。

Sound file size (bits) = sample rate (Hz) × sample resolution (bits) × number of channels × duration (seconds)

Consider a 3-minute stereo recording with a sample rate of 44.1 kHz and 16-bit resolution. Bits = 44100 × 16 × 2 × 180 = 254016000 bits. In megabytes, that is 254016000 ÷ (8×1024×1024) ≈ 30.28 MB.

假设一段 3 分钟的立体声录音,采样率 44.1 kHz,分辨率 16 位。位数 = 44100 × 16 × 2 × 180 = 254016000 位。换算为兆字节约为 30.28 MB。

Commonly, mono means 1 channel and stereo means 2 channels. Make sure the sample rate is in hertz (samples per second) and duration in seconds.

通常单声道为 1 声道,立体声为 2 声道。务必确认采样率单位为赫兹(每秒采样数),时长单位为秒。


4. Text File Size | 文本文件大小

Plain text file size can be estimated by multiplying the number of characters by the number of bits per character. The most common encodings are ASCII (7 or 8 bits per character) and Unicode (often 16 bits per character, but variable in UTF-8).

纯文本文件大小可以通过字符数乘以每字符位位数来估算。最常用的编码有 ASCII(每字符 7 或 8 位)和 Unicode(通常每字符 16 位,但 UTF-8 为变长)。

Text file size (bits) = number of characters × bits per character

If a text file contains 2000 characters encoded in extended ASCII (8 bits each), the size is 2000 × 8 = 16000 bits, which equals 2000 bytes because 1 byte = 8 bits.

如果文本文件包含 2000 个字符,采用扩展 ASCII 编码(每字符 8 位),则大小为 2000 × 8 = 16000 位,即 2000 字节(因为 1 字节 = 8 位)。

When a question specifies Unicode, IGCSE typically uses 16 bits per character. However, if the question references UTF-8, you may need to consider that characters can occupy between 1 and 4 bytes.

当题目指定使用 Unicode 时,IGCSE 通常采用每字符 16 位。但如果涉及 UTF-8,则字符可能占 1 到 4 字节,需视情况而定。


5. Data Transfer Time | 数据传输时间

The time needed to transmit a file over a network is found by dividing the file size (in bits) by the data transfer rate (in bits per second). Always ensure both are in the same unit.

通过网络传输文件所需的时间,由文件大小(以位为单位)除以数据传输速率(以每秒位数为单位)得出。务必保证两者单位一致。

Transfer time (seconds) = file size (bits) ÷ transfer rate (bps)

If a 10 MB file is to be sent over a connection with a rate of 5 Mbps, first convert 10 MB to bits: 10 × 1024 × 1024 × 8 = 83886080 bits. Transfer time = 83886080 ÷ 5000000 ≈ 16.78 seconds.

若要通过 5 Mbps 的连接发送 10 MB 文件,先将 10 MB 转换为位:10 × 1024 × 1024 × 8 = 83886080 位。传输时间 = 83886080 ÷ 5000000 ≈ 16.78 秒。

Note that transfer rates are often given in Mbps (megabits per second) or Gbps. 1 Mbps = 1000000 bits per second in data communications, unlike storage where 1 MB = 1048576 bytes. The IGCSE syllabus expects you to use 1 Mbps = 1,000,000 bps unless otherwise stated.

注意,传输速率通常以 Mbps(兆位/秒)或 Gbps 表示。在数据通信中,1 Mbps = 1,000,000 bps,这不同于存储中的 1 MB = 1048576 字节。IGCSE 考纲默认使用 1 Mbps = 1,000,000 bps,除非特别说明。


6. Compression Ratio and Saving Percentage | 压缩比与节省百分比

Compression reduces file size. Two useful measures are the compression ratio and the percentage reduction (saving percent).

压缩可以减少文件大小。两个有用的衡量指标是压缩比和减少百分比(节省百分比)。

Compression ratio = uncompressed size ÷ compressed size
Saving (%) = ((uncompressed size − compressed size) ÷ uncompressed size) × 100%

A photograph originally 8 MB that compresses to 2 MB gives a compression ratio of 8 ÷ 2 = 4:1. The space saving is ((8 − 2) ÷ 8) × 100% = 75%.

一张原为 8 MB 的照片压缩后变成 2 MB,压缩比为 8 ÷ 2 = 4:1。空间节省率为 ((8 − 2) ÷ 8) × 100% = 75%。

Be comfortable converting between ratio and percentage. A ratio of 5:1 means the compressed file is one fifth of the original, a saving of 80%.

要熟练进行比例和百分比之间的转换。5∶1 的压缩比表示压缩后文件是原始文件的五分之一,节省了 80%。


7. Colour Depth and Number of Colours | 色深与颜色数量

The colour depth, measured in bits per pixel (bpp), determines the maximum number of distinct colours an image can display.

以色深(每像素位数,bpp)决定图像能够显示的最大颜色数量。

Number of colours = 2colour depth in bits

Typical values:

Colour depth Number of colours
1 bpp 2 (black and white)
8 bpp 256
16 bpp 65536
24 bpp 16777216 (True Colour)

Increasing colour depth improves image quality but increases file size proportionally. Use this relationship in questions that ask how colour depth affects storage.

增加色深可提高图像质量,但也会按比例增加文件大小。在考查色深如何影响存储的题目中可利用这一关系。


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

Boolean algebra is the mathematical backbone of logic circuits. The laws allow you to simplify logic expressions and reduce the number of gates.

布尔代数是逻辑电路的数学基础。这些定律可用于化简逻辑表达式、减少门电路数量。

Key Boolean Laws (∧ = AND, ∨ = OR, ¬ = NOT)

Law Expression
Identity A ∧ 1 = A, A ∨ 0 = A
Null A ∧ 0 = 0, A ∨ 1 = 1
Idempotent A ∧ A = A, A ∨ A = A
Complement A ∧ ¬A = 0, A ∨ ¬A = 1
Double negation ¬(¬A) = A
Commutative A ∧ B = B ∧ A, A ∨ B = B ∨ A
Associative A ∧ (B ∧ C) = (A ∧ B) ∧ C, same for ∨
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 are essential for simplifying conditions in programs and for designing efficient circuits with minimal gates.

这些定律在化简程序中的判断条件以及用最少门电路设计高效电路时至关重要。


9. Logic Circuit Simplification Rules | 逻辑电路化简规则

Beyond the basic laws, several simplification rules help reduce expressions quickly. They can be derived from the laws above but are worth memorising.

除基本定律外,一些化简规则可快速减少表达式。它们可由上述定律推导出来,但值得记忆。

  • Redundancy: A ∨ (¬A ∧ B) = A ∨ B
    中文: A 或 (非 A 与 B) 等价于 A 或 B。
  • Consensus: (A ∧ B) ∨ (¬A ∧ C) ∨ (B ∧ C) = (A ∧ B) ∨ (¬A ∧ C)
    中文: 冗余项 B ∧ C 可以去掉。
  • Adjacency: (A ∧ B) ∨ (A ∧ ¬B) = A
    中文: 提取公因式 A,因为 B 与 ¬B 互补可消去。

Use these when doing Boolean simplification questions: always look for common factors, apply De Morgan’s law to push negations inward, and then eliminate redundancies.

在做布尔化简题时可使用这些规则:先提取公因式,运用德摩根律将非号向内移,再消除冗余项。


10. Number Representation and Conversions | 数字表示与转换

IGCSE candidates must be able to convert between binary, denary and hexadecimal, and understand how signed binary numbers (two’s complement) work. The fundamental formula for binary to denary uses place values.

IGCSE 考生必须能够进行二进制、十进制和十六进制之间的转换,并理解带符号二进制数(二进制补码)的原理。二进制转十进制的基本公式使用位权。

Denary value = Σ (bitᵢ × 2⁺⁻¹) from most significant bit

For an 8-bit unsigned binary number b₇b₆…b₀, the denary number = b₇×2⁷ + b₆×2⁶ + … + b₀×2⁰. For example, 10111001₂ = 1×128 + 0×64 + 1×32 + 1×16 + 1×8 + 0×4 + 0×2 + 1×1 = 128+32+16+8+1 = 185.

对于 8 位无符号二进制数 b₇b₆…b₀,十进制值 = b₇×2⁷ + b₆×2⁶ + … + b₀×2⁰。例如,10111001₂ = 185。

Two’s complement representation: the most significant bit carries a negative weight. For an 8-bit two’s complement number, denary = −b₇×2⁷ + b₆×2⁶ + … + b₀×2⁰. Thus 11001010₂ = −1×128 + 1×64 + 0×32 + 0×16 + 1×8 + 0×4 + 1×2 + 0×1 = −128+64+8+2 = −54.

二进制补码表示法中,最高位带有负权值。8 位补码转十进制 = −b₇×2⁷ + b₆×2⁶ + … + b₀×2⁰。因此 11001010₂ = −54。

Hexadecimal to binary: each hex digit maps to 4 bits. Denary to hex: repeatedly divide by 16 and collect remainders. These conversions underpin memory addresses, colour codes and machine code.

十六进制与二进制互转:每个十六进制数位对应 4 个二进制位。十进制转十六进制:连续除以 16 并收集余数。这些转换是内存地址、颜色代码和机器码的基础。


11. Check Digit and Parity Calculations | 校验位与奇偶校验计算

Error detection often uses parity bits and check digits. A parity bit makes the total number of 1s in a binary string either even (even parity) or odd (odd parity).

错误检测常使用奇偶校验位和校验位。奇偶校验位使二进制串中 1 的总数为偶数(偶校验)或奇数(奇校验)。

Even parity: parity bit = 1 if count of 1s in data is odd, else 0

For the data byte 1100100 (seven 1s → odd), an even parity bit would be 1, making the byte 11100100 with eight 1s.

对于数据字节 1100100(七个 1 → 奇数),偶校验位应为 1,使字节变为 11100100,共八个 1。

ISBN-13 check digit uses a weighted sum formula: total = sum of alternately weighted digits (1 and 3). The check digit is (10 – (total mod 10)) mod 10. IGCSE may ask you to verify an ISBN or calculate a missing digit.

ISBN-13 校验位使用加权求和公式:总和 = 交替加权(1 和 3)的各位数字之和。校验位 = (10 – (总和 mod 10)) mod 10。IGCSE 可能要求验证 ISBN 或计算缺失的数字。


12. Sample Rate, Bit Rate and Quality | 采样率、比特率与质量

The bit rate of uncompressed audio is the product of sample rate, sample resolution and number of channels. It is measured in bits per second (bps).

无压缩音频的比特率是采样率、采样分辨率和声道数的乘积,单位为每秒位数(bps)。

Bit rate (bps) = sample rate (Hz) × sample resolution (bits) × channels

CD-quality audio (44.1 kHz, 16-bit, stereo) has a bit rate of 44100 × 16 × 2 = 1411200 bps ≈ 1.41 Mbps. This explains why one minute of CD audio requires about 10 MB.

CD 品质的音频(44.1 kHz、16 位、立体声)比特率为 44100 × 16 × 2 = 1411200 bps ≈ 1.41 Mbps。这解释了为何 1 分钟 CD 音频大约需要 10 MB。

Higher bit rates generally mean better sound fidelity but larger files. The same principle applies to video: bit rate = frame size × frame rate × colour depth (although video compression makes it more complex).

比特率越高,通常声音保真度越好,但文件也越大。同样的原理适用于视频:比特率 = 帧尺寸 × 帧率 × 色深(尽管视频压缩使其更复杂)。


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