📚 IGCSE WJEC Computer Science: Calculation Practice | IGCSE WJEC 计算机科学:计算题专项训练
This revision guide focuses on the common calculation questions found in the WJEC IGCSE Computer Science examination. Mastery of these calculations is essential for securing high marks in the data representation, hardware, networks, and logic topics. Each section presents a clear methodology, worked examples, and the key formulas you need to know. Practise these question types regularly and you will approach any numerical problem with confidence.
本复习指南针对 WJEC IGCSE 计算机科学考试中常见的计算题。掌握这些计算对于在数据表示、硬件、网络和逻辑等主题中取得高分至关重要。每个小节都提供了清晰的方法、解题示例以及你需要牢记的关键公式。经常练习这些题型,你就能自信地面对任何数值计算题。
1. Binary, Denary and Hexadecimal Conversions | 二进制、十进制与十六进制转换
To convert a binary number to denary, write the place values above each bit. Remember that the rightmost bit holds 2⁰ (1), the next 2¹ (2), then 2² (4), doubling each time. Multiply each bit by its place value and sum all results.
将二进制数转换为十进制时,需要在每位上方写下位权。最右边的位为 2⁰(1),左移一位为 2¹(2),然后是 2²(4),每次倍增。将每个位值乘以对应的位权,然后将所有结果相加。
Example: Convert 101101₂ to denary. Place values: 32, 16, 8, 4, 2, 1. Calculation: (1×32) + (0×16) + (1×8) + (1×4) + (0×2) + (1×1) = 32 + 0 + 8 + 4 + 0 + 1 = 45.
示例:将 101101₂ 转换为十进制。位权:32, 16, 8, 4, 2, 1。计算:(1×32) + (0×16) + (1×8) + (1×4) + (0×2) + (1×1) = 32 + 0 + 8 + 4 + 0 + 1 = 45。
For hexadecimal, treat digits A–F as 10–15. Convert each hex digit into a 4‑bit binary nibble, then combine. Alternatively, multiply each hex digit by its corresponding power of 16 (16⁰, 16¹, …).
对于十六进制,将字母 A–F 视为 10–15。将每个十六进制位转换成一个 4 位的二进制半字节,然后拼接起来。也可以将每个十六进制位乘以相应的 16 的幂(16⁰, 16¹, …)。
Example: 2F₁₆ = (2×16¹) + (15×16⁰) = 32 + 15 = 47 in denary.
示例:2F₁₆ = (2×16¹) + (15×16⁰) = 32 + 15 = 47(十进制)。
2. Binary Addition and Overflow | 二进制加法与溢出
Binary addition follows the same rules as denary addition but with only 0s and 1s. The key rules are: 0+0=0, 0+1=1, 1+0=1, 1+1=0 carry 1, and 1+1+carry=1 carry 1. Align the numbers and work from right to left, carrying into the next column when the sum exceeds 1.
二进制加法和十进制加法遵循相似的规则,但只有 0 和 1。基本规则为:0+0=0, 0+1=1, 1+0=1, 1+1=0 进 1, 以及 1+1+进位=1 进 1。将数字对齐,从右向左计算,当和大于 1 时向下一位进位。
An overflow error occurs when the result of an addition exceeds the available number of bits. In an 8‑bit system, the largest unsigned number is 255. If adding two numbers produces a carry into a 9th bit, that carry is lost, causing an incorrect result.
当加法结果超出可用位数时,会发生溢出错误。在 8 位系统中,最大无符号数为 255。如果两个数相加产生了一个向第 9 位的进位,该进位将丢失,从而导致结果错误。
Example using 4 bits: 1011 (11) + 0111 (7) = 1 0010, which requires 5 bits. The leftmost 1 is discarded, leaving 0010 (2), clearly wrong.
以 4 位为例:1011 (11) + 0111 (7) = 1 0010,需要 5 位。最左边的 1 被丢弃,剩下 0010 (2),结果明显错误。
3. Logical and Arithmetic Shifts | 逻辑移位与算术移位
Shifting bits to the left multiplies the number by 2 for each position shifted. A single left shift of 0011₂ (3) gives 0110₂ (6). Bits vacated on the right are filled with 0. If a 1 is shifted out of the most significant bit, an overflow may occur.
将位向左移动,每移一位相当于将数值乘以 2。将 0011₂(3)左移一位得到 0110₂(6)。右边空出的位用 0 填充。如果最高位的 1 被移出,则可能发生溢出。
A logical right shift fills the leftmost bits with 0 and divides an unsigned binary number by 2. An arithmetic right shift preserves the sign bit (the leftmost bit) for signed numbers, so negative values remain negative. This effectively divides by 2 while maintaining the sign.
逻辑右移将最左边的位用 0 填充,用于无符号二进制数除以 2。算术右移则保留符号位(最左位),使得有符号数保持正负性质。这样既能实现除以 2,又能保持符号不变。
Example: 11100100₂ (negative in two’s complement) arithmetic right shift once → 11110010₂. The sign bit 1 is replicated.
示例:11100100₂(补码表示的负数)算术右移一位 → 11110010₂。符号位 1 被复制。
4. Two’s Complement and Negative Numbers | 二进制补码与负数表示
To represent a negative number in two’s complement, start with the binary of its positive absolute value, using the required number of bits. Invert all bits (flip 1s to 0s and 0s to 1s), then add 1 to the least significant bit.
要用二进制补码表示负数,首先用指定位数写出该数正值的绝对值二进制。将所有位取反(1 变 0,0 变 1),然后在最低位加 1。
For example, represent –5 in an 8‑bit two’s complement system. Positive 5 is 00000101. Invert → 11111010. Add 1 → 11111011. The leftmost bit acts as the sign (1 for negative). To convert back, reverse the process: subtract 1 and invert again, then read the magnitude.
示例:在 8 位补码系统中表示 –5。正数 5 为 00000101。取反 → 11111010。加 1 → 11111011。最左位为符号位(1 表示负数)。要转换回去,先减 1 再取反,然后读出绝对值。
Two’s complement addition works directly. Adding 11111011 (–5) and 00000101 (+5) produces 1 00000000; the carry out of the 8‑bit range is ignored, giving 00000000 (0).
补码加法可以直接进行。将 11111011(–5)与 00000101(+5)相加,得到 1 00000000;超出 8 位的进位被忽略,结果为 00000000(0)。
5. Character Encoding and Text File Size | 字符编码与文本文件大小
Each character in a text file is represented by a binary code. With standard ASCII, each character uses 7 bits (often stored as 8 bits, or 1 byte). Extended ASCII uses 8 bits per character. Unicode (UTF‑16) typically uses 16 bits (2 bytes) per character, allowing a much wider range of symbols.
文本文件中的每个字符都由一个二进制编码表示。标准的 ASCII 码每个字符使用 7 位(常以 8 位即 1 字节存储)。扩展 ASCII 码使用 8 位每字符。Unicode(UTF‑16)通常使用 16 位(2 字节)每字符,支持更广泛的符号。
File size (bytes) = number of characters × bits per character / 8
文件大小(字节) = 字符数 × 每个字符位数 / 8
Example: A document contains 2000 characters using extended ASCII (8 bits per character). File size = 2000 × 8 / 8 = 2000 bytes, or approximately 1.95 KB (2000 / 1024).
示例:一个文档包含 2000 个字符,采用扩展 ASCII(每字符 8 位)。文件大小 = 2000 × 8 / 8 = 2000 字节,约为 1.95 KB(2000 / 1024)。
6. Image File Size Calculation | 图像文件大小计算
Bitmap images are composed of pixels. The colour depth determines how many bits are used for each pixel. A colour depth of 24 bits allows 2²⁴ ≈ 16.8 million colours. The resolution gives the width and height in pixels. The file size of an uncompressed image is the product of these factors plus any metadata, which is usually ignored in basic calculations.
位图图像由像素组成。颜色深度决定每个像素使用的位数。24 位颜色深度可表示约 1680 万种颜色。分辨率用像素宽度和高度表示。未压缩图像的文件大小等于这些因子的乘积加上元数据,但在基础计算中元数据通常忽略不计。
Image size (bits) = width × height × colour depth
图像大小(位) = 宽度 × 高度 × 颜色深度
Example: An image has resolution 1024 × 768 and uses 24‑bit colour. Bits = 1024 × 768 × 24 = 18,874,368 bits. Convert to bytes: ÷8 = 2,359,296 B. To MB: ÷1024² ≈ 2.25 MB.
示例:一张图像分辨率为 1024×768,采用 24 位色彩。位数 = 1024 × 768 × 24 = 18,874,368 位。转换为字节:除以 8 = 2,359,296 B。转换为 MB:除以 1024² ≈ 2.25 MB。
If the image is stored with an indexed palette (e.g. 8‑bit colour depth), replace 24 with 8, drastically reducing the size. Always check whether the question specifies bits or bytes for the final answer.
如果图像使用索引调色板(如 8 位颜色深度),将 24 替换为 8,可显著减小体积。务必检查题目要求最终答案的单位是位还是字节。
7. Sound File Size Calculation | 声音文件大小计算
Digital audio is created by sampling the sound wave at regular intervals. The sample rate (e.g. 44.1 kHz) is the number of samples taken per second. Bit depth determines the number of bits per sample (e.g. 16‑bit). For stereo audio, the number of channels is 2. The duration is usually given in seconds.
数字音频通过对声波进行等间隔采样生成。采样率(如 44.1 kHz)是每秒采样的次数。位深度决定每个样本的位数(如 16 位)。立体声音频的声道数为 2。时长通常以秒为单位。
Sound file size (bits) = sample rate × bit depth × duration (s) × number of channels
声音文件大小(位) = 采样率 × 位深度 × 时长(秒) × 声道数
Example: Calculate the size of a 3‑minute stereo audio track recorded at 44.1 kHz with 16‑bit samples. Duration = 3 × 60 = 180 s. Bits = 44,100 × 16 × 180 × 2 = 254,016,000 bits. Bytes = 254,016,000 / 8 = 31,752,000 B. In MB: / (1024 × 1024) ≈ 30.28 MB.
示例:计算一段 3 分钟的立体声音轨的大小,采样率 44.1 kHz,16 位样本。时长 = 3 × 60 = 180 秒。位数 = 44,100 × 16 × 180 × 2 = 254,016,000 位。字节数 = 254,016,000 / 8 = 31,752,000 B。约为 30.28 MB。
Always ensure that the sample rate is in hertz (samples per second), not kilohertz, before multiplying. Convert GHz, MHz or kHz to Hz by multiplying by 10⁹, 10⁶ or 10³ respectively.
乘法计算前,务必确保采样率单位是赫兹(次/秒),而非千赫兹。将 GHz、MHz 或 kHz 分别乘以 10⁹、10⁶ 或 10³ 转为 Hz。
8. Data Transfer Time Calculation | 数据传输时间计算
When sending data over a network, the transfer time depends on the file size and the bandwidth (data transfer rate). The formula is: time (seconds) = data size (bits) / bandwidth (bits per second). It is essential that both quantities use the same base unit (bits or bytes).
通过网络传输数据时,传输时间取决于文件大小和带宽(数据传输速率)。公式为:时间(秒) = 数据大小(位) / 带宽(位每秒)。务必确保两者的基本单位统一为位或字节。
Transfer time = data size ✕ 8 (if in bytes) / bandwidth in bps
传输时间 = 数据大小 × 8(若以字节为单位) / 带宽(bps)
Example: A 200 MB file is to be transferred over a 50 Mbps connection. Convert file size to bits: 200 × 1,048,576 × 8 = 1,677,721,600 bits (using binary megabytes). Bandwidth in bps: 50,000,000. Time = 1,677,721,600 / 50,000,000 ≈ 33.55 seconds. In exams, check whether the specification uses 1 MB = 1,000,000 bytes or 2²⁰ bytes; many IGCSE papers accept either if clearly stated.
示例:通过 50 Mbps 的链路传输一个 200 MB 的文件。将文件大小转换为位:200 × 1,048,576 × 8 = 1,677,721,600 位(采用二进制兆字节)。带宽为 50,000,000 bps。时间 = 1,677,721,600 / 50,000,000 ≈ 33.55 秒。考试中需确认考纲采用 1 MB = 1,000,000 字节还是 2²⁰ 字节;许多 IGCSE 试卷只要明确注明即可接受。
9. Storage Units Conversion | 存储容量单位换算
Computer storage is measured using a binary system: a nibble is 4 bits, a byte is 8 bits. Larger units are defined as powers of 2: 1 KiB = 2¹⁰ bytes (1024 B), 1 MiB = 2²⁰ bytes, 1 GiB = 2³⁰ bytes. In everyday context, these are often called KB, MB, GB. Perform conversions by multiplying or dividing by 1024.
计算机存储采用二进制计量单位:半字节为 4 位,字节为 8 位。更大单位定义为 2 的幂:1 KiB = 2¹⁰ 字节(1024 B),1 MiB = 2²⁰ 字节,1 GiB = 2³⁰ 字节。日常用语中常称为 KB、MB、GB。通过乘以或除以 1024 进行转换。
Example: Convert 5 GiB to bytes. 5 × 1024³ = 5 × 1,073,741,824 = 5,368,709,120 bytes. This is roughly 5.37 × 10⁹ bytes.
示例:将 5 GiB 转换为字节。5 × 1024³ = 5 × 1,073,741,824 = 5,368,709,120 字节,约为 5.37 × 10⁹ 字节。
When calculating file sizes, always start from bits, then divide by 8 to get bytes, and continue dividing by 1024 for kB, MB, etc. Avoid mixing decimal and binary prefixes unless the question instructs otherwise.
计算文件大小时,始终从位开始,除以 8 得到字节,再连续除以 1024 得到 KB、MB 等。除非题目另有说明,否则不要混淆十进制与二进制前缀。
10. Logic Gates and Truth Table Calculations | 逻辑门与真值表计算
Logic circuits can be analysed by writing out every possible combination of inputs. For n inputs, there are 2ⁿ rows in the truth table. Evaluate the expression step by step using the standard truth tables for NOT, AND, OR, and XOR.
通过列出所有可能的输入组合,可以分析逻辑电路。对于 n 个输入,真值表共有 2ⁿ 行。运用 NOT、AND、OR 和 XOR 的标准真值表逐步求值。
Example: Q = (A AND B) OR (NOT C). Inputs: A, B, C. Number of rows: 2³ = 8. For row where A=1, B=0, C=1: A AND B = 0, NOT C = 0, so Q = 0 OR 0 = 0. For A=1, B=0, C=0: A AND B = 0, NOT C = 1, Q = 0 OR 1 = 1. Complete all rows to verify the function.
示例:Q = (A AND B) OR (NOT C)。输入:A, B, C。行数:2³ = 8。在 A=1, B=0, C=1 的行中:A AND B = 0, NOT C = 0, 因此 Q = 0 OR 0 = 0。在 A=1, B=0, C=0 的行中:A AND B = 0, NOT C = 1, Q = 0 OR 1 = 1。完成所有行以验证功能。
To solve a given circuit, label intermediate outputs then fill the truth table. Always re‑check the NOT gate columns carefully, as sign errors are common. When asked for a simplified Boolean expression, you may apply Boolean identities or Karnaugh maps, but simple direct evaluation is sufficient for many calculation questions.
要求解给定电路,先标记中间输出,再填写真值表。务必仔细复核 NOT 门的列,因为符号错误很常见。如果要求化简布尔表达式,可应用布尔恒等式或
Published by TutorHao | IGCSE Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导