📚 IGCSE OCR Computer Science: Calculation Practice | IGCSE OCR 计算机科学:计算题专项训练
Calculation questions form a significant part of the IGCSE OCR Computer Science exam, testing your ability to convert between number bases, manipulate binary values, calculate file sizes, and apply logical operations. Mastering these quantitative skills not only secures easy marks but also deepens your understanding of how computers store and process data. This revision guide focuses on the most common calculation-based topics, providing step‑by‑step methods and worked examples to help you approach every numerical problem with confidence.
计算题是 IGCSE OCR 计算机科学考试中的重要组成部分,考查你在不同数制之间转换、处理二进制数值、计算文件大小以及应用逻辑运算的能力。掌握这些量化技能不仅能为你稳稳拿到分数,还能加深你对计算机如何存储和处理数据的理解。本复习指南聚焦最常考的计算类专题,提供分步方法与解题示例,帮助你自信应对每一道数值题。
1. Binary to Denary Conversion | 二进制转十进制
To convert an unsigned binary integer to denary, write the binary digits in a column and place place values (powers of 2) above them, starting from 1 on the right. Multiply each bit by its place value and sum all the products.
将无符号二进制整数转换为十进制时,先将二进制数字置于一列,上方标出位权(2 的幂),从最右边的 1 开始。将每一位乘以对应的位权,再把所有乘积相加。
Example: Convert 101101₂ to denary.
示例:将 101101₂ 转换为十进制。
Place values: 32, 16, 8, 4, 2, 1
Bits: 1, 0, 1, 1, 0, 1
Sum = (1×32) + (0×16) + (1×8) + (1×4) + (0×2) + (1×1) = 32 + 8 + 4 + 1 = 45
位权:32, 16, 8, 4, 2, 1
比特:1, 0, 1, 1, 0, 1
总和 = (1×32) + (0×16) + (1×8) + (1×4) + (0×2) + (1×1) = 32 + 8 + 4 + 1 = 45
2. Denary to Binary Conversion | 十进制转二进制
Divide the denary number repeatedly by 2, recording the remainder each time. Read the remainders from bottom to top to obtain the binary equivalent.
将十进制数反复除以 2,每次都记录余数。从下往上读取余数,即可得到对应的二进制数。
Example: Convert 29 to binary.
示例:将 29 转换为二进制。
29 ÷ 2 = 14 remainder 1
14 ÷ 2 = 7 remainder 0
7 ÷ 2 = 3 remainder 1
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
Reading upwards: 11101₂
29 ÷ 2 = 14 余 1
14 ÷ 2 = 7 余 0
7 ÷ 2 = 3 余 1
3 ÷ 2 = 1 余 1
1 ÷ 2 = 0 余 1
从下往上读:11101₂
3. Binary Addition | 二进制加法
left, carrying 1 when the sum in a column reaches 2 (1+1 = 0 carry 1; 1+1+1 = 1 carry 1).
像十进制加法一样将两个二进制数对齐。从右向左逐列相加,当某一列的和达到 2 时则进位(1+1 = 0 进 1;1+1+1 = 1 进 1)。
Example: Add 1011₂ and 1101₂.
示例:将 1011₂ 与 1101₂ 相加。
1 0 1 1
+ 1 1 0 1
─────────
1 1 0 0 0₂ (resulting in an overflow bit)
1 0 1 1
+ 1 1 0 1
─────────
1 1 0 0 0₂(产生一个溢出位)
4. Hexadecimal Conversion | 十六进制转换
Hexadecimal (base 16) uses digits 0‑9 and letters A‑F. To convert binary to hex, split the binary number into groups of 4 bits (starting from the right) and replace each group with its hex equivalent. Denary to hex follows a similar repeated division by 16 method.
十六进制(基数为 16)使用数字 0‑9 和字母 A‑F。将二进制转换为十六进制时,把二进制数从右开始每 4 位分成一组,再将每组替换为对应的十六进制符号。十进制转十六进制则可反复除以 16 取余数。
Example: Convert 11011010₂ to hex.
示例:将 11011010₂ 转换为十六进制。
Split: 1101 1010 → D (13) and A (10) → DA₁₆.
分组:1101 1010 → D(13)与 A(10)→ DA₁₆。
5. Binary Shifts | 二进制移位
A logical left shift of n places multiplies the binary number by 2ⁿ; new bits on the right are filled with 0. A logical right shift of n places divides by 2ⁿ (integer division), filling the left with 0s. Arithmetic right shifts preserve the sign bit for signed numbers.
逻辑左移 n 位相当于将二进制数乘以 2ⁿ,右侧新增位用 0 填充。逻辑右移 n 位相当于除以 2ⁿ(整数除法),左侧用 0 填充。算术右移在带符号数中会保留符号位。
Example: Left shift 001011₂ (11) by 2 places → 101100₂ (44).
示例:将 001011₂(11)左移 2 位 → 101100₂(44)。
6. Calculating Sound File Size | 声音文件大小计算
n (seconds) × number of channels. For bytes, divide by 8; for kilobytes, divide by 8×1024.
声音文件大小(以比特计)= 采样率 × 位深度 × 时长(秒)× 声道数。若以字节为单位,需除以 8;以千字节计则再除以 1024。
Example: A stereo recording at 44.1 kHz, 16‑bit, 3 minutes.
示例:立体声录音,44.1 kHz,16 位,3 分钟。
Sample rate = 44100 Hz; bit depth = 16; channels = 2; time = 180 s.
Size = 44100 × 16 × 180 × 2 = 254,016,000 bits ≈ 30.3 MB.
采样率 = 44100 Hz;位深度 = 16;声道数 = 2;时长 = 180 秒。
大小 = 44100 × 16 × 180 × 2 = 254,016,000 比特 ≈ 30.3 MB。
7. Calculating Image File Size | 图像文件大小计算
Bitmap image size (bits) = width in pixels × height in pixels × colour depth. For a 24‑ age, colour depth is 24 bits per pixel. Add metadata overhead if required by the question.
位图图像大小(比特)= 以像素为单位的宽度 × 高度 × 颜色深度。对于 24 位图像,颜色深度为每像素 24 比特。若题目要求,还需加上元数据开销。
Example: A 800×600 image with a 24‑bit colour depth.
示例:一幅 800×600 像素、24 位颜色深度的图像。
Size = 800 × 600 × 24 = 11,520,000 bits = 1,440,000 bytes ≈ 1.37 MB.
大小 = 800 × 600 × 24 = 11,520,000 比特 = 1,440,000 字节 ≈ 1.37 MB。
8. Text File Size Calculation | 文本文件大小计算
The size of a text file depends on the character set used. ASCII uses 7 or 8 bits per character; extended ASCII uses 8 bits (1 byte). Unicode (UTF‑8) can use 1 to 4 bytes per character, but for exam calculations assume a fixed byte per character unless specified.
文本文件的大小取决于所使用的字符集。ASCII 每个字符使用 7 或 8 比特;扩展 ASCII 使用 8 比特(1 字节)。Unicode(UTF‑8)每个字符可使用 1 到 4 字节,但考试计算时除非有说明,否则假定每个字符占用固定字节数。
Example: A file contains 3000 characters encoded in extended ASCII.
示例:一个文件包含 3000 个使用扩展 ASCII 编码的字符。
Size = 3000 × 1 byte = 3000 bytes ≈ 2.93 KB.
大小 = 3000 × 1 字节 = 3000 字节 ≈ 2.93 KB。
9. Data Storage Units Conversion | 存储单位换算
byte (GB = 1024 MB), terabyte (TB = 1024 GB). Always use 1024 as the multiplier, not 1000.
熟记单位层级:比特、半字节(4 比特)、字节(8 比特)、千字节(KB = 1024 字节)、兆字节(MB = 1024 KB)、吉字节(GB = 1024 MB)、太字节(TB = 1024 GB)。务必使用 1024 作为乘数,而非 1000。
| Unit | Equivalent |
|---|---|
| 1 KB | 1024 bytes |
| 1 MB | 1024 KB = 1,048,576 bytes |
| 1 GB | 1024 MB ≈ 1,073,741,824 bytes |
单位换算表(中文对应):1 KB = 1024 字节,1 MB = 1024 KB = 1,048,576 字节,1 GB = 1024 MB ≈ 1,073,741,824 字节。
10. Memory Addressing Calculations | 内存地址计算
If a computer has an n‑bit address bus, it can address 2ⁿ unique memory locations. To find the number of addressable locations, raise 2 to the power of the address bus width. For example, a 32‑bit address bus can address 2³² locations (4 GB if each location is a byte).
如果计算机有一条 n 位地址总线,那么它就能寻址 2ⁿ 个唯一的内存位置。计算可寻址位置数的方法是 2 的地址总线宽度次幂。例如,32 位地址总线可寻址 2³² 个位置(若每个位置是一个字节,则为 4 GB)。
Example: An address bus is 20 bits wide. How many memory locations can be addressed if each location holds one byte? Give your answer in MB.
示例:地址总线宽度为 20 位。若每个位置存放一个字节,可寻址多少个内存位置?结果以 MB 表示。
2²⁰ = 1,048,576 locations. Since each is a byte, that is 1,048,576 bytes = 1024 KB = 1 MB.
2²⁰ = 1,048,576 个位置。每个位置一字节,即为 1,048,576 字节 = 1024 KB = 1 MB。
11. Logic Gate Simplification & Truth Tables | 逻辑门化简与真值表
Calculation questions may ask you to complete a truth table for a given logic circuit or to write a Boolean expression. Use systematic evaluation: list all possible input combinations, work through intermediate signals, and then the final output.
计算题可能会要求你为给定逻辑电路填写真值表或写出布尔表达式。采用系统化方法:列出所有可能的输入组合,依次计算各中间信号,最后得出最终输出。
Example: For a circuit with A AND B fed into a NOT gate (NAND), the truth table is:
示例:对于一个将 A AND B 的结果输入 NOT 门的电路(即与非门),真值表为:
| A | B | Output Q |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Boolean expression: Q = NOT (A AND B) or Q = A NAND B.
布尔表达式:Q = NOT (A AND B) 或 Q = A NAND B。
12. Checksum and Parity Bit Calculations | 校验和与奇偶校验位计算
Parity bit: count the number of 1s in a byte. For even parity, the parity bit is set to 0 if the count is already even, or 1 to make it even. Checksum: add up all the data bytes, discard carries beyond 8 bits, and take the two's complement to form the checksum byte.
奇偶校验位:统计一个字节中 1 的个数。对于偶校验,若已有偶数个 1 则校验位为 0,否则为 1 以凑成偶数。校验和:将所有数据字节相加,丢弃超过 8 位的进位,再取二进制补码作为校验和字节。
Example: 1 (making six 1s). Simple checksum: sum bytes 65 + 66 + 67 = 198. In 8 bits: 11000110. Two's complement: 00111010, sent as checksum.
示例:数据字节 10110101 有 5 个 1。为达到偶校验,校验位应为 1(使 1 的总数为 6)。简单校验和:字节相加 65 + 66 + 67 = 198。8 位表示为 11000110。其二进制补码为 00111010,作为校验和发送。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

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