📚 A-Level CCEA Computer Science Formula Summary Handbook | A-Level CCEA 计算机:公式汇总手册
This comprehensive revision guide brings together the essential formulas, equations, and laws that every A-Level CCEA Computer Science student needs to know. From data units and image size calculations to Boolean algebra and processor performance, the following sections present each formula clearly with practical examples. Use this handbook to consolidate your understanding and prepare effectively for your examinations.
这本全面的复习指南汇集了每位 A-Level CCEA 计算机科学学生必须掌握的基本公式、方程和定律。从数据单位、图像大小计算到布尔代数和处理器性能,以下各节将以清晰的实例呈现每个公式。请利用本手册巩固你的理解,有效备考。
1. Units of Data | 数据单位
Digital data is measured using the bit as the smallest unit. A single bit represents one binary digit (0 or 1). Eight bits form one byte. Larger units follow powers of 2 according to IEC standards, although in CCEA examinations the prefixes KB, MB, GB are used interchangeably with binary meanings. The key relationships are: 1 KB = 2¹⁰ bytes = 1024 bytes, 1 MB = 2²⁰ bytes = 1,048,576 bytes, 1 GB = 2³⁰ bytes, and 1 TB = 2⁴⁰ bytes.
数字数据以比特(位)作为最小单位进行度量。一个比特代表一个二进制数字(0 或 1)。八个比特构成一个字节(byte)。更大的单位按照 2 的幂次递增,遵循 IEC 标准,但在 CCEA 考试中前缀 KB、MB、GB 通常与二进制的含义混用。关键关系为:1 KB = 2¹⁰ 字节 = 1024 字节,1 MB = 2²⁰ 字节 = 1,048,576 字节,1 GB = 2³⁰ 字节,1 TB = 2⁴⁰ 字节。
When converting between units, multiply or divide by 1024. For instance, to express 20480 bytes in KB: 20480 ÷ 1024 = 20 KB. Similarly, to find the number of bytes in 5 MB: 5 × 1024 × 1024 = 5 × 2²⁰ = 5,242,880 bytes.
在单位转换时,乘以或除以 1024。例如,将 20480 字节转换为 KB:20480 ÷ 1024 = 20 KB。同理,计算 5 MB 包含的字节数:5 × 1024 × 1024 = 5 × 2²⁰ = 5,242,880 字节。
2. Image Size Calculation | 图像大小计算
The uncompressed file size of a bitmap image depends on its resolution (width × height in pixels) and colour depth (bits per pixel). The formula is: Image size (bytes) = (width × height × colour depth in bits) ÷ 8. If the image has a separate alpha channel or metadata, additional bytes must be added, but this base formula is the core requirement in CCEA papers.
未压缩的位图图像文件大小取决于其分辨率(以像素为单位的宽度×高度)和颜色深度(每像素位数)。公式为:图像大小(字节)= (宽度 × 高度 × 颜色深度位数) ÷ 8。如果图像还有单独的透明度通道或元数据,则需要额外增加字节数,但该基础公式是 CCEA 试卷的核心要求。
For example, an image with 800 × 600 pixels and a 24‑bit true colour depth gives: (800 × 600 × 24) ÷ 8 = (480,000 × 24) ÷ 8 = 11,520,000 ÷ 8 = 1,440,000 bytes, or approximately 1.44 MB. If the colour depth were only 8 bits (256 colours), the size would be one‑third of that, i.e. 480,000 bytes.
例如,一幅 800 × 600 像素、24 位真彩色深度的图像:(800 × 600 × 24) ÷ 8 = (480,000 × 24) ÷ 8 = 11,520,000 ÷ 8 = 1,440,000 字节,约 1.44 MB。如果颜色深度仅为 8 位(256 色),则大小为前述的三分之一,即 480,000 字节。
3. Sound Size Calculation | 声音大小计算
Uncompressed digital audio file size is determined by the sample rate (in Hz), bit depth (bits per sample), duration (seconds), and the number of channels (mono = 1, stereo = 2). The standard formula is: Sound size (bytes) = (sample rate × bit depth × seconds × channels) ÷ 8.
未压缩数字音频文件的大小由采样率(Hz)、位深度(每样本位数)、时长(秒)和声道数(单声道为 1,立体声为 2)决定。标准公式为:声音大小(字节)= (采样率 × 位深 × 秒数 × 声道数) ÷ 8。
Consider a 3‑second stereo recording sampled at 44.1 kHz with a 16‑bit depth. Calculation: (44,100 × 16 × 3 × 2) ÷ 8 = (44,100 × 96) ÷ 8 = 4,233,600 ÷ 8 = 529,200 bytes, or about 517 KB. If the same audio were mono, the size would be halved to approximately 258.5 KB.
考虑一段 3 秒立体声录音,采样率为 44.1 kHz,位深 16 位。计算:(44,100 × 16 × 3 × 2) ÷ 8 = (44,100 × 96) ÷ 8 = 4,233,600 ÷ 8 = 529,200 字节,约 517 KB。如果同一段音频是单声道,则大小减半,约为 258.5 KB。
4. Integer Range Formulas | 整数范围公式
For an n‑bit unsigned binary number, the representable range is from 0 to 2ⁿ − 1. For example, an 8‑bit unsigned integer can hold values from 0 to 255. For two’s complement signed integers of n bits, the range is asymmetric: −2ⁿ⁻¹ to 2ⁿ⁻¹ − 1. An 8‑bit signed integer ranges from −128 to +127.
对于 n 位无符号二进制数,可表示的范围是从 0 到 2ⁿ − 1。例如,8 位无符号整数可以保存 0 到 255 的值。对于 n 位补码有符号整数,范围不对称:−2ⁿ⁻¹ 到 2ⁿ⁻¹ − 1。8 位有符号整数的范围是 −128 到 +127。
These formulas are vital when predicting overflow in arithmetic operations and when choosing appropriate data types. The most significant bit in two’s complement acts as the sign bit: 0 for positive and 1 for negative.
这些公式在预测算术运算溢出以及选择合适的数据类型时至关重要。补码表示中最高有效位充当符号位:0 表示正数,1 表示负数。
5. Floating Point Value | 浮点数值
Floating point representation stores real numbers in the form (−1)ˢ × 1.m × 2⁽ᵉ⁻ᵇⁱᵃˢ⁾, where s is the sign bit, m is the fractional part of the mantissa, and e is the biased exponent. In IEEE 754 single precision (32 bits), the bias is 127. The mantissa is normalised so that a leading 1 is implied: the stored 23 bits represent the fractional part only, effectively giving 24 bits of precision.
浮点表示将实数存储为 (−1)ˢ × 1.m × 2⁽ᵉ⁻ᵇⁱᵃˢ⁾ 的形式,其中 s 为符号位,m 为尾数的小数部分,e 为带偏移量的指数。在 IEEE 754 单精度(32 位)中,偏移量为 127。尾数经过规格化,隐含一个前导 1:存储的 23 位仅表示小数部分,实际精度达到 24 位。
To calculate the decimal value: first extract the sign, 8‑bit exponent, and 23‑bit mantissa fields. The exponent value E = raw exponent − 127. The mantissa value M = 1 + (stored mantissa bits interpreted as a binary fraction). The final value = (−1)ˢ × M × 2ᴱ. Special cases such as zero, denormalised numbers, infinity, and NaN are handled when the exponent is all 0s or all 1s.
计算十进制值时:首先提取符号位、8 位指数和 23 位尾数域。指数值 E = 原始指数 − 127。尾数值 M = 1 + (存储的尾数位解释为二进制小数)。最终值 = (−1)ˢ × M × 2ᴱ。当指数位全 0 或全 1 时,将特殊处理零、非规格化数、无穷大和 NaN 等情形。
6. Network Transmission Time | 网络传输时间
The time required to send a file across a network is governed by the formula: Transmission time (seconds) = (File size in bits) ÷ (Transmission speed in bits per second). It is crucial to convert all units consistently: if the file size is given in bytes, multiply by 8 to obtain bits; if speed is in Mbps, multiply by 10⁶ (or 2²⁰ if using binary mega) depending on the context.
通过网络发送文件所需的时间由以下公式决定:传输时间(秒)= (文件大小,以比特为单位)÷ (传输速率,比特每秒)。务必统一所有单位:如果文件大小以字节给出,需乘以 8 得到比特;如果速率以 Mbps 为单位,根据上下文乘以 10⁶(或如果使用二进制兆则为 2²⁰)。
For instance, sending a 50 MB file over a 100 Mbps connection: file in bits = 50 × 2²⁰ × 8 = 419,430,400 bits. Time = 419,430,400 ÷ (100 × 10⁶) = 4.194 seconds, assuming 1 Mbps = 1,000,000 bps. In examination questions, look for clues about whether base‑10 or base‑2 units are intended.
例如,通过 100 Mbps 连接发送 50 MB 文件:文件比特数 = 50 × 2²⁰ × 8 = 419,430,400 比特。时间 = 419,430,400 ÷ (100 × 10⁶) = 4.194 秒,假定 1 Mbps = 1,000,000 bps。解答试题时,请留意关于采用十进制还是二进制单位的线索。
7. Compression Ratio | 压缩比
Compression ratio measures how much a file’s size has been reduced. Two common expressions are used: (1) Space saving = ((Original size − Compressed size) ÷ Original size) × 100%, giving a percentage reduction. (2) Compression ratio = Original size ÷ Compressed size, often written as a ratio such as 4:1. CCEA questions typically expect the percentage saving or the simple ratio.
压缩比用于衡量文件大小减少的程度。通常有两种表达方式:(1) 空间节省率 = ((原始大小 − 压缩后大小) ÷ 原始大小) × 100%,表示减少的百分比。(2) 压缩比 = 原始大小 ÷ 压缩后大小,通常写为如 4:1 的比率。CCEA 试题通常要求计算节省百分比或简单比率。
If an original image file is 2.4 MB and after compression becomes 800 KB, the space saving = ((2.4 × 1024 − 800) ÷ (2.4 × 1024)) × 100% ≈ ((2457.6 − 800) ÷ 2457.6) × 100% ≈ 67.5%. The compression ratio is 2.4 MB ÷ 800 KB ≈ 3:1.
如果一个原始图像文件为 2.4 MB,压缩后变为 800 KB,则空间节省率 = ((2.4 × 1024 − 800) ÷ (2.4 × 1024)) × 100% ≈ ((2457.6 − 800) ÷ 2457.6) × 100% ≈ 67.5%。压缩比为 2.4 MB ÷ 800 KB ≈ 3:1。
8. Boolean Algebra Laws | 布尔代数定律
Boolean algebra provides a set of laws for simplifying logic expressions using the operators AND (·), OR (+), and NOT (¬). The fundamental laws include: Commutativity: A + B = B + A, A · B = B · A. Associativity: A + (B + C) = (A + B) + C, A · (B · C) = (A · B) · C. Distributivity: A · (B + C) = A · B + A · C, A + (B · C) = (A + B) · (A + C). Identity: A + 0 = A, A · 1 = A. Complement: A + ¬A = 1, A · ¬A = 0. Idempotence: A + A = A, A · A = A. Annihilation: A + 1 = 1, A · 0 = 0. Involution: ¬(¬A) = A. Absorption: A + A · B = A, A · (A + B) = A. De Morgan’s theorems: ¬(A · B) = ¬A + ¬B, ¬(A + B) = ¬A · ¬B.
布尔代数提供了一套使用运算符 AND(·)、OR(+)和 NOT(¬)简化逻辑表达式的定律。基本定律包括:交换律:A + B = B + A,A · B = B · A。结合律:A + (B +
Published by TutorHao | A-Level Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导