📚 IGCSE Edexcel Computer Science Formula Handbook | IGCSE Edexcel 计算机:公式汇总手册
This handbook brings together all the essential formulas required for the IGCSE Edexcel Computer Science specification. From file size calculations to Boolean algebra, each section provides clear definitions, worked concepts, and the core equations you need to apply in exams. Keep this guide close during revision to strengthen your numerical problem-solving skills.
本手册汇集了 IGCSE Edexcel 计算机科学课程所需的所有核心公式。从文件大小计算到布尔代数,每一节都提供清晰的定义、概念讲解以及考试中必须掌握的关键方程。在复习期间将这份指南放在手边,有助于提升你的数值问题解决能力。
1. Text File Size | 文本文件大小
A plain text file's size depends on the number of characters and the bits used per character. Standard ASCII uses 7 or 8 bits per character, while Unicode (UTF-16) often uses 16 bits per character, doubling the storage requirement.
纯文本文件的大小取决于字符数量和每个字符使用的比特数。标准 ASCII 每个字符使用 7 或 8 位,而 Unicode (UTF-16) 通常每个字符使用 16 位,存储需求翻倍。
File Size (bits) = Number of characters × Bits per character
Extended ASCII: 8 bits per character
扩展 ASCII:每字符 8 位
Unicode: 16 bits per character
Unicode:每字符 16 位
To convert bits to bytes, divide by 8. For kilobytes, divide bytes by 1024.
将位转换为字节需要除以 8。将字节转换为千字节需要除以 1024。
2. Image File Size | 图像文件大小
Bitmap images are composed of pixels. Each pixel’s colour is stored using a fixed number of bits, known as the colour depth. The file size (uncompressed) is determined by the total number of pixels multiplied by the colour depth.
位图图像由像素组成。每个像素的颜色使用固定数量的位来存储,称为色深。未压缩的文件大小由像素总数乘以色深决定。
Image Size (bits) = Width (pixels) × Height (pixels) × Colour Depth (bits)
For example, a 1024 × 768 image with 24‑ 4 bits. This can be converted to bytes (÷8) and further to megabytes (÷1024²) if required.
例如,一张 1024 × 768、24 位色深的图像需要 1024 × 768 × 24 位。如果需要,可以转换为字节(÷8)并进一步转换为兆字节(÷1024²)。
3. Sound File Size | 音频文件大小
= 1, stereo = 2). A higher sample rate or bit depth gives better quality but larger files.
未压缩音频文件的大小由采样率、位深度、时长和声道数(单声道 = 1,立体声 = 2)计算得出。采样率或位深度越高,音质越好,但文件也越大。
ound Size (bits) = Sample Rate (Hz) × Bit Depth (bits) × Duration (s) × Number of Channels
If a 10‑second stereo track is recorded at 44.1 kHz with 16‑ 44100 × 16 × 10 × 2 = 14 112 000 bits. Divide by 8 for bytes, then by 1024² for megabytes.
若一段 10 秒的立体声以 44.1 kHz、16 位深度录制,位大小为:44100 × 16 × 10 × 2 = 14 112 000 位。除以 8 得到字节,再除以 1024² 得到兆字节。
4. Video File Size (Uncompressed) | 视频文件大小(未压缩)
Uncompressed video size combines image frames per second with the pixel data of each frame. This produces extremely large files, which is why compression is essential for storage and streaming.
未压缩视频大小结合了每秒图像帧数与每帧的像素数据。这会产生极大的文件,因此压缩对于存储和流媒体传输至关重要。
Video Size (bits) = Width × Height × Colour Depth × Frame Rate (fps) × Duration (s)
This formula assumes no audio track and no inter‑frame compression. Always include audio separately if required, using the sound formula.
此公式假设没有音轨,也没有帧间压缩。如果需要,应使用音频公式单独计算音轨大小。
5. Data Transfer Time | 数据传输时间
When sending a file over a network, the transfer time depends on the file size and the available data transfer rate (bandwidth). Consistent units are crucial – file size in bits, transfer rate in bits per second (bps).
通过网络发送文件时,传输时间取决于文件大小和可用的数据传输速率(带宽)。单位一致至关重要——文件大小以位为单位,传输速率以每秒位数为单位。
Transfer Time (s) = File Size (bits) / Transfer Rate (bps)
50 Mbps, time = 100 / 50 = 2 seconds. Be careful with megabits and megabytes: 1 MB = 8 Mb.
如果一个 100 兆位的文件以 50 Mbps 传输,时间 = 100 / 50 = 2 秒。注意兆位与兆字节的区别:1 MB = 8 Mb。
6. Compression Ratio | 压缩比
Compression reduces file size, and the compression ratio measures how effectively this is done. It is the ratio of the original size to the compressed size, expressed as a value greater than 1 (or as a percentage).
压缩可减小文件大小,压缩比用于衡量压缩效果。它是原始大小与压缩后大小的比值,用大于 1 的数值(或百分比)表示。
Compression Ratio = Original Size / Compressed Size
s 5 : 1. You may also see percentage reduction: ((Original - Compressed) / Original) × 100%.
例如,如果一个 500 KB 的文件压缩到 100 KB,压缩比为 5 : 1。还可能出现百分比缩减:((原始 - 压缩) / 原始) × 100%。
7. Number Systems and Units | 数制与单位
Computers use binary (base‑2) and hexadecimal (base‑16). Conversions between binary, denary (base‑10), and hex are fundamental. Memory units follow binary prefixes based on powers of 2.
计算机使用二进制(基数为 2)和十六进制(基数为 16)。二进制、十进制(基数为 10)和十六进制之间的转换是基础。存储单位遵循基于 2 的幂的二进制前缀。
4‑bit group 4 位组 | 1111₂ = F₁₆ |
Byte 字节 | 1 byte = 8 bits |
Kilobyte (KB) 千字节 | 1 KB = 1024 bytes |
Megabyte (MB) 兆字节 | 1 MB = 1024 KB = 1024² bytes |
Gigabyte (GB) 千兆字节 | 1 GB = 1024 MB = 1024³ bytes |
Terabyte (TB) 太字节 | 1 TB = 1024 GB = 1024⁴ bytes |
To convert hex to binary, replace each hex digit with its 4‑bit binary equivalent. To convert binary to denary, sum the column values where a 1 appears.
将十六进制转换为二进制时,将每个十六进制数字替换为其等效的 4 位二进制数。将二进制转换为十进制时,对出现 1 的位的列值求和。
8. Processor Performance | 处理器性能
CPU speed is influenced by clock frequency, the number of instructions executed per cycle, and the architecture. The key metrics are execution time per instruction and MIPS (Millions of Instructions Per Second).
CPU 速度受时钟频率、每个周期执行的指令数以及架构影响。关键指标是每条指令的执行时间和 MIPS(每秒百万指令数)。
Execution Time per Instruction = 1 / Clock Frequency (Hz)
er, modern CPUs may execute multiple instructions per cycle (superscalar). The MIPS formula is:
如果处理器运行在 2 GHz,一个时钟周期为 1/(2×10⁹) = 0.5 ns。但现代 CPU 可能每个周期执行多条指令(超标量)。MIPS 公式为:
MIPS = (Clock Speed (Hz) × Average Instructions per Cycle) / 10⁶
Instructions Per Cycle) or CPI (Cycles Per Instruction). If CPI is given, use IPC = 1/CPI.
务必检查题目提供的是 IPC(每条周期指令数)还是 CPI(每条指令周期数)。若给出 CPI,则 IPC = 1/CPI。
9. Logic Gates and Boolean Algebra | 逻辑门与布尔代数
Logic gates (AND, OR, NOT, NAND, NOR, XOR) are the building blocks of digital circuits. Boolean algebra provides laws to simplify expressions, which can reduce the number of gates required in a circuit.
逻辑门(AND、OR、NOT、NAND、NOR、XOR)是数字电路的构建模块。布尔代数提供了简化表达式的定律,从而减少电路中所需的门数量。
Key identities and laws:
关键恒等式和定律:
De Morgan's Laws: NOT (A AND B) = (NOT A) OR (NOT B); NOT (A OR B) = (NOT A) AND (NOT B)
德摩根定律: NOT (A AND B) = (NOT A) OR (NOT B); NOT (A OR B) = (NOT A) AND (NOT B)
Distribution: A AND (B OR C) = (A AND B) OR (A AND C); A OR (B AND C) = (A OR B) AND (A OR C)
分配律:A AND (B OR C) = (A AND B) OR (A AND C);A OR (B AND C) = (A OR B) AND (A OR C)
Identity and Null: A OR 0 = A; A AND 1 = A; A OR 1 = 1; A AND 0 = 0
同一律与零律:A OR 0 = A;A AND 1 = A;A OR 1 = 1;A AND 0 = 0
Double Negation: NOT (NOT A) = A
双重否定:NOT (NOT A) = A
n A and B are different. Its Boolean expression: A XOR B = (A AND NOT B) OR (NOT A AND B).
异或真值表:当 A 和 B 不同时,A XOR B 为真。其布尔表达式:A XOR B = (A AND NOT B) OR (NOT A AND B)。
10. Binary Addition and Overflow | 二进制加法与溢出
1. Problems occur when the result exceeds the bit width of the register, causing overflow.
二进制加法与十进制加法类似:0+0=0,0+1=1,1+0=1,1+1=0 进位 1,1+1+进位=1 进位 1。当结果超出寄存器的位宽时会出现问题,导致溢出。
An overflow error happens when adding two positive numbers yields a negative result, or two negatives yield a positive, in two's complement arithmetic. The overflow flag is set when the carry into the sign bit differs from the carry out of the sign bit.
在二进制补码运算中,当两个正数相加得到负数,或两个负数相加得到正数时,会发生溢出错误。当进入符号位的进位与离开符号位的进位不同时,溢出标志置位。
Overflow detection rule: if Carry_in to MSB XOR Carry_out of MSB = 1, then overflow.
溢出检测规则:如果进入最高有效位 (MSB) 的进位与离开 MSB 的进位异或结果为 1,则发生溢出。
11. Error Detection – Parity and Check Digits | 错误检测 – 奇偶校验与校验位
Data transmission errors can be detected using parity bits. An even parity bit is set so that the total number of 1‑bits (including the parity bit) is even. Odd parity makes the total odd.
数据传输错误可以通过奇偶校验位进行检测。偶校验位的设置使得(包括校验位在内的)1 的总数为偶数。奇校验则使总数为奇数。
parity bit would be 1 to make total 1s = 6 (even). The receiver recalculates and compares.
偶校验的校验位 = 所有数据位的异或。如果数据字节是 1011001(七个 1),偶校验位应为 1,使 1 的总数达到 6(偶数)。接收方会重新计算并进行比较。
Check digits are used in identification numbers (e.g., ISBN). A common algorithm is modulo‑ mmed, and the remainder modulo 11 gives the check digit. If remainder = 10, check digit is 'X'.
校验位用于识别码(如 ISBN)。常见算法是模 11:每位数字按其位置加权,乘积求和,除以 11 取余数得到校验位。如果余数为 10,校验位为 'X'。
Check Digit = 11 – (Sum of weighted digits mod 11)
12. Sampling and Resolution – Key Relationships | 采样与分辨率 – 关键关系
The quality of a digital representation depends on sampling rate (for sound) or resolution (for images). The Nyquist theorem states that to accurately capture a frequency, the sampling rate must be at least twice the highest frequency.
数字表示的质量取决于采样率(对于声音)或分辨率(对于图像)。奈奎斯特定理指出,要准确捕获一个频率,采样率必须至少为该最高频率的两倍。
her resolution means more detail but larger file size. The relationship follows: File size ∝ resolution × colour depth. Similarly, sound file size ∝ sample rate × bit depth × duration.
对于图像,分辨率越高意味着细节越多,但文件也越大。关系为:文件大小 ∝ 分辨率 × 色深。类似地,音频文件大小 ∝ 采样率 × 位深度 × 时长。
These proportional relationships help explain why increasing any one parameter linearly increases storage or bandwidth requirements. Always use the specific formulas from earlier sections for exact calculations.
这些比例关系有助于解释为什么线性增加任何一个参数都会增加存储或带宽需求。进行精确计算时,请始终使用前面章节中的具体公式。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

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