📚 Year 12 CCEA Computer Science: Formula & Theorem Quick Reference Handbook | Year 12 CCEA 计算机:公式定理速查手册
This handbook compiles the key formulas, theorems and computational rules you need for the CCEA AS Computer Science course. Mastering these will boost your confidence in data representation, boolean logic, error detection, encryption and file size estimation.
本手册汇总了 CCEA AS 计算机科学课程所需的关键公式、定理和计算规则。掌握这些内容将增强你在数据表示、布尔逻辑、错误检测、加密以及文件大小估算等方面的信心。
1. Number System Conversion Formulas | 数字系统转换公式
where b₀ is the least significant bit), the decimal value is Σ (bᵢ × 2ⁱ) for i = 0 to n−1.
二进制转十进制:对于 n 位无符号二进制数,位为 bₙ₋₁ ... b₀(b₀ 是最低位),十进制值为 Σ (bᵢ × 2ⁱ),i 从 0 到 n−1。
Decimal to Binary: Repeatedly divide the decimal number by 2; read the remainders from bottom to top to obtain the binary equivalent.
十进制转二进制:反复将十进制数除以 2;从下往上读取余数,得到二进制。
Decimal to Hexadecimal: Repeatedly divide by 16; remainders above 9 are represented as A (10) to F (15).
十进制转十六进制:反复除以 16;余数大于 9 用 A (10) 到 F (15) 表示。
Hexadecimal to Binary: Replace each hex digit with its 4-bit binary nibble according to the table below.
十六进制转二进制:根据下表将每个十六进制数字替换为 4 位二进制半字节。
| Hex | Binary | Decimal |
|---|---|---|
| 0 | 0000 | 0 |
| 1 | 0001 | 1 |
| 2 | 0010 | 2 |
| 3 | 0011 | 3 |
| 4 | 0100 | 4 |
| 5 | 0101 | 5 |
| 6 | 0110 | 6 |
| 7 | 0111 | 7 |
| 8 | 1000 | 8 |
| 9 | 1001 | 9 |
| A | 1010 | 10 |
| B | 1011 | 11 |
| C | 1100 | 12 |
| D | 1101 | 13 |
| E | 1110 | 14 |
| F | 1111 | 15 |
Binary to Hexadecimal: Group the binary digits into nibbles (sets of four) from the right, then convert each nibble to its hex digit.
二进制转十六进制:从右开始将二进制数字分组为半字节(四位一组),然后将每个半字节转换为其十六进制数字。
2. Two's Complement Range & Overflow Detection | 二进制补码范围与溢出检测
For an n-bit two's complement representation, the range of representable integers is from −2ⁿ⁻¹ to 2ⁿ⁻¹ − 1.
对于 n 位二进制补码表示,可表示的整数范围是 −2ⁿ⁻¹ 到 2ⁿ⁻¹ − 1。
Example: With 8 bits, the range is −128 to +127; with 16 bits, −32 768 to +32 767.
示例:8 位时,范围为 −128 到 +127;16 位时,范围为 −32 768 到 +32 767。
Overflow occurs in two' flow = Cₙ XOR Cₙ₋₁, where Cₙ is the carry out of the most significant bit (sign bit) and Cₙ₋₁ is the carry into the sign bit. In an 8-bit system this is C₇ XOR C₆.
在两个补码相加时,当进入符号位的进位与出符号位的进位不同,则发生溢出。可以通过布尔表达式检测:溢出 = Cₙ XOR Cₙ₋₁,其中 Cₙ 是最高有效位(符号位)的进位输出,Cₙ₋₁ 是进入符号位的进位。在 8 位系统中为 C₇ XOR C₆。
Alternatively, overflow is present if the sum of two positive numbers yields a negative result, or the sum of two negative numbers yields a positive result.
另一种判断方法:若两个正数之和得到负数,或两个负数之和得到正数,则发生了溢出。
3. Floating Point Representation | 浮点表示
A binary floating point number is stored in the form: (−1)ˢ × 1.M × 2E − Bias. S is the sign bit (0 for positive, 1 for negative), M is the mantissa (fractional part), E is the stored exponent, and Bias is a fixed offset that allows both positive and negative exponents.
二进制浮点数按如下形式存储:(−1)ˢ × 1.M × 2E − Bias。S 是符号位(0 为正,1 为负),M 是尾数(小数部分),E 是存储的指数,Bias 是固定偏移量,使指数可以表示正负。
very small values) have a hidden 0 before the point and a special exponent (often E = 0).
对于规格化数,隐含前导 1,因此只存储小数部分 M。非规格化数(用于非常小的值)小数点前为隐含的 0,并且通常指数 E = 0。
ould use 1 sign bit, 3 exponent bits (Bias = 3) and 4 mantissa bits. Example: Value = (−1)ˢ × 1.M × 2E−3. IEEE 754 single precision uses 1 sign, 8 exponent (Bias = 127), and 23 mantissa bits.
常见格式:8 位浮点数可能使用 1 位符号、3 位指数(Bias = 3)和 4 位尾数。示例:数值 = (−1)ˢ × 1.M × 2E−3。IEEE 754 单精度使用 1 位符号、8 位指数(Bias = 127)和 23 位尾数。
the maximum (when E is all ones except the reserved all-ones pattern, and M is all ones).
某一格式的正规格化数范围可由最小正规格化值(当 E = 1 且 M = 0 时)和最大值(当 E 为除保留全 1 外的最大指数,且 M 全为 1 时)近似确定。
4. Image File Size Calculation | 图像文件大小计算
iven by: Image size = (width in pixels) × (height in pixels) × (colour depth in bits) / 8.
未压缩位图图像的大小(字节)计算公式为:图像大小 = (像素宽度)×(像素高度)×(色彩深度,位)/ 8。
Colour depth is the number of bits used per pixel. Typical values are 1 (monochrome), 8 (256 colours), 24 (true colour, 8 bits per RGB channel) and 32 (true colour with alpha channel).
色彩深度是每像素使用的位数。常见值有 1(单色)、8(256 色)、24(真彩色,每 RGB 通道 8 位)和 32(带 alpha 通道的真彩色)。
To express the result in kilobytes (KB), divide by 1024; for megabytes (MB), divide by 1024²; for gigabytes (GB), divide by 1024³.
若以千字节(KB)表示,再除以 1024;兆字节(MB)则除以 1024²;吉字节(GB)除以 1024³。
still width × height × bits per pixel (from the colour depth needed to index the palette).
如果图像使用调色板(索引颜色),调色板本身的大小也需考虑,但像素数据存储仍为宽度 × 高度 × 每像素位数(即用于索引调色板的色彩深度)。
5. Sound File Size Calculation | 声音文件大小计算
e in Hz) × (sample resolution in bits) × (number of channels) × (duration in seconds) / 8.
未压缩音频文件的大小(字节)计算公式为:声音大小 = (采样率,Hz)×(采样分辨率,位)×(声道数)×(时长,秒)/ 8。
Sample rate is the number of samples per second; typical values are 44.1 kHz, 48 kHz. Sample resolution (bit depth) is commonly 16 bits or 24 bits. Stereo audio has 2 channels.
采样率是每秒样本数;常见值有 44.1 kHz、48 kHz。采样分辨率(位深度)通常为 16 位或 24 位。立体声为 2 声道。
For example, a 1-minute stereo recording at 44.1 kHz, 16-bit resolution gives: 44 100 × 16 × 2 × 60 / 8 ≈ 10.6 MB.
例如,一段 1 分钟立体声,44.1 kHz、16 位分辨率的录音大小为:44 100 × 16 × 2 × 60 / 8 ≈ 10.6 MB。
ample rate × sample resolution × channels. Then file size = bit rate × duration (seconds).
也可使用比特率:比特率(bps)= 采样率 × 采样分辨率 × 声道数。然后文件大小 = 比特率 × 时长(秒)。
6. Video File Size Calculation | 视频文件大小计算
ts / 8) × frames per second × duration in seconds. Then add the audio size calculated as above.
对于未压缩视频,总大小为视频流与音频流之和。视频大小 = (帧宽 × 帧高 × 色彩深度,位 / 8)× 帧率 × 时长(秒)。然后加上按前文计算的音频大小。
Frame rate is measured in fps (frames per second); typical values are 24, 30, or 60 fps.
帧率以 fps(帧每秒)衡量;常见值有 24、30 或 60 fps。
al size per second or per minute; remember to convert units consistently. A 1920×1080 full‑ .22 MB per frame. At 30 fps, one second of video (without audio) needs 6.22 × 30 ≈ 187 MB.
考题常要求计算每秒或每分钟的总大小;注意单位换算一致。1920×1080 全高清帧,24 位色彩,每帧为 1920 × 1080 × 3 字节 ≈ 6.22 MB。30 fps 时,一秒钟视频(不含音频)约需 6.22 × 30 ≈ 187 MB。
7. Data Compression Ratio | 数据压缩比率
Compressed size. A ratio of 4:1 means the compressed file is one quarter of the original.
压缩比将原始(未压缩)数据大小与压缩后数据大小进行比较:压缩比 = 原始大小 / 压缩后大小。例如 4:1 的压缩比表示压缩文件是原始文件的四分之一。
Space saving (percentage) can be calculated as: Saving% = (1 − Compressed size / Original size) × 100%.
节省空间百分比可
Published by TutorHao | Year 12 Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

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