📚 IGCSE CCEA Computer Science Formula Handbook | IGCSE CCEA 计算机公式汇总手册
This article serves as a comprehensive revision guide for the essential formulas you must know for the IGCSE CCEA Computer Science examination. It covers data storage, image and sound calculations, network transmission, number conversions, Boolean algebra, and more. Master these formulas, and you will handle calculation questions with confidence.
本文是 IGCSE CCEA 计算机科学考试的全面复习指南,涵盖你必须掌握的核心公式。内容包括数据存储、图像与声音计算、网络传输、数制转换、布尔代数等。掌握这些公式,你就能自信地应对计算题。
1. Data Storage Units & Conversions | 数据存储单位与换算
The smallest unit of data is the bit (b), which represents a binary value of 0 or 1. A group of 8 bits is called a byte (B). Larger units are based on powers of 2, meaning each step up multiplies the previous unit by 1024.
数据的最小单位是比特(bit, b),表示一个二进制值 0 或 1。8 个比特组成一个字节(Byte, B)。更大的单位以 2 的幂为基础,每向上一级需要将前一级乘以 1024。
1 Byte = 8 bits
1 KB = 1024 B | 1 MB = 1024 KB
1 GB = 1024 MB | 1 TB = 1024 GB
从较大单位转换为较小单位时 乘以 1024,反向转换时 除以 1024。
2. Image File Size Calculation | 图像文件大小计算
The file size of a bitmap image depends on the image resolution (width × height in pixels) and the colour depth (number of bits used to store the colour of each pixel). The formula to find the size in bytes is:
位图图像的文件大小取决于图像分辨率(宽度 × 高度,以像素为单位)和色深(存储每个像素颜色所用的位数)。计算文件大小(字节)的公式为:
Image size (bytes) =
Width (px) × Height (px) × Colour depth (b) ÷ 8
例如,一幅分辨率为 1920×1080、色深为 24 位的图像,其未经压缩的文件大小约为:1920 × 1080 × 24 ÷ 8 ≈ 6.22 MB。
For example, an image with a resolution of 1920×1080 and a colour depth of 24 bits would have an uncompressed file size of approximately: 1920 × 1080 × 24 ÷ 8 ≈ 6.22 MB.
Always ensure the colour depth is in bits, and the resolution is in pixels. Dividing by 8 converts from bits to bytes, and you can further divide by 1024 repeatedly to get KB or MB.
请务必确保色深以位为单位,分辨率以像素为单位。除以 8 是将比特转换为字节,之后可以连续除以 1024 得到 KB 或 MB。
3. Sound File Size Calculation | 声音文件大小计算
Digital sound is stored by taking samples of the sound wave at regular intervals. The size of an uncompressed sound file is determined by four factors: sample rate, sample resolution (bit depth), number of channels, and duration. The formula is:
数字音频通过对声波进行等间隔采样存储。未压缩的声音文件大小由四个因素决定:采样率、采样分辨率(位深)、声道数和时长。计算公式为:
Sound size (bits) =
Sample rate (Hz) × Sample resolution (b) × Duration (s) × Channels
要得到以字节为单位的大小,只需将上述结果除以 8。
To obtain the size in bytes, divide the result above by 8.
For instance, a 3-minute stereo audio clip recorded at 44.1 kHz with 16-bit resolution would have a raw size of: 44100 × 16 × 180 × 2 = 254,016,000 bits ≈ 30.28 MB.
例如,一段 3 分钟、44.1 kHz 采样率、16 位分辨率、立体声的音频,原始大小为:44100 × 16 × 180 × 2 = 254,016,000 bits ≈ 30.28 MB。
4. Video File Size Estimation | 视频文件大小估算
A video file combines a sequence of images (frames) with audio. To estimate the total size, you calculate the storage needed for the image frames and add the sound track. A simplified formula is:
视频文件由连续的图像帧和音频组合而成。估算总大小时,需计算图像帧所需的存储空间并加上音轨。简化公式为:
Video size (bytes) ≈
(Frame width × Frame height × Colour depth ÷ 8) × Frame rate × Duration
+ Sound size (bytes)
例如,一段分辨率为 1920×1080、色深 24 位、帧率 30 fps、时长 60 秒的无声音视频,其图像部分大小约为:1920×1080×24÷8 × 30 × 60 ≈ 10.4 GB,实际视频通常还会包含压缩和音频,这只是粗略估算。
For example, a video with 1920×1080 resolution, 24-bit colour, 30 fps, 60 seconds duration and no sound would have an image portion of roughly: 1920×1080×24÷8 × 30 × 60 ≈ 10.4 GB. Real videos usually include compression and audio, so this is only a rough estimate.
5. Network Transmission Time | 网络传输时间
When a file is sent over a network, the transfer time depends on the size of the file (in bits) and the bandwidth or data transfer rate (in bits per second). The fundamental relationship is:
当文件通过网络传输时,传输时间取决于文件大小(以比特计)和带宽或数据传输速率(以比特每秒计)。基本关系为:
Transmission time (s) = File size (b) ÷ Bandwidth (bps)
务必保持单位一致:如果带宽以 Mbps 给出,需要转换为 bps(1 Mbps = 1,000,000 bps 或按 1,048,576 bps,视考试上下文而定;CCEA 通常使用 1 Mbit = 1,000,000 bits)。
Always ensure consistent units: if bandwidth is given in Mbps, convert to bps (1 Mbps = 1,000,000 bps or 1,048,576 bps depending on context; CCEA commonly uses 1 Mbit = 1,000,000 bits).
For example, a 50 MB file (400 Mbits) sent over a 10 Mbps connection would take: 400,000,000 ÷ 10,000,000 = 40 seconds.
例如,一个 50 MB 的文件(400 Mbits)通过 10 Mbps 的连接传输,需要的时间为:400,000,000 ÷ 10,000,000 = 40 秒。
6. Binary, Denary & Hexadecimal Conversion | 二进制、十进制与十六进制转换
Computers use binary (base-2). Denary (base-10) is our everyday number system. Hexadecimal (base-16) is a compact way to represent large binary numbers. Conversions rely on understanding place values.
计算机使用二进制(基数为 2)。十进制(基数为 10)是我们的日常记数系统。十六进制(基数为 16)是一种简洁表示大型二进制数的方式。转换依赖于对位值的理解。
To convert binary to denary, sum the products of each binary digit and its place value (power of 2): for binary 10112, the denary value is 1×23 + 0×22 + 1×21 + 1×20 = 8+0+2+1 = 1110.
二进制转十进制,将每位二进制数字与其位权(2 的幂)相乘后求和:例如二进制 10112,十进制值为 1×23 + 0×22 + 1×21 + 1×20 = 8+0+2+1 = 1110。
To convert denary to binary, repeatedly divide by 2 and record the remainders from bottom to top. Denary to hexadecimal involves dividing by 16; values 10–15 are represented by letters A–F.
十进制转二进制采用“除 2 取余”法,将余数由下至上排列。十进制转十六进制则是除以 16,余数 10–15 用字母 A–F 表示。
Hexadecimal to binary: replace each hex digit with its 4-bit binary equivalent. For example, A516 = 1010 01012. Binary to hex: group bits in fours from the right.
十六进制转二进制:将每个十六进制数字替换为其 4 位二进制等价形式。例如 A516 = 1010 01012。二进制转十六进制:从右向左每 4 位分组,再分别转换。
7. Boolean Algebra Laws | 布尔代数基本定律
Boolean algebra operates on binary variables (0 and 1) using the operators AND (·), OR (+), and NOT (′). The following laws help simplify logic circuits and expressions. Throughout, A, B, and C are Boolean variables.
布尔代数对二进制变量(0 和 1)使用与(·)、或(+)、非(′)运算符。下列定律有助于简化逻辑电路和表达式。以下 A、B、C 均为布尔变量。
Commutative Law: A · B = B · A and A + B = B + A. The order of variables does not matter for AND or OR.
交换律:A · B = B · A;A + B = B + A。变量间的顺序不影响 AND 或 OR 的结果。
Associative Law: (A · B) · C = A · (B · C) and (A + B) + C = A + (B + C). Grouping is irrelevant when all operators are the same.
结合律:(A · B) · C = A · (B · C);(A + B) + C = A + (B + C)。当操作符相同时,括号的分组方式不影响结果。
Distributive Law: A · (B + C) = (A · B) + (A · C) and A + (B · C) = (A + B) · (A + C). Note the symmetry.
分配律:A · (B + C) = (A · B) + (A · C);A + (B · C) = (A + B) · (A + C)。注意其对称性。
Identity Law: A · 1 = A and A + 0 = A. Annulment Law: A · 0 = 0 and A + 1 = 1.
恒等律:A · 1 = A;A + 0 = A。湮灭律:A · 0 = 0;A + 1 = 1。
Complement Law: A · A′ = 0 and A + A′ = 1.
补余律:A · A′ = 0;A + A′ = 1。
8. De Morgan’s Laws | 德摩根定律
De Morgan’s laws are crucial for converting between AND and OR operations with negation. They state:
德摩根定律对于带否定的 AND 和 OR 运算的相互转换至关重要。其表述如下:
(A · B)′ = A′ + B′
(A + B)′ = A′ · B′
In words: the complement of a conjunction (AND) is the disjunction (OR) of the complements, and conversely. These laws are widely used in circuit simplification and digital logic design.
简言之:与操作的补等于各变量补的或;或操作的补等于各变量补的与。这些定律广泛用于电路化简和数字逻辑设计。
For example, if we have the expression NOT(A AND B), we can replace it with (NOT A) OR (NOT B) using De Morgan’s law.
例如,如果有一个表达式 NOT(A AND B),根据德摩根定律,可以替换为 (NOT A) OR (NOT B)。
9. Parity Bits | 奇偶校验位
A parity bit is an extra bit added to a binary string to make the total number of 1s either even (even parity) or odd (odd parity). It is a simple error detection method.
奇偶校验位是一个附加到二进制串中的额外位,用于使总 1 的个数为偶数(偶校验)或奇数(奇校验)。它是一种简单的差错检测方法。
For even parity, the parity bit is chosen so that the total number of 1s in the data plus parity bit is even. If the original data already has an even number of 1s, the parity bit is 0; otherwise, it is 1.
对于偶校验,选择校验位使得数据和校验位中 1 的总数为偶数。如果原始数据已有偶数个 1,则校验位为 0;否则为 1。
For odd parity, the total number of 1s must be odd. If the data has an odd number of 1s, parity bit = 0; if even, parity bit = 1.
对于奇校验,1 的总数必须为奇数。如果原始数据已有奇数个 1,校验位 = 0;如果有偶数个 1,校验位 = 1。
In practice, the sending and receiving devices agree on the parity type. If a received byte does not match the expected parity, an error has occurred.
实际上,发送端和接收端会约定校验类型。如果接收到的字节不符合预期奇偶性,则说明发生了错误。
10. Memory Addressing | 内存寻址
The number of distinct memory locations a CPU can directly address is determined by the width of the address bus. If the address bus has n lines, it can generate 2n unique addresses.
CPU 可直接寻址的内存单元数量由地址总线的宽度决定。如果地址总线有 n 根线,它就能产生 2n 个唯一的地址。
Number of addressable locations = 2n
Usually, each addressable location stores one byte (8 bits). Therefore, the maximum memory size that can be directly accessed is 2n bytes.
通常情况下,每个可寻址单元存储一个字节(8 位)。因此,可直接访问的最大内存容量为 2n 字节。
For example, a 16-bit address bus can address 216 = 65,536 memory locations, i.e. 64 KB. A 32-bit address bus can handle up to 232 = 4,294,967,296 bytes ≈ 4 GB.
例如,16 位地址总线可寻址 216 = 65,536 个内存单元,即 64 KB。32 位地址总线可寻址多达 232 = 4,294,967,296 字节 ≈ 4 GB。
11. Compression Ratio | 压缩比
Compression reduces file size for storage or transmission. The compression ratio compares the original size to the compressed size, indicating how much the data has been shrunk. The formula is:
压缩可以减小文件大小,便于存储或传输。压缩比比较原始大小与压缩后的大小,表明数据被缩减了多少。公式为:
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导