📚 IGCSE WJEC Computer Science: Calculation Questions Drill | IGCSE WJEC 计算机:计算题专项训练
Mastering calculation questions is essential for achieving a top grade in IGCSE WJEC Computer Science. From number base conversions and binary arithmetic to file size estimation and logic gate outputs, these numerical problems test both your theoretical understanding and your ability to apply concepts under time pressure. In this intensive revision guide, we break down every major calculation topic with clear formulas, worked examples, and paired English‑Chinese explanations to help you build confidence and accuracy.
掌握计算题是在 IGCSE WJEC 计算机科学中取得高分的关键。从数制转换、二进制算术到文件大小估算和逻辑门输出,这些数值类题目既考验你的理论基础,也检验你在限时环境下灵活应用概念的能力。在这份专项训练指南中,我们将逐一拆解每个重要的计算专题,配以清晰的公式、例题和英中双语讲解,帮助你建立信心并提高答题准确率。
1. Number Base Conversions | 数制转换
You must be able to convert between binary (base‑2), denary (base‑10), and hexadecimal (base‑16) fluently. Binary digits are often grouped in nibbles (4 bits) or bytes (8 bits) for easy conversion. The positions of binary digits represent powers of two: from right to left, 2⁰, 2¹, 2², and so on. To convert binary to denary, add the place values where a 1 appears. To convert denary to binary, repeatedly divide by 2 and read the remainders upward.
你必须能够在二进制(基数为2)、十进制(基数为10)和十六进制(基数为16)之间熟练转换。二进制位通常按半字节(4位)或字节(8位)分组,以便快速转换。二进制每个位代表2的幂:从右向左依次是2⁰、2¹、2² 等。二进制转十进制时,将出现1的位的权重相加;十进制转二进制时,不断除以2并读取余数。
Example: Convert 10110110₂ to denary
Place values: 128, 64, 32, 16, 8, 4, 2, 1. Digits: 1×128 + 0×64 + 1×32 + 1×16 + 0×8 + 1×4 + 1×2 + 0×1 = 182₁₀.
示例:将 10110110₂ 转换为十进制
位权:128, 64, 32, 16, 8, 4, 2, 1。各位:1×128 + 0×64 + 1×32 + 1×16 + 0×8 + 1×4 + 1×2 + 0×1 = 182₁₀。
Hexadecimal uses digits 0‑9 and letters A‑F for values 10‑15. To convert binary to hex, split the binary number into groups of 4 bits from the right, then translate each nibble. Converting denary to hex often goes via binary as an intermediate step.
十六进制使用数字 0‑9 和字母 A‑F 表示 10‑15。二进制转十六进制时,从右开始每4位分组,然后翻译每个半字节。十进制转十六进制通常先将十进制转为二进制作为中间步骤。
- 0010 1101₂ = 2D₁₆ (since 0010→2, 1101→D)
- Denary 173 → binary 10101101 → hex AD
2. Binary Addition and Overflow | 二进制加法与溢出
Binary addition follows simple rules: 0+0=0, 0+1=1, 1+0=1, 1+1=0 carry 1, and 1+1+1=1 carry 1. When adding two 8‑bit numbers, the result might require 9 bits; the extra bit is called an overflow. Overflow flags are important in CPU architecture to indicate an error in signed arithmetic.
二进制加法遵循简单规则:0+0=0,0+1=1,1+0=1,1+1=0 进位1,1+1+1=1 进位1。当两个8位二进制数相加时,结果可能需要9位;多出的那一位称为溢出。溢出标志在CPU架构中很重要,用于指示带符号运算中的错误。
Worked example: 11001010₂ + 01101101₂
Add column‑wise from right to left: result = 1 00110111₂, so a carry into a 9th bit (overflow). The 8‑bit sum stored is 00110111₂ but the overflow flag would be set.
例题:11001010₂ + 01101101₂
从右向左按列相加:结果为 1 00110111₂,因此进位到第9位(溢出)。存储的8位和为 00110111₂,但溢出标志会被置位。
3. Two’s Complement Negative Numbers | 补码表示负数
WJEC IGCSE expects you to represent negative integers using two’s complement. In an 8‑bit system, the most significant bit (MSB) represents the negative place value −128. The other bits represent positive values as usual. To find the two’s complement of a positive number to get its negative, invert all bits and add 1.
WJEC IGCSE 要求你使用补码表示负整数。在8位系统中,最高位(MSB)代表负权值 −128,其余位照常表示正值。要将正数转为负数,先对所有位取反,然后加1。
Example: Find the 8‑bit two’s complement representation of −37
Start with +37 in binary: 00100101. Invert: 11011010. Add 1: 11011011. So −37₁₀ = 11011011₂ in two’s complement. Notice the MSB is 1, indicating a negative number.
示例:求 −37 的8位补码表示
先写出 +37 的二进制:00100101。取反:11011010。加1:11011011。所以 −37₁₀ 的补码为 11011011₂。注意最高位是1,表示负数。
When interpreting a two’s complement number, if the MSB is 1, you can convert it back to denary by applying the rule: value = −128 + (remaining bit values), or by finding its two’s complement again and attaching a minus sign.
在解读补码数时,如果最高位为1,可以通过规则:数值 = −128 +(其余位的值),或者再取一次补码然后添负号来转回十进制。
4. Data Storage Units and Text File Size | 数据存储单位与文本文件大小
Data quantities are expressed in bits, bytes (B), kilobytes (kB), megabytes (MB), etc. The exam often uses multiples of 1000 for file size, but check the specification for WJEC; typically it follows decimal multiples (1 kB = 1000 B, 1 MB = 1000 kB). Always read the question carefully. To calculate the size of a plain text file, multiply the number of characters by the number of bits per character (ASCII uses 7 or 8 bits; Unicode may use 16 or 32 bits).
数据量用位(bit)、字节(B)、千字节(kB)、兆字节(MB)等表示。考试中文件大小常采用1000的倍数(1 kB = 1000 B,1 MB = 1000 kB),但需根据 WJEC 具体要求仔细读题。计算纯文本文件大小时,用字符数乘以每个字符的位数(ASCII 通常为7或8位;Unicode 可为16或32位)。
Example: A text file contains 8000 characters encoded in 8‑bit ASCII. Size in bits = 8000 × 8 = 64 000 bits. In bytes = 64 000 / 8 = 8000 B. In kB = 8000 / 1000 = 8 kB.
示例:一个文本文件包含 8000 个字符,采用8位 ASCII 编码。位数为 8000 × 8 = 64 000 位。字节数为 64 000 / 8 = 8000 B。千字节数为 8000 / 1000 = 8 kB。
When using Unicode (e.g., 16‑bit), simply multiply by 16 and convert accordingly. Always show your working with clear steps and include the correct unit.
若采用 Unicode(如 16 位),只需乘以 16 再相应换算。务必展示清晰的运算步骤并带上正确单位。
5. Sound File Size Calculation | 声音文件大小计算
Sound is stored digitally by sampling the analogue signal at regular intervals. The file size depends on the sample rate (Hz), sample resolution (bits per sample), duration (seconds), and the number of channels (mono = 1, stereo = 2). Formula: file size = sample rate × bit depth × duration × channels. The result is in bits; convert to bytes or higher units as needed.
声音通过以固定间隔对模拟信号采样来数字化存储。文件大小取决于采样率(Hz)、采样精度(位/样本)、时长(秒)和声道数(单声道=1,立体声=2)。公式:文件大小 = 采样率 × 位深度 × 时长 × 声道数。结果单位为位,再根据需要转换为字节或更大单位。
Example: A 30‑second stereo music clip is recorded at 44.1 kHz with 16‑bit resolution. File size = 44 100 × 16 × 30 × 2 = 42 336 000 bits. Convert to MB: 42 336 000 / 8 = 5 292 000 B; divide by 1 000 000 gives about 5.29 MB.
示例:一段30秒的立体声音乐片断,采样率 44.1 kHz,16位精度。文件大小 = 44 100 × 16 × 30 × 2 = 42 336 000 位。转换为 MB:除以8得 5 292 000 B,再除以 1 000 000 约等于 5.29 MB。
Often you are asked to calculate the additional file size if certain parameters change, or to find one missing parameter given the total size. Rearranging the formula is a vital skill.
考题常要求计算参数改变后文件大小的变化,或根据总大小反推某个缺失参数。重新排列公式是一项关键技能。
6. Image File Size and Colour Depth | 图像文件大小与颜色深度
Bitmap images are composed of pixels. The number of pixels is the image resolution (width × height). Colour depth is the number of bits used to represent the colour of each pixel. The total size in bits = width × height × colour depth. Again, the raw answer is in bits; you may need to convert to kB or MB.
位图图像由像素组成。像素数量即图像分辨率(宽度 × 高度)。颜色深度是表示每个像素颜色的位数。总位数 = 宽度 × 高度 × 颜色深度。同样,结果单位为位,可能需要转换为 kB 或 MB。
Example: An image has dimensions 1024 × 768 and a colour depth of 24 bits. Size = 1024 × 768 × 24 = 18 874 368 bits. Divide by 8 = 2 359 296 B; divide by 1 000 000 ≈ 2.36 MB.
示例:一张图像尺寸为 1024 × 768,颜色深度为 24 位。大小 = 1024 × 768 × 24 = 18 874 368 位。除以8得 2 359 296 B;除以 1 000 000 ≈ 2.36 MB。
Colour depth determines the number of available colours (2n for n bits). A depth of 8 bits yields 256 colours; 24 bits yields about 16.7 million colours. You might be asked to calculate the maximum number of colours from a given bit depth or file size.
颜色深度决定了可用的颜色数量(n位对应2ⁿ 种颜色)。8位深度产生256色;24位约1667万色。可能会要求根据给定位深度或文件大小计算最大颜色数。
- If total raw bit size = width × height × bits per pixel, then bits per pixel = size in bits / (width × height).
- 如果原始总位数 = 宽度 × 高度 × 每像素位数,则每像素位数 = 总位数 / (宽度 × 高度)。
7. Data Compression Ratios | 数据压缩率计算
Compression reduces file size for storage or transmission. The compression ratio is calculated as: original size divided by compressed size (often expressed as a ratio like 5:1). Alternatively, calculate the percentage saving: ((original − compressed) / original) × 100%.
压缩可以减小存储或传输的文件大小。压缩比计算公式:原始大小 / 压缩后大小(通常表示为如 5:1 的比例)。也可以计算节省的百分比:((原始 − 压缩) / 原始) × 100%.
Example: A file is originally 8 MB and after lossless compression it becomes 2 MB. Compression ratio = 8 / 2 = 4:1. The space saving = (8−2)/8 × 100% = 75%.
示例:一个文件原始大小为 8 MB,经无损压缩后变为 2 MB。压缩比 = 8 / 2 = 4:1。节省的空间 = (8−2)/8 × 100% = 75%.
You should also be able to compute the transmitted compressed size given the compression ratio and original size, or find the time to transmit a compressed file over a given bandwidth.
你还应能够根据压缩比和原始大小计算压缩后的传输大小,或在给定带宽下计算传输压缩文件所需的时间。
8. Logic Gates and Truth Table Calculations | 逻辑门与真值表计算
Logic gates (AND, OR, NOT, NAND, NOR, XOR) form the basis of digital circuits. WJEC exam questions may provide a logic circuit diagram and ask you to complete a truth table or work out the output for a given set of inputs. You must be able to combine gate functions step by step.
逻辑门(与、或、非、与非、或非、异或)构成了数字电路的基础。WJEC 考试可能给出一个逻辑电路图,要求你完成真值表或计算特定输入下的输出。你必须能够逐步组合各个门的功能。
Example: For inputs A=0, B=1, C=1 through the circuit: NOT C = 0, then AND of A (0) and NOT C (0) = 0; finally OR that result with B (1) → output Q = 1. You should present your working in a truth table with intermediate columns.
示例:对于输入 A=0, B=1, C=1,经过电路:非 C = 0,然后 A (0) 与非 C (0) 的与运算 = 0;最后将该结果与 B (1) 进行或运算 → 输出 Q = 1。你应在真值表中列出中间运算列。
| A | B | C | NOT C | A AND NOT C | Q (OR with B) |
|---|---|---|---|---|---|
| 0 | 1 | 1 | 0 | 0 | 1 |
Be prepared to recognise logic expression shorthand; for instance, Q = (A AND (NOT C)) OR B, and work out the output for all input combinations.
准备好识别逻辑表达式简写,例如 Q = (A AND (NOT C)) OR B,并计算所有输入组合下的输出。
9. Data Transmission Time | 数据传输时间
Network transmission calculations involve the formula: transmission time = file size / data transfer rate. Ensure units match: file size in bits and transfer rate in bits per second (bps). If given in bytes per second, convert consistently. Transfer delay may also include propagation time, but basic calculations focus on bandwidth.
网络传输计算涉及公式:传输时间 = 文件大小 / 数据传输速率。确保单位一致:文件大小用位表示,传输速率用位/秒 (bps) 表示。如果给出的单位是字节/秒,要统一换算。传输延迟还可能包含传播时间,但基础计算集中在带宽上。
Example: A 100 MB file is sent over a 50 Mbps connection. File size in bits = 100 × 8 × 1 000 000 = 800 000 000 bits. Rate = 50 000 000 bps. Time = 800 000 000 / 50 000 000 = 16 seconds.
示例:一个 100 MB 的文件通过 50 Mbps 的连接发送。文件大小换算为位:100 × 8 × 1 000 000 = 800 000 000 位。速率 = 50 000 000 bps。时间 = 800 000 000 / 50 000 000 = 16 秒。
If compression is applied before transmission, recalculate the compressed file size first, then divide by the transfer rate. Also, you may need to factor in packet headers in some scenarios, but WJEC IGCSE typically uses straightforward calculations.
如果传输前进行了压缩,先重新计算压缩后的文件大小,再除以传输速率。在某些情境下可能需要考虑数据包头部,但 WJEC IGCSE 通常采用简单计算。
10. ASCII and Character Encoding Calculations | ASCII 与字符编码计算
ASCII uses 7 bits for standard characters, but is often stored as 8 bits (1 byte) with an extra parity bit or padding. Extended ASCII uses the full 8 bits for additional symbols. You might need to determine the binary pattern for a character using its decimal ASCII code, or work out how many bytes are needed to store a given string including spaces and punctuation.
标准 ASCII 使用7位表示字符,但通常占用8位(1字节)存储,多出的一位可作为奇偶校验位或填充。扩展 ASCII 使用完整的8位以包含更多符号。你可能需要根据字符的十进制 ASCII 码确定其二进制模式,或计算存储一段包含空格和标点的字符串需要多少字节。
Example: The word ‘CAT’ in 8‑bit ASCII: C=67₁₀=01000011, A=65=01000001, T=84=01010100. Total size = 3 bytes. Remember to count spaces (ASCII 32) as characters.
示例:单词 ‘CAT’ 用8位 ASCII 表示:C=67₁₀=01000011, A=65=01000001, T=84=01010100。总大小 = 3 字节。记得将空格(ASCII 32)算作字符。
Text file size questions often include a table of values or ask you to deduce the encoding from hexadecimal dumps. Practice reading hex and recognising patterns.
文本文件大小问题常包含一张数值表,或要求你根据十六进制转储推断编码。多练习阅读十六进制值并识别模式。
11. Basic Algorithm Time Complexity Awareness | 基本算法时间复杂度认知
While WJEC IGCSE does not demand rigorous big‑O notation calculations, you should be able to compare the efficiency of linear search vs binary search, and bubble sort vs merge sort in terms of the number of comparisons. For a linear search on n items, maximum comparisons = n; for binary search on a sorted list, maximum ≈ log₂(n).
虽然 WJEC IGCSE 不要求严格的大O符号计算,但你应该能够从比较次数的角度,比较线性搜索与二分搜索、冒泡排序与归并排序的效率。对于 n 个数据项的线性搜索,最大比较次数为 n;对于有序列表的二分搜索,最大比较次数约为 log₂(n)。
Example: How many comparisons are needed to find a value in an array of 256 sorted items using binary search at worst? Maximum steps = log₂(256) = 8 because 2⁸=256.
示例:在最坏情况下,对一个包含 256 个已排序项的数组使用二分搜索需要多少次比较?最大步数 = log₂(256) = 8,因为 2⁸=256。
Bubble sort performs (n−1)+(n−2)+…+1 comparisons leading to roughly n²/2. Merge sort splits lists repeatedly and merges, requiring roughly n log₂(n) comparisons. You may be asked to select the more efficient algorithm for a given scenario.
冒泡排序的比较次数为 (n−1)+(n−2)+…+1,大致为 n²/2。归并排序则反复分割列表并合并,需要大约 n log₂(n) 次比较。你可能会被要求为特定场景选择更高效的算法。
12. Exam Tips and Common Pitfalls | 考试技巧与常见陷阱
Always show your working clearly—marks are often awarded for method even if the final answer is slightly wrong. Double‑check unit conversions (bits to bytes, bytes to kilobytes) ensuring you use the correct factor (usually 1000, but some historical contexts use 1024; follow the question). For large numbers, using scientific notation or standard form can reduce mistakes.
始终清晰地展示运算步骤——即使最终答案略有偏差,方法通常也会给分。仔细核对单位换算(位转字节,字节转千字节),确保使用正确的倍数(通常是1000,但某些历史语境用1024;以题目要求为准)。对于大数值,使用科学记数法或标准形式可以减少错误。
When converting between number systems, verify by working backwards. For logic circuits, build the truth table column by column. In file size problems, underline the given values and match them to the formula before substituting. Finally, practice timed calculation sets—many students lose marks because they run out of time on arithmetic.
在进行数制转换时,可通过逆运算来验证。对于逻辑电路,逐列构建真值表。在文件大小问题中,先将给定数值下划线,与公式中的变量一一对应,再代入计算。最后,进行限时练习——许多学生因在算术上耗时过多而丢分。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导