📚 IGCSE CIE Computer Science: Calculation Practice | IGCSE CIE 计算机科学:计算题专项训练
This article delivers a focused collection of calculation-based questions commonly examined in IGCSE CIE Computer Science. Each section pairs an English explanation with its Chinese equivalent, covering text file sizing, image and sound storage, unit conversions, number systems, binary arithmetic, logic circuits, compression ratios, transmission time, and checksums. Work through these examples systematically to build accuracy and confidence before the exam.
本文针对 IGCSE CIE 计算机科学考试中反复出现的计算题进行专项梳理。每个小节均采用英中双语对照讲解,涵盖文本文件大小、图像与声音存储、单位换算、数制转换、二进制运算、逻辑电路、压缩比、传输时间和校验和等必考题型。通过系统训练这些典型算例,可以帮助你在考前有效提升解题准确度与速度。
1. File Size of Text and Data | 文本与数据的文件大小
Text file size depends on the character encoding standard. With extended ASCII (8 bits per character), a document containing 2,400 characters uses 2,400 × 8 = 19,200 bits. Divide by 8 to obtain the size in bytes: 19,200 ÷ 8 = 2,400 bytes. If Unicode (UTF-16, 16 bits per character) were used, the same document would require 2,400 × 16 = 38,400 bits, i.e. 4,800 bytes. IGCSE questions often ask you to determine the number of characters that can be stored given a fixed capacity, e.g. a 2 KiB text file using 8-bit encoding can hold 2 × 1024 = 2,048 characters.
文本文件大小取决于字符编码标准。若使用扩展 ASCII(每字符 8 位),包含 2 400 个字符的文档需要 2 400 × 8 = 19 200 位。除以 8 得到字节数:19 200 ÷ 8 = 2 400 字节。若采用 Unicode(UTF-16,每字符 16 位),同一文档则需要 2 400 × 16 = 38 400 位,即 4 800 字节。IGCSE 题目常要求根据给定容量反推可存储的字符数,例如一个 2 KiB 的文本文件使用 8 位编码,可容纳 2 × 1024 = 2 048 个字符。
2. Image File Size Calculations | 图像文件大小计算
The fundamental formula is: image file size (bits) = width (px) × height (px) × colour depth (bits per pixel). For example, a 1920 × 1080 image with 24-bit colour yields 1920 × 1080 = 2,073,600 pixels, then 2,073,600 × 24 = 49,766,400 bits. Convert this to megabytes: divide by 8 to get 6,220,800 bytes, then divide by 1024² to obtain approximately 5.93 MiB. If the colour depth drops to 8 bits (indexed colour), the same resolution requires only 1920 × 1080 × 8 = 16,588,800 bits ≈ 1.98 MiB, showing the dramatic impact of colour depth on storage.
核心公式为:图像文件大小(位)= 宽 (px) × 高 (px) × 色彩深度(每像素位数)。例如一张 1920 × 1080、24 位真彩色的图像,像素数为 1920 × 1080 = 2 073 600,再乘以 24 得到 49 766 400 位。转换为兆字节:先除以 8 得 6 220 800 字节,再除以 1024² 约等于 5.93 MiB。若将色彩深度降为 8 位(索引色),同样分辨率仅需 1920 × 1080 × 8 = 16 588 800 位 ≈ 1.98 MiB,足见色彩深度对存储量的巨大影响。
When a question provides the resolution in megapixels and the colour depth separately, still multiply all three factors. Remember that 1 megapixel = 1,000,000 pixels. Hence a 12 MP photo with 12-bit colour depth uses 12,000,000 × 12 = 144,000,000 bits. Converting to bytes: 144,000,000 ÷ 8 = 18,000,000 bytes (18 MB). Always check whether the exam expects decimal megabytes (1 MB = 1,000,000 bytes) or binary mebibytes (1 MiB = 1,048,576 bytes); the IGCSE syllabus commonly uses the binary definition for storage.
当题目分别给出百万像素数和色彩深度时,同样将三者相乘。注意 1 百万像素 = 1 000 000 像素。因此一张 12 MP、12 位色彩深度的照片需要使用 12 000 000 × 12 = 144 000 000 位。转换为字节:144 000 000 ÷ 8 = 18 000 000 字节(18 MB)。务必核对试题是采用十进制兆字节(1 MB = 1 000 000 字节)还是二进制兆字节(1 MiB = 1 048 576 字节);IGCSE 大纲在存储相关题目中通常使用二进制定义。
3. Sound File Size Calculations | 声音文件大小计算
Sound file size (bits) = sample rate (Hz) × bit depth × duration (seconds) × number of channels. For a 3‑minute stereo track sampled at 44.1 kHz with 16‑bit resolution, first convert minutes to seconds: 3 × 60 = 180 s. Sample rate: 44.1 kHz = 44,100 Hz. Calculation: 44,100 × 16 × 180 × 2 = 44,100 × 16 = 705,600; 705,600 × 180 = 126,008,000; finally 126,008,000 × 2 = 252,016,000 bits. In bytes: 252,016,000 ÷ 8 = 31,502,000 B. Divide by 1024² to reach approximately 30.04 MiB. Mono recordings halve the size because only one channel is used.
声音文件大小(位)= 采样率 (Hz) × 采样精度 (bit) × 时长 (s) × 声道数。一段 3 分钟的立体声、采样率 44.1 kHz、16 位精度的音频:先将分钟转换为秒,3 × 60 = 180 s。采样率 44.1 kHz = 44 100 Hz。计算过程:44 100 × 16 × 180 × 2 = 44 100 × 16 = 705 600;705 600 × 180 = 126 008 000;最后 126 008 000 × 2 = 252 016 000 位。换算为字节:252 016 000 ÷ 8 = 31 502 000 B。再除以 1024² 约等于 30.04 MiB。单声道录音由于只有一个声道,文件大小减半。
Examination questions sometimes present a table of recording parameters and ask for the file size. Keep the unit conversion steps clear: bits → bytes ÷ 8; bytes → kilobytes ÷ 1024; kilobytes → megabytes ÷ 1024. When the sample rate is given in kHz, multiply by 1,000 without fail. Also watch out for ‘minutes’ that must always become seconds before multiplication.
考试中有时会以表格形式给出录音参数并要求计算文件大小。务必理清单位转换路径:位 → 字节 ÷ 8;字节 → 千字节 ÷ 1024;千字节 → 兆字节 ÷ 1024。当采样率以 kHz 给出时,务必乘以 1 000 转为 Hz。还要特别注意“分钟”必须先转换为秒才能参与乘法运算。
4. Data Storage Unit Conversions | 数据存储单位转换
IGCSE candidates must comfortably move between bits, bytes, kibibytes (KiB), mebibytes (MiB), gibibytes (GiB) and tebibytes (TiB). The exam uses binary prefixes: 1 KiB = 2¹⁰ bytes = 1024 B; 1 MiB = 2²⁰ bytes = 1,048,576 B; 1 GiB = 2³⁰ bytes; 1 TiB = 2⁴⁰ bytes. To convert 5 MiB into bits: 5 × 1,048,576 = 5,242,880 B, then × 8 = 41,943,040 bits. Another common task: express 200,000 bits in KiB. Divide by 8 to get 25,000 B, then ÷ 1024 ≈ 24.4 KiB.
IGCSE 考生需熟练在位 (bit)、字节 (B)、千字节 (KiB)、兆字节 (MiB)、吉字节 (GiB) 和太字节 (TiB) 之间进行转换。考试采用二进制前缀:1 KiB = 2¹⁰ 字节 = 1024 B;1 MiB = 2²⁰ 字节 = 1 048 576 B;1 GiB = 2³⁰ 字节;1 TiB = 2⁴⁰ 字节。将 5 MiB 转换为位:5 × 1 048 576 = 5 242 880 B,再 × 8 = 41 943 040 位。另一常见题型:将 200 000 位表示为 KiB。先 ÷ 8 得 25 000 B,再 ÷ 1024 ≈ 24.4 KiB。
When dealing with transmission speeds, the syllabus often switches to decimal units where 1 kbps = 1000 bps, 1 Mbps = 1,000,000 bps. This distinction is vital: storage capacity uses binary, data transfer uses decimal. A question might ask how many 4 KiB files can be stored on a 16 MiB USB drive. Convert both to the same unit: 16 MiB = 16 × 1024 = 16,384 KiB; number of files = 16,384 ÷ 4 = 4,096.
涉及传输速率时,大纲常改用十进制单位,即 1 kbps = 1000 bps,1 Mbps = 1 000 000 bps。这一区别至关重要:存储容量用二进制,数据传输用十进制。题目可能问:一个 16 MiB 的 U 盘可存放多少个 4 KiB 的文件?统一单位:16 MiB = 16 × 1024 = 16 384 KiB;文件数 = 16 384 ÷ 4 = 4 096 个。
5. Binary and Hexadecimal Conversions | 二进制与十六进制转换
To convert the binary byte 11011010 into hexadecimal, split it into two nibbles: 1101 and 1010. The left nibble 1101 equals decimal 13 = D, the right nibble 1010 equals decimal 10 = A. Therefore the hex value is DA. For the reverse, hex 7E: 7 is 0111, E is 1110, giving binary 01111110. Convert hex B2 to decimal: B = 11, so (11 × 16) + 2 = 176 + 2 = 178. These conversions are tested frequently, sometimes in conjunction with binary addition or logical shifts.
将二进制字节 11011010 转为十六进制时,先拆分为两个半字节:1101 和 1010。左半字节 1101 对应十进制 13 = D,右半字节 1010 对应 10 = A,故十六进制为 DA。反向转换:十六进制 7E,7 对应 0111,E 对应 1110,得二进制 01111110。将十六进制 B2 转为十进制:B = 11,(11 × 16) + 2 = 176 + 2 = 178。此类转换频繁出现,常与二进制加法或逻辑移位结合考查。
Another typical task: determine the smallest number of bits needed to represent the hex value FFF. FFF₁₆ = 4095₁₀. In binary, 4095 requires 12 bits because 2¹² = 4096, so the range 0–4095 fits into 12 bits. Equally, students may be asked to write the 8-bit two’s complement of a negative denary number: for –23, first write +23 in 8-bit binary (00010111), invert to 11101000 and add 1, yielding 11101001.
另一典型考法:表示十六进制数 FFF 最少需要几位?FFF₁₆ = 4095₁₀。二进制中 4095 需要 12 位,因为 2¹² = 4096,范围 0~4095 正好用足 12 位。同样,考生也可能需要写出一个负数十进制数的 8 位二进制补码:如 –23,先写出 +23 的 8 位二进制 (00010111),取反得 11101000 再加 1,结果为 11101001。
6. Binary Addition and Overflow | 二进制加法与溢出
Perform binary addition column‑by‑column, carrying a 1 whenever the sum reaches 2. For example, 1011 (11) + 0110 (6): starting from the right, 1+0 = 1; next column 1+1 = 10 → write 0, carry 1; then 0+1+carry 1 = 10 → write 0, carry 1; lastly 1+0+carry 1 = 10 → result 10001. In decimal, 11+6=17, which matches. When working with a fixed number of bits (e.g. 4 bits for unsigned integers 0–15), the result 10001 requires 5 bits; the leading 1 indicates overflow. Exam questions may ask whether an overflow flag would be set in an 8‑bit register.
二进制加法需逐列相加,和达到 2 时向前进位 1。例如 1011 (11) + 0110 (6):从最右列开始,1+0 = 1;次列 1+1 = 10,写 0 进 1;第三列 0+1+进 1 = 10,写 0 进 1;最后一列 1+0+进 1 = 10,结果为 10001。用十进制检验,11+6=17,吻合。若限定为 4 位无符号整数(范围 0~15),结果 10001 需要 5 位,最高位 1 即为溢出标志。考题常会问在 8 位寄存器中溢出标志是否会置位。
Overflow detection for two’s complement signed numbers follows a rule: if the carry into the most significant bit differs from the carry out, overflow occurs. For instance, 01111111 (127) + 00000001 (1) in 8-bit two’s complement. Adding produces 10000000. The carry in to bit 7 is 1 and carry out is 0, so overflow is set, and the result incorrectly interprets as –128. Understanding this helps explain why 127+1 wraps around to –128 in 8‑bit signed storage.
在二进制补码运算中,溢出检测遵循:进入最高位的进位和从最高位输出的进位不同时发生溢出。例如 8 位补码中 01111111 (127) + 00000001 (1),相加得 10000000。进入位 7 的进位为 1,移出进位为 0,因而溢出置位,结果错误解读为 –128。理解这一点有助于明白为何 8 位有符号存储中 127+1 会环绕为 –128。
7. Logic Gate Calculations | 逻辑门计算
Given a logic circuit diagram, calculation tasks include completing a truth table for all input combinations and deducing the output for a specific input. Consider a circuit: A AND B feed into an OR gate together with C. The Boolean expression is Q = (A AND B) OR C. With A=1, B=0, C=0, the AND outputs 0, OR with 0 gives 0. With A=1, B=1, C=0, AND outputs 1, OR gives 1. Systematically stepping through the circuit ensures no gate is missed.
给定逻辑电路图后,计算任务包括补全所有输入组合的真值表,或推求特定输入下的输出。例如电路:A 和 B 先经过与门,再和 C 一起进入或门。布尔表达式为 Q = (A AND B) OR C。当 A=1, B=0, C=0 时,与门输出 0,或门最终为 0;当 A=1, B=1, C=0 时,与门输出 1,或门输出 1。只要按信号流通路径逐级推演,就不会遗漏任何门。
NAND and NOR gate combinations are particularly common. Two NAND gates can create an AND function: connect input A and B to NAND1, producing NOT (A AND B); feed that output to both inputs of a second NAND, giving NOT (NOT (A AND B)) = A AND B. Calculating intermediate values in a truth table helps verify the equivalence. In exams, you might be given a partially completed truth table and asked to fill the missing rows.
与非门和或非门的组合尤为常见。两个与非门可实现与门功能:将输入 A、B 接至第一个与非门,输出 NOT (A AND B);再将此输出同时送入第二个与非门的两个输入端,得到 NOT (NOT (A AND B)) = A AND B。在真值表中计算中间值有助于验证这种等价关系。考试中可能给出部分完成的真值表,要求你补全缺失的行。
8. Compression Ratio | 压缩比计算
Compression ratio compares the original file size to the compressed size. Original size = 50 MiB, compressed = 10 MiB, ratio = 50:10 = 5:1. Alternatively, it can be expressed as a percentage savings: ((original – compressed) ÷ original) × 100% = (40 ÷ 50) × 100% = 80% reduction. The IGCSE syllabus expects you to calculate either the ratio or the percentage reduction from given data. Always keep the units consistent before calculating.
压缩比是原始文件大小与压缩后大小的比较。原始文件 50 MiB,压缩后 10 MiB,压缩比为 50:10 = 5:1。也可表示为节省百分比:((原始 – 压缩) ÷ 原始) × 100% = (40 ÷ 50) × 100% = 80% 的缩减。IGCSE 大纲要求能根据给定数据计算比值或缩减百分比。计算前务必统一单位。
A useful extension
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课程辅导,国外大学本科硕士研究生博士课程论文辅导