IGCSE Computer Science: Calculation Practice | IGCSE 计算机:计算题专项训练

📚 IGCSE Computer Science: Calculation Practice | IGCSE 计算机:计算题专项训练

Mastering calculation problems is essential for success in IGCSE Computer Science. This guide provides targeted practice across all key numeric topics, from binary arithmetic to file size estimation. Each section contains bilingual explanations to strengthen both understanding and exam technique.

掌握计算题是 IGCSE 计算机科学取得高分的关键。本指南针对所有核心数字题型提供专项训练,涵盖二进制运算到文件大小估算。每节均配有中英双语讲解,帮助巩固理解并提升应试技巧。

1. Number Systems & Conversions | 数制与转换

In IGCSE, you must be able to convert between binary, denary and hexadecimal. Binary is base‑2, denary is base‑10, and hexadecimal is base‑16. Conversions rely on place values and remainders.

IGCSE 要求能进行二进制、十进制与十六进制之间的转换。二进制是基数为 2,十进制是基数为 10,十六进制是基数为 16。转换依赖于位值和余数。

Denary → Binary: repeatedly divide by 2 and record remainders. For example, 77 in denary: 77 ÷ 2 = 38 r1, 38 ÷ 2 = 19 r0, 19 ÷ 2 = 9 r1, 9 ÷ 2 = 4 r1, 4 ÷ 2 = 2 r0, 2 ÷ 2 = 1 r0, 1 ÷ 2 = 0 r1. Read remainders upwards: 1001101.

十进制 → 二进制:反复除以 2 并记录余数。例如 77:77 ÷ 2 = 38 余 1, 38 ÷ 2 = 19 余 0, 19 ÷ 2 = 9 余 1, 9 ÷ 2 = 4 余 1, 4 ÷ 2 = 2 余 0, 2 ÷ 2 = 1 余 0, 1 ÷ 2 = 0 余 1。从下往上读余数:1001101。

Binary → Denary: sum each bit multiplied by its place power of 2. 1001101₂ = 1×64 + 0×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1 = 77.

二进制 → 十进制:每位乘以 2 的位权后求和。1001101₂ = 1×64 + 0×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1 = 77。

Hexadecimal ↔ Binary: group binary digits in nibbles (4 bits). 1001101₂ can be written as 0100 1101 → 4 D → 4D₁₆. Reverse: 4D₁₆ → 0100 1101.

十六进制 ↔ 二进制:将二进制每四位一组(不足补零)。1001101₂ 写作 0100 1101 → 4 D → 4D₁₆。反之亦然。


2. Binary Addition & Overflow | 二进制加法与溢出

Binary addition follows the same principles as denary addition. The rules: 0+0=0, 0+1=1, 1+0=1, 1+1=0 carry 1, 1+1+carry=1 carry 1.

二进制加法遵循与十进制相同的规则。规则:0+0=0, 0+1=1, 1+0=1, 1+1=0 进位 1, 1+1+进位=1 进位 1。

Add 0110 1101 (109) and 0011 1001 (57). Working right to left: 1+1=0 carry 1, then 0+0+carry=1, 1+0=1, 1+1=0 carry 1, 0+1+carry=0 carry 1, 1+1+carry=1 carry 1, 1+0+carry=0 carry 1, 0+0+carry=1. Result: 1010 0110 (166). Check: 109+57=166.

计算 0110 1101 (109) 与 0011 1001 (57) 相加。从右向左:1+1=0 进1,然后 0+0+进=1,1+0=1,1+1=0 进1,0+1+进=0 进1,1+1+进=1 进1,1+0+进=0 进1,0+0+进=1。结果:1010 0110 (166)。验证:109+57=166。

Overflow occurs when the sum exceeds the maximum value representable in the given number of bits. For an 8‑bit register, max unsigned is 255 (1111 1111). Adding 1111 1111 + 0000 0001 results in 1 0000 0000 (9 bits) – the ninth bit is lost, leaving 0000 0000 and setting an overflow flag.

溢出发生在结果超出指定位数可表示的最大值时。8 位寄存器无符号最大值为 255 (1111 1111)。1111 1111 + 0000 0001 得到 1 0000 0000 (9 位),最高位丢失,剩下 0000 0000 并置溢出标志。


3. Logical Shifts | 逻辑移位

A logical left shift moves all bits to the left by n places. Vacated right bits are filled with 0. Left shifting by 1 multiplies the number by 2; left shift by n multiplies by 2ⁿ. Overflow bits may be lost.

逻辑左移将所有位向左移动 n 位,右侧空位补 0。左移 1 位相当于乘以 2;左移 n 位相当于乘以 2ⁿ。溢出的位可能丢失。

Shift 0010 1101 (45) left by 1: becomes 0101 1010 (90). Left by 2: 1011 0100 (180) but note the leftmost bit shifted out; if register is 8‑bit, overflow may occur if a 1 is lost.

将 0010 1101 (45) 左移 1 位:得到 0101 1010 (90)。左移 2 位:1011 0100 (180),但最左位被移出;若寄存器为 8 位,丢失 1 位会导致溢出。

A logical right shift moves bits to the right, filling the leftmost bits with 0. Right shifting by 1 divides the unsigned number by 2 (integer division). Right shift by n divides by 2ⁿ.

逻辑右移将位右移,左端补 0。右移 1 位相当于无符号整数除以 2(整除)。右移 n 位相当于除以 2ⁿ。

Shift 1010 0100 (164) right by 1: 0101 0010 (82). Right by 2: 0010 1001 (41). Remainders are discarded.

将 1010 0100 (164) 右移 1 位:0101 0010 (82)。右移 2 位:0010 1001 (41)。余数被丢弃。


4. Logic Gates & Truth Tables | 逻辑门与真值表

Logic gates (NOT, AND, OR, NAND, NOR, XOR) form the basis of digital circuits. Each gate has a defined truth table. Inputs and outputs are Boolean (0 or 1).

逻辑门(NOT、AND、OR、NAND、NOR、XOR)是数字电路的基础。每个门都有确定的真值表。输入输出均为布尔值(0 或 1)。

AND: output is 1 only if both inputs are 1. OR: output is 1 if at least one input is 1. NOT: inverts the single input. NAND = NOT AND, NOR = NOT OR. XOR: output is 1 when inputs differ.

与门:只有两个输入都为 1 时输出 1。或门:至少一个输入为 1 时输出 1。非门反转输入。与非门是与门的反相,或非门是或门的反相。异或门:输入不同时输出 1。

A two‑input truth table has 4 rows (00,01,10,11). For a circuit with multiple gates, construct columns for intermediate outputs. Example: A AND B, then OR with C. You need to compute intermediate values step by step.

两输入真值表有 4 行(00,01,10,11)。对于多门电路,为中间输出增设列。例如:先计算 A AND B,再将该结果与 C 进行 OR。需逐步计算中间值。

Given inputs A=1, B=0, C=1, find Q = (A AND B) OR C. A AND B = 0, then 0 OR 1 = 1. So Q = 1.

已知输入 A=1, B=0, C=1,求 Q = (A AND B) OR C。A AND B = 0,然后 0 OR 1 = 1。故 Q = 1。


5. Storage Unit Conversions | 存储单位换算

Data storage sizes are measured in bits, bytes, kilobytes, megabytes, gigabytes, and terabytes. Exam questions frequently ask for conversions between these units.

数据存储大小以位、字节、千字节、兆字节、吉字节、太字节衡量。考试常要求进行单位换算。

1 byte = 8 bits, 1 kibibyte (KiB) = 1024 bytes, 1 mebibyte (MiB) = 1024 KiB, 1 gibibyte (GiB) = 1024 MiB, 1 tebibyte (TiB) = 1024 GiB. Note: exam boards often use kB, MB, GB meaning 1000‑based, but many IGCSE syllabuses accept both and specify if 1024‑based. Always check context.

1 字节 = 8 位,1 KiB = 1024 字节,1 MiB = 1024 KiB,1 GiB = 1024 MiB,1 TiB = 1024 GiB。注意:考试大纲有时使用 kB、MB、GB 表示基于 1000 的单位,但 IGCSE 很多接受 1024 并会明确。务必审题。

Convert 500 MiB into bytes: 500 × 1024 × 1024 = 524,288,000 bytes (or 524,288,000 B). For bits multiply by 8: 500 × 1024 × 1024 × 8 = 4,194,304,000 bits.

将 500 MiB 转换为字节:500 × 1024 × 1024 = 524,288,000 字节。转换为位再乘 8:4,194,304,000 位。

Express 2,000,000 bytes in MiB: 2,000,000 ÷ 1024 ÷ 1024 ≈ 1.907 MiB. Carry out such calculations to 2‑3 decimal places if required.

将 2,000,000 字节换算为 MiB:2,000,000 ÷ 1024 ÷ 1024 ≈ 1.907 MiB。必要时保留 2 至 3 位小数。


6. File Size: Images | 文件大小:图像

Image file size depends on resolution (width × height in pixels) and colour depth (bits per pixel). Colour depth defines how many colours can be represented: 1 bit → 2 colours, 2 bits → 4, 8 bits → 256, 24 bits → ~16.7 million.

图像文件大小取决于分辨率(宽×高,单位像素)和颜色深度(每位像素位数)。颜色深度决定可表示的颜色数量:1 位 → 2 色,2 位 → 4 色,8 位 → 256 色,24 位 → 约 1670 万色

File size (bits) = width × height × colour depth. Convert to bytes by dividing by 8, then to larger units as needed.

文件大小(位)= 宽 × 高 × 颜色深度。除以 8 后换算为字节,再转更大单位。

Example: an image with resolution 1024 × 768 and colour depth 16 bits. Bits = 1024 × 768 × 16 = 12,582,912 bits. Bytes = 12,582,912 ÷ 8 = 1,572,864 B. MiB = 1,572,864 ÷ 1024 ÷ 1024 = 1.5 MiB.

示例:分辨率为 1024×768、颜色深度 16 位的图像。位数 = 1024 × 768 × 16 = 12,582,912 位。字节数 = 12,582,912 ÷ 8 = 1,572,864 B。MiB = 1,572,864 ÷ 1024 ÷ 1024 = 1.5 MiB。

Metadata (headers, palette, etc.) is ignored in most IGCSE calculations unless stated.

除非题目说明,IGCSE 计算通常忽略元数据(文件头、调色板等)。


7. File Size: Audio | 文件大小:音频

Sound file size is determined by sample rate (Hz), sample resolution (bits per sample), duration (seconds), and number of channels (mono =1, stereo =2).

声音文件大小由采样率(Hz)、采样分辨率(每个样本位数)、时长(秒)和声道数(单声道=1,立体声=2)决定。

Audio file size (bits) = sample rate × sample resolution × duration × channels. Then convert to bytes and larger units.

音频文件大小(位)= 采样率 × 采样分辨率 × 时长 × 声道数。然后转换为字节及更大单位。

Calculate the size of a 30‑second stereo recording at 44.1 kHz with 16‑bit resolution. Bits = 44100 × 16 × 30 × 2 = 42,336,000 bits. Bytes = 42,336,000 ÷ 8 = 5,292,000 B. MiB ≈ 5,292,000 ÷ 1024 ÷ 1024 ≈ 5.047 MiB.

计算一段 30 秒立体声录音的大小,采样率 44.1 kHz,分辨率 16 位。位数 = 44100 × 16 × 30 × 2 = 42,336,000 位。字节 = 42,336,000 ÷ 8 = 5,292,000 B。MiB ≈ 5,292,000 ÷ 1024 ÷ 1024 ≈ 5.047 MiB。

Lossy compression like MP3 drastically reduces file size but may affect quality; calculations here assume uncompressed audio (e.g. WAV).

如 MP3 等有损压缩大幅减少文件大小但可能影响质量;此处计算假设为未压缩音频(如 WAV)。


8. Data Transmission Time | 数据传输时间

Transmission time = amount of data ÷ transfer rate. Ensure units match: data in bits (or bytes) and rate in bits per second (bps) or bytes per second.

传输时间 = 数据量 ÷ 传输速率。确保单位统一:数据以位(或字节)计,速率以 bps 或字节每秒计。

Common rates: dial‑up 56 kbps, broadband 10 Mbps, 100 Mbps, etc. 1 kbps = 1000 bps (standard for networking in IGCSE).

常见速率:拨号 56 kbps,宽带 10 Mbps、100 Mbps 等。1 kbps = 1000 bps(IGCSE 网络标准)。

A 4 MiB file is to be transmitted over a 2 Mbps connection. Convert file: 4 MiB = 4 × 1024 × 1024 × 8 bits = 33,554,432 bits. Rate: 2 Mbps = 2,000,000 bps. Time = 33,554,432 ÷ 2,000,000 ≈ 16.78 seconds. Include overhead if specified.

传输一个 4 MiB 文件,连接速率为 2 Mbps。文件大小:4 × 1024 × 1024 × 8 = 33,554,432 位。速率:2,000,000 bps。时间 ≈ 33,554,432 ÷ 2,000,000 = 16.78 秒。若题目指明需考虑开销则计入。

For download tests, always convert file size to bits before dividing by rate in bps.

下载时间计算,务必先将文件大小转为位,再除以 bps 速率。


9. Compression Ratio | 压缩比

Compression ratio = uncompressed size ÷ compressed size. It shows how much the data has been reduced. A ratio of 4:1 means the compressed file is one quarter the original.

压缩比 = 未压缩大小 ÷ 压缩后大小。表示数据压缩的程度。4:1 表示压缩文件是原文件的四分之一。

An uncompressed file is 800 KiB, compressed it becomes 200 KiB. Ratio = 800 ÷ 200 = 4, written as 4:1.

未压缩文件 800 KiB,压缩后 200 KiB。比值 = 800 ÷ 200 = 4,写作 4:1。

Percentage reduction = (original – compressed) ÷ original × 100%. Here, (800‑200) ÷ 800 = 0.75 → 75% reduction.

减少百分比 = (原大小 – 压缩后大小) ÷ 原大小 × 100%。此处 (800‑200) ÷ 800 = 0.75,即减少 75%。

Lossless compression reduces file size without data loss (e.g. PNG, ZIP). Lossy compression achieves higher ratios by discarding less‑important data (e.g. JPEG, MP3).

无损压缩在不丢失数据的前提下减小文件(如 PNG、ZIP)。有损压缩通过丢弃次要数据获得更高压缩比(如 JPEG、MP3)。


10. Hexadecimal & Binary Codes | 十六进制与二进制编码

Hexadecimal is widely used to represent binary values compactly, for example in colour codes (HTML #RRGGBB), memory addresses, and MAC addresses. Each pair of hex digits represents one byte.

十六进制常用于紧凑表示二进制值,例如颜色代码(HTML #RRGGBB)、内存地址和 MAC 地址。每两位十六进制代表一个字节。

Colour code #A2F07B: A2 (red) = 162, F0 (green) = 240, 7B (blue) = 123. Convert each to 8‑bit binary: A2 → 1010 0010, F0 → 1111 0000, 7B → 0111 1011. Together: 101000101111000001111011.

颜色代码 #A2F07B:A2 (红)=162,F0 (绿)=240,7B (蓝)=123。分别转换为 8 位二进制:A2 → 1010 0010,F0 → 1111 0000,7B → 0111 1011。组合起来:101000101111000001111011。

Given a MAC address 00:1A:2B:3C:4D:5E, each hex pair is one octet. 00 = 0000 0000, 1A = 0001 1010, etc. Hex string length is 6 bytes = 48 bits.

给定 MAC 地址 00:1A:2B:3C:4D:5E,每对十六进制为一个八位组。00 = 0000 0000,1A = 0001 1010 等。十六进制串长 6 字节 = 48 位。

Exam questions often require converting between binary, denary, and hex for such codes.

考题时常要求对这些编码进行二进制、十进制和十六进制转换。


11. Exam-style Mixed Problems | 考试风格混合题型

Real IGCSE papers combine multiple concepts in one question. A problem may ask for file size, then transmission time, then compression ratio. Practice linking calculations.

实际 IGCSE 试卷常将多个概念融合于一道题中。可能先求文件大小,再算传输时间,最后压缩比。需练习串联计算。

Example: A 24‑bit colour image of 2048 × 1536 pixels. (a) Calculate file size in MiB. (b) How long to transfer over a 100 Mbps connection? (c) If compressed to 500 KiB, find the compression ratio and percentage reduction.

例题:一张 24 位彩色图像,分辨率 2048 × 1536 像素。(a) 计算文件大小(MiB)。(b) 以 100 Mbps 连接传输需时多少?(c) 若压缩至 500 KiB,求压缩比和减小百分比。

Solution: (a) bits = 2048 × 1536 × 24 = 75,497,472 bits; bytes = 9,437,184 B; MiB = 9,437,184 ÷ 1024² = 9 MiB exactly. (b) Convert file to bits: 9 × 1024 × 1024 × 8 = 75,497,472 bits; rate = 100,000,000 bps; time = 75,497,472 ÷ 100,000,000 = 0.755 s (approx). (c) Original size = 9 MiB = 9216 KiB; ratio = 9216 ÷ 500 = 18.432:1; reduction = (9216‑500) ÷ 9216 × 100% ≈ 94.6%.

解答:(a) 位数 = 2048 × 1536 × 24 = 75,497,472 位;字节 = 9,437,184 B;MiB = 9,437,184 ÷ 1024² = 恰好 9 MiB。(b) 文件转为位:9 × 1024 × 1024 × 8 = 75,497,472 位;速率 = 100,000,000 bps;时间 = 75,497,472 ÷ 100,000,000 ≈ 0.755 秒。(c) 原大小 = 9 MiB = 9216 KiB;压缩比 = 9216 ÷ 500 = 18.432:1;减少百分比 = (9216‑500) ÷ 9216 × 100% ≈ 94.6%。

Always show steps, keep the units consistent, and check if the question asks for rounding or a specific unit.

务必展示步骤,保持单位一致,并检查题目是否要求四舍五入或特定单位。

Published by TutorHao | Computer Science Revision Series | aleveler.com

更多咨询请联系16621398022(同微信)

Comments

屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from aleveler.com

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version