📚 Year 11 CCEA Computer Science: Formula & Theorem Quick Reference Handbook | 英国CCEA计算机11年级:公式定理速查手册
This quick reference handbook compiles the essential formulas, conversion rules and logical theorems needed for the Year 11 CCEA Computer Science course. Use it to reinforce your understanding of data representation, Boolean algebra, file size calculations and more. Each section presents the key concepts with paired English and Chinese explanations to support bilingual learning.
本速查手册汇编了CCEA 11年级计算机科学课程所需的公式、转换规则与逻辑定理。你可以用它巩固数据表示、布尔代数、文件大小计算等知识点。每个小节通过配对的英文和中文解释支持双语学习。
1. Data Units and Conversions | 数据单位与转换
Data is measured in bits (b) and bytes (B), where 1 byte = 8 bits. Larger units are based on powers of 2: Kibibytes, Mebibytes and Gibibytes, often simplified as KB, MB, GB using the 1024 convention.
数据以位(b)和字节(B)度量,1字节 = 8位。更大的单位基于2的幂:千字节(KB)、兆字节(MB)、吉字节(GB),通常按1024进位。
1 B = 8 b
1 KB = 1024 B 1 MB = 1024 KB 1 GB = 1024 MB
To convert between units, multiply when moving to a smaller unit and divide when moving to a larger unit. For example, to express 5 MB in bits: 5 × 1024 × 1024 × 8 bits.
单位转换时,向较小单位换算用乘法,向较大单位换算用除法。例如,5 MB转换为位:5 × 1024 × 1024 × 8 位。
When calculating file sizes or transmission times, always ensure consistent units. Memory storage is often given in bytes, while data transfer rates are typically in bits per second.
计算文件大小或传输时间时,必须保持单位统一。存储器容量通常以字节给出,而数据传输速率通常以位/秒给出。
2. Binary and Hexadecimal | 二进制与十六进制
Binary (base‑2) uses digits 0 and 1. Each place value represents a power of 2. To convert binary to decimal, sum the place values where a 1 appears.
二进制(基数为2)使用数字0和1。每个位值代表2的幂。转换为十进制时,将出现1的各位值相加。
Decimal = Σ (bit × 2position)
十进制 = Σ (位 × 2的位权)
Hexadecimal (base‑16) uses digits 0‑9 and letters A‑F. Each hex digit corresponds to exactly four binary bits, making conversions straightforward.
十六进制(基数为16)使用數字0‑9和字母A‑F。每个十六进制数字恰好对应4位二进制数,转换非常直接。
Hex to Binary: A=1010, F=1111, 3=0011, etc.
十六进制转二进制:A=1010,F=1111,3=0011 等
Binary addition follows the same column addition rules as decimal, but carries occur when the sum reaches 2 (1+1=10). Overflow happens when a carry enters a column that does not exist, which is flagged in processor status registers.
二进制加法规则与十进制列加法相同,但达到2时产生进位(1+1=10)。当进位进入不存在的列时发生溢出,处理器状态寄存器会加以标记。
3. Bitwise Operations and Shifts | 位操作与移位
Logical bitwise operators act on each corresponding pair of bits. AND ( ∧ ) gives 1 if both bits are 1; OR ( ∨ ) gives 1 if at least one bit is 1; XOR (⊕) gives 1 if the bits are different; NOT (¬) flips each bit.
逻辑位运算作用于每一对对应的位。与 ( ∧ ):两位均为1则结果为1;或 ( ∨ ):至少一位为1则结果为1;异或 (⊕):位不同则结果为1;非 (¬):翻转每一位。
Bit shifts move every bit left or right and fill the vacated positions with zeros. A left shift by n places multiplies the binary number by 2ⁿ; a right shift divides by 2ⁿ (ignoring remainders).
位移将所有位向左或向右移动,空位补零。左移n位相当于二进制数乘以2ⁿ;右移n位相当于除以2ⁿ(忽略余数)。
Left shift: x << n = x × 2ⁿ
左移:x << n = x × 2ⁿ
Right shift: x >> n = floor(x ÷ 2ⁿ)
右移:x >> n = 向下取整(x ÷ 2ⁿ)
These operations are fast and commonly used in low‑level programming for efficient multiplication and division by powers of two.
这些运算速度很快,在底层编程中常用于高效实现乘除2的幂次运算。
4. Image File Size Calculation | 图像文件大小计算
An image’s file size depends on its resolution (width × height) and colour depth (bits per pixel). The raw bitmap size in bits is given by the product of these three factors.
图像文件大小取决于分辨率(宽 × 高)和颜色深度(每像素位数)。原始位图大小(位)由这三者的乘积给出。
File Size (bits) = Width (pixels) × Height (pixels) × Colour Depth (bits per pixel)
文件大小(位)= 宽度(像素) × 高度(像素) × 颜色深度(每像素位数)
For example, an image of 1920×1080 pixels with a 24‑bit colour depth requires 1920 × 1080 × 24 = 49,766,400 bits, or approximately 5.93 MB when converted.
例如,一幅1920×1080像素、24位颜色深度的图像需要1920 × 1080 × 24 = 49,766,400 位,转换为约5.93 MB。
Common colour depths: 1 bit for monochrome, 8 bits (256 colours), 24 bits (true colour). Metadata and headers add extra bytes, so the actual file size on disk may be slightly larger than the raw image data.
常见颜色深度:1位用于单色,8位(256色),24位(真彩色)。元数据和文件头会增加额外字节,因此磁盘上的实际文件大小可能略大于原始图像数据。
5. Sound File Size Calculation | 声音文件大小计算
Digital sound fidelity is determined by the sample rate, bit depth and number of channels. The uncompressed audio file size is the product of these parameters multiplied by the duration.
数字声音的保真度由采样率、位深度和声道数决定。未压缩的音频文件大小是这些参数与持续时间的乘积。
File Size (bits) = Sample Rate (Hz) × Bit Depth (bits) × Duration (seconds) × Number of Channels
文件大小(位)= 采样率(Hz) × 位深度(位) × 时长(秒) × 声道数
For a stereo CD recording: 44,100 Hz × 16 bits × 2 channels = 1,411,200 bits per second (about 172 KB/s). A three‑minute track would need roughly 30 MB.
以立体声CD录音为例:44,100 Hz × 16位 × 2声道 = 每秒1,411,200位(约172 KB/s)。一首三分钟的曲目约需30 MB。
Increasing sample rate or bit depth improves quality but directly increases storage requirements. Compressed formats like MP3 use psychoacoustic models to reduce file size while preserving perceived quality.
提高采样率或位深度能改善音质,但直接增加存储需求。像MP3这类压缩格式利用心理声学模型在保持感知质量的同时减小文件大小。
6. Boolean Logic Laws | 布尔逻辑定律
Boolean algebra simplifies logic circuits and conditions. The fundamental laws hold for the operations AND, OR and NOT. They are presented here using ∧ for AND, ∨ for OR and ¬ for NOT.
布尔代数用于化简逻辑电路和条件表达式。基本定律对AND, OR, NOT运算成立,此处使用 ∧ 表示与,∨ 表示或,¬ 表示非。
Identity: A ∨ 0 = A A ∧ 1 = A
恒等律:A ∨ 0 = A A ∧ 1 = A
Annulment: A ∨ 1 = 1 A ∧ 0 = 0
零一律:A ∨ 1 = 1 A ∧ 0 = 0
Idempotent: A ∨ A = A A ∧ A = A
幂等律:A ∨ A = A A ∧ A = A
Complement: A ∨ ¬A = 1 A ∧ ¬A = 0
互补律:A ∨ ¬A = 1 A ∧ ¬A = 0
Double Negation: ¬(¬A) = A
双重否定律:¬(¬A) = A
Commutative: A ∨ B = B ∨ A A ∧ B = B ∧ A
交换律:A ∨ B = B ∨ A A ∧ B = B ∧ A
Associative: (A ∨ B) ∨ C = A ∨ (B ∨ C) ; (A ∧ B) ∧ C = A ∧ (B ∧ C)
结合律:(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)
分配律:A ∧ (B ∨ C) = (A ∧ B) ∨ (A ∧ C) ; A ∨ (B ∧ C) = (A ∨ B) ∧ (A ∨ C)
Absorption: A ∨ (A ∧ B) = A ; A ∧ (A ∨ B) = A
吸收律:A ∨ (A ∧ B) = A ; A ∧ (A ∨ B) = A
These laws are the building blocks for minimising logic expressions such as A ∨ (¬A ∧ B) = A ∨ B. They are essential for designing efficient circuits.
这些定律是化简逻辑表达式(如A ∨ (¬A ∧ B) = A ∨ B)的基础,对设计高效电路至关重要。
7. De Morgan’s Theorems | 德摩根定律
De Morgan’s laws describe how to break a negation over a conjunction or disjunction. They are critical for converting circuits between NAND/NOR gates and for simplifying conditions.
德摩根定律描述了如何将否定分配到合取和析取运算中,对使用NAND/NOR门转换电路及简化条件至关重要。
¬(A ∧ B) = ¬A ∨ ¬B
¬(A 与 B) = 非A 或 非B
¬(A ∨ B) = ¬A ∧ ¬B
¬(A 或 B) = 非A 与 非B
These theorems can be verified by truth tables. The following table demonstrates the equivalence for the first law.
这些定律可通过真值表验证。下表展示第一个定律的等价性。
| A | B | ¬(A ∧ B) | ¬A ∨ ¬B |
|---|---|---|---|
| 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 |
In programming, these laws help remove negative logic and improve readability, e.g. changing if not (x > 5 and y < 3) into if x ≤ 5 or y ≥ 3.
在编程中,这些定律有助于消除否定逻辑并提高可读性,例如将if not (x > 5 and y < 3) 改写为 if x ≤ 5 或 y ≥ 3。
8. Network Transmission Calculations | 网络传输计算
The time taken to transfer a file across a network depends on the file size and the transmission rate. The basic formula uses consistent units for data and time.
通过网络传输文件所需时间取决于文件大小和传输速率,公式要求数据与时间单位一致。
Transmission Time (seconds) = Data Size (bits) ÷ Transmission Rate (bits per second, bps)
传输时间(秒)= 数据大小(位) ÷ 传输速率(位/秒,bps)
For example, sending a 10 MB file over a 100 Mbps connection: first convert 10 MB to bits (10 × 1024 × 1024 × 8 = 83,886,080 bits). Time = 83,886,080 ÷ 100,000,000 ≈ 0.84 seconds (ignoring overheads).
例如,通过100 Mbps连接发送10 MB文件:先将10 MB转换为位(10 × 1024 × 1024 × 8 = 83,886,080位)。时间 = 83,886,080 ÷ 100,000,000 ≈ 0.84秒(忽略开销)。
Network speed is often given in decimal prefixes (1 Mbps = 1,000,000 bps), while file sizes use binary prefixes. Always check which convention is being used in exam questions.
网络速度通常使用十进制前缀(1 Mbps = 1,000,000 bps),而文件大小使用二进制前缀。答题时务必确认题目采用的约定。
9. Compression Ratio | 压缩比
Compression reduces file size. The compression ratio compares the original size to the compressed size, often written as a ratio or percentage.
压缩减小文件大小。压缩比将原始大小与压缩后大小对比,通常以比率或百分比表示。
Compression Ratio = Uncompressed Size : Compressed Size
压缩比 = 未压缩大小 : 压缩后大小
A ratio of 4:1 means the compressed file is one‑quarter of the original. The space saving can be expressed as (1 − 1/ratio) × 100%. For 4:1, space saving = 75%.
4:1的比率表示压缩后文件是原始的四分之一。空间节省率可表示为 (1 − 1/比率) × 100%。对于4:1,空间节省率为75%。
The efficiency of lossless compression (e.g. run‑length encoding, Huffman coding) can be measured by the ratio. Lossy compression achieves higher ratios by discarding non‑essential data.
无损压缩(如游程编码、霍夫曼编码)的效率可用压缩比衡量。有损压缩通过丢弃非关键数据实现更高的压缩比。
10. Caesar Cipher and Parity Check | 凯撒密码与奇偶校验
The Caesar cipher is a substitution cipher that shifts each letter by a fixed key. With alphabet positions numbered 0‑25, the encryption and decryption formulas use modular arithmetic.
凯撒密码是一种替换密码,按固定密钥对每个字母进行移位。将字母位置编号为0‑25时,加密和解密公式使用模运算。
Encrypt: c = (p + k) mod 26
加密:c = (p + k) mod 26
Decrypt: p = (c − k + 26) mod 26
解密:p = (c − k + 26) mod 26
Parity checking is a simple error detection method. For even parity, an extra bit is added so that the total number of 1s is even. The parity bit P can be computed using XOR of all data bits.
奇偶校验是一种简单的错误检测方法。对于偶校验,增加一个附加位使1的总数为偶数。校验位P可用所有数据位的异或运算计算。
Even parity bit: P = d₁ ⊕ d₂ ⊕ … ⊕ dₙ
偶校验位:P = d₁ ⊕ d₂ ⊕ … ⊕ dₙ
If the received data fails the parity check, the system knows an error has occurred, though it cannot locate the error. Parity is often used in memory and serial communications.
如果接收数据未通过奇偶校验,系统知道发生了错误,但无法定位错误。奇偶校验常用于内存和串行通信中。
Published by TutorHao | CCEA GCSE Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply