📚 IGCSE CCEA Computer Science: Calculation Practice & Drill | IGCSE CCEA 计算机:计算题专项训练
Calculation problems form a significant part of the CCEA IGCSE Computer Science examination, testing your ability to apply numerical reasoning across topics such as number systems, logic circuits, data storage, and network performance. This article provides a structured drill, covering the most common calculation types with step-by-step worked examples and paired English-Chinese explanations. By working through these exercises, you will build both speed and accuracy – essential skills for achieving top marks in the written paper.
计算题是 CCEA IGCSE 计算机科学考试中的重要组成部分,考察你在数制、逻辑电路、数据存储和网络性能等主题中的数值推理能力。本文提供结构化专项训练,涵盖最常见的计算题型,并配有逐步示范和配对的中英文解释。通过练习这些题目,你将提升解题速度和准确性,这是笔试试卷取得高分的必备技能。
1. Binary and Denary Conversions | 二进制与十进制转换
r 01101001 has ones in the 64, 32, 8, and 1 columns, giving 64 + 32 + 8 + 1 = 105 in denary.
二进制(基数为2)与十进制(基数为10)之间的转换是核心技能。要将二进制数转换为十进制,先在每一位上方写出位权(2的幂),然后将出现1的位权相加。对于一个字节(8位),位权依次为128、64、32、16、8、4、2、1。例如,二进制数01101001在64、32、8和1位上有1,因此十进制值为64 + 32 + 8 + 1 = 105。
r1; 1 ÷ 2 = 0 r1. Reading remainders upwards gives 1101001, padded to 8 bits as 01101001.
十进制转二进制的方法是反复除以2,记录每次的余数。从下往上读取余数即得到二进制结果。例如,将105转为二进制:105 ÷ 2 = 52 余1;52 ÷ 2 = 26 余0;26 ÷ 2 = 13 余0;13 ÷ 2 = 6 余1;6 ÷ 2 = 3 余0;3 ÷ 2 = 1 余1;1 ÷ 2 = 0 余1。从下往上读余数为1101001,补齐8位为01101001。
Quick practice: Convert the denary number 218 to an 8-bit binary number. (Answer: 11011010.)
快速练习:将十进制数218转换为8位二进制数。(答案:11011010。)
2. Hexadecimal Conversions | 十六进制转换
x, split it into groups of 4 bits (nibbles) from the right, then convert each nibble to its hex equivalent. For example, 10111100 in binary splits into 1011 (B) and 1100 (C), giving BC in hex.
十六进制(基数为16)使用数字0-9和字母A-F(A=10,B=11,...,F=15)。将二进制数转换为十六进制时,从右向左每4位一组(称为半字节),然后将每组转换为对应的十六进制值。例如,二进制数10111100分为1011(B)和1100(C),得到十六进制BC。
ively, convert via binary: 2 = 0010, F = 1111, so 2F = 00101111 = 32 + 8 + 4 + 2 + 1 = 47.
将十六进制转换为十进制时,将每位十六进制数字乘以其位权(16的幂)并求和。十六进制数2F等于(2 × 16) + (15 × 1) = 32 + 15 = 47。或者通过二进制转换:2 = 0010,F = 1111,因此2F = 00101111 = 32 + 8 + 4 + 2 + 1 = 47。
Try: Convert the denary number 200 to hex. (Answer: C8, since 200 = 12 × 16 + 8.)
尝试:将十进制数200转换为十六进制。(答案:C8,因为200 = 12 × 16 + 8。)
3. Binary Addition and Overflow | 二进制加法与溢出
flow error occurs when the result of an addition exceeds the maximum value representable with the available bits. For instance, adding two 8-bit numbers may produce a 9-bit result, causing the most significant carry to be lost if only 8 bits are stored.
二进制加法遵循与十进制相同的逐列相加规则,但规则如下:0+0=0,0+1=1,1+0=1,1+1=0 进位1,1+1+1=1 进位1。当加法结果超出可用位数所能表示的最大值时,会发生溢出错误。例如,两个8位数相加可能产生9位结果,如果只存储8位,则最高进位会丢失。
+carry=0 carry 1, 1+1+carry=1 carry 1, 0+0+carry=1. The result is 11000011 (195). But wait – 195 is within 8-bit range? The maximum signed 8-bit two's complement is 127, but for unsigned it' overflow when a carry into the sign bit (bit 7) is different from the carry out of bit 7.
示例:用8位加法计算01010110(86)和01101101(109)。从右向左:0+1=1,1+0=1,1+1=0 进位1,0+1+进位=0 进位1,1+0+进位=0 进位1,0+1+进位=0 进位1,1+1+进位=1 进位1,0+0+进位=1。结果为11000011(195)。注意——195在8位范围内吗?无符号8位最大值是255,所以无溢出。但如果解释为有符号二进制补码,则结果表示负数,如果预期为正数,则发生了溢出。CCEA大纲要求你识别溢出:当进入符号位(第7位)的进位与符号位产生的进位不同时,发生溢出。
4. Binary Shifts (Multiplication and Division) | 二进制移位(乘法与除法)
, discarding any remainder (floor division). Shifting 00101100 (44) right once yields 00010110 (22).
一次逻辑左移将二进制数乘以2;每多左移一位,再乘2。右边空出的位用0填充。例如,将00001101(13)左移两位得到00110100(52),即13 × 4。逻辑右移则除以2,舍去余数(向下取整)。将00101100(44)右移一次得到00010110(22)。
Be careful with sign when using arithmetic shifts for negative numbers in two' by 8 using shifts. (Answer: 9 in binary is 00001001; left shift 3 places → 01001000 = 72.)
在处理二进制补码的负数时,需使用算术移位:算术右移保留符号位(复制最高有效位)。CCEA试卷通常只在无符号上下文中考察逻辑移位。练习:用移位法计算9乘8。(答案:9的二进制是00001001;左移3位 → 01001000 = 72。)
5. Representing Negative Numbers: Two's Complement | 负数的表示:二进制补码
CCEA expects you to represent negative integers using two's complement. To find the two's complement of a positive binary number (negate it), invert all bits (one's complement) and then add 1. For an 8-bit representation, the range is -128 to +127. The most significant bit (MSB) acts as the sign bit: 0 for positive, 1 for negative.
CCEA要求你使用二进制补码表示负整数。求正数二进制形式的负数表示(取反)时,先将所有位取反(反码),再加1。在8位表示中,范围是-128到+127。最高有效位(MSB)作为符号位:0表示正数,1表示负数。
Example: Represent -23 in 8-bit two' s 00010111. Invert bits: 11101000. Add 1: 11101001. This is -23. To convert a negative two' MSB is negative. So 11101001 = -128 + 64 + 32 + 8 + 1 = -23. Alternatively, apply the two's complement procedure again to find the positive magnitude.
示例:用8位二进制补码表示-23。首先,+23的8位二进制是00010111。取反:11101000。加1:11101001,即-23。要将负数的补码转回十进制,注意最高位的位权是负数。因此11101001 = -128 + 64 + 32 + 8 + 1 = -23。也可以再次求补码得到正数值。
Subtraction using two's complement: To calculate 54 – 27, find the two' = 1 00011011. Discard the carry-out bit; the result is 00011011 = 27 in denary. (Check: 54 – 27 = 27.)
使用补码进行减法:计算54 – 27时,先求27的补码(8位为11100101),然后与54(00110110)相加。00110110 + 11100101 = 1 00011011。丢弃进位,结果为00011011,即十进制27。(验算:54 – 27 = 27。)
6. Logic Gates and Truth Tables | 逻辑门与真值表
sion Q = NOT(A AND B) OR (B AND C) with inputs A, B, C would require evaluating each term.
逻辑门计算涉及求布尔表达式的值和完成真值表。CCEA涵盖与门(AND)、或门(OR)、非门(NOT)、与非门(NAND)、或非门(NOR)、异或门(XOR)及其组合。给定逻辑电路或表达式,你必须能够为所有输入组合确定输出。例如,表达式Q = NOT(A AND B) OR (B AND C),输入为A、B、C,需要逐项求值。
B = 0, NOT = 1; B AND C = 0; OR = 1, so Q=1. Complete the entire truth table accordingly.
步骤:(1)列出所有可能的输入组合(n个输入有2ⁿ行)。(2)计算出子表达式的中间列。(3)根据主运算符合并结果。对于n=3,有8行。当A=0,B=1,C=0时,A AND B = 0,取非 = 1;B AND C = 0;两者取或 = 1,因此Q=1。依此完成整个真值表。
7. Simplifying Logic Using Boolean Algebra | 使用布尔代数化简逻辑
CCEA may require you to simplify a Boolean expression using rules like De Morgan's laws, distribution, and absorption. For instance, simplify the expression: (A + B) • (A + C). Using distribution: A + (B • C). You should be able to apply identities such as A + 0 = A, A • 1 = A, A + A = A, A + (A • B) = A, and De Morgan: (A + B)' = A' • B'.
CCEA可能要求你使用布尔代数规则化简表达式,如德摩根定律、分配律和吸收律。例如,化简表达式:(A + B) • (A + C)。使用分配律:A + (B • C)。你应能应用恒等式,如A + 0 = A,A • 1 = A,A + A = A,A + (A • B) = A,以及德摩根定律:(A + B)' = A' • B'。
Example: Simplify (A' • B) + (A • B). This is B • (A' + A) = B • equivalent using Boolean algebra. Always double-check with a quick truth table comparison.
示例:化简 (A' • B) + (A • B)。提取B得 B • (A' + A) = B • 1 = B。典型的考试题会给出一个电路,要求用布尔代数进行化简,并用最简等效式表达。建议总是通过快速真值表对比来验证结果。
8. Data Storage Calculations: Bits, Bytes, and File Sizes | 数据存储计算:位、字节与文件大小
e calculations typically involve multiplying resolution, colour depth, frame rate, and duration.
理解数据单位至关重要。记住:1字节 = 8位;1千字节(KB)= 1000字节(在内存上下文中有时为1024,CCEA在存储中常使用1000,在RAM中使用1024)。1兆字节(MB)= 1 000 000字节;1吉字节(GB)= 1 000 000 000字节。文件大小计算通常涉及乘以分辨率、颜色深度、帧率和时长。
o audio (2 channels) at 44.1 kHz, 16-bit: size = 44 100 × 16 × (3×60) × 2 = 44 100 × 16 × 180 × 2 = 254 016 000 bits ≈ 31.75 MB.
图像大小(位)= 宽度 × 高度 × 颜色深度。一张1920×1080、24位颜色的图像:大小 = 1920 × 1080 × 24 = 49 766 400 位。转换为MB:49 766 400 ÷ 8 = 6 220 800 字节;÷ 1 000 000 ≈ 6.22 MB。声音大小:大小 = 采样率 × 位深度 × 时长(秒)× 声道数。一段3分钟立体声(2声道),44.1 kHz,16位:大小 = 44 100 × 16 × (3×60) × 2 = 44 100 × 16 × 180 × 2 = 254 016 000 位 ≈ 31.75 MB。
e for a given number of characters. A 5000-character ASCII text file is 5000 bytes ≈ 5 KB.
文本文件大小:假设使用ASCII(每字符1字节)或Unicode(每字符2字节),根据字符数估算大小。一个5000字符的ASCII文本文件大小为5000字节 ≈ 5 KB。
9. Storage Device Capacities and Transfer Speeds | 存储设备容量与传输速度
le over a 100 Mbit/s network, first convert file size to bits: 700 × 8 = 5600 Mbits. Time = 5600 Mbits ÷ 100 Mbit/s = 56 seconds. (Note: CCEA may use 1000-based units for network speeds; check paper context.)
题目可能要求计算一个设备能存储多少个指定大小的文件,或者以给定传输速度传输数据需要多长时间。务必确保单位一致。如果一个U盘容量为16 GB,每张照片4 MB,可存储照片数 = 16 × 1000 ÷ 4 = 4000 张。如果通过100 Mbit/s网络传输700 MB文件,首先将文件大小转换为位:700 × 8 = 5600 Mbits。时间 = 5600 Mbits ÷ 100 Mbit/s = 56 秒。(注意:CCEA在网络速度中可能使用基于1000的单位;根据试卷上下文确定。)
Bandwidth calculations may also require considering packet headers or protocol overhead, but IGCSE CCEA tends to keep these straightforward. Be prepared to compare transfer times for different media.
带宽计算有时需要考虑数据包头或协议开销,但IGCSE CCEA通常保持题目简洁。准备好比较不同介质的传输时间。
10. Compression Ratio Calculations | 压缩比计算
sizes. For example, a 10 MB file compressed to 2 MB has a compression ratio of 10:2 = 5:1.
压缩比定义为原始大小除以压缩后大小。5:1的压缩比表示压缩文件大小是原始文件的五分之一。题目可能要求根据给定比率计算压缩后大小,或根据大小确定比率。例如,一个10 MB的文件压缩为2 MB,压缩比为10:2 = 5:1。
Percentage reduction = (1 - compressed/original) × 100%. Using the same numbers, reduction = (1 - 2/10) × 100% = 80% compression in context, so remember which types are suitable for images, audio, and text.
缩减百分比 = (1 - 压缩后/原始) × 100%。用相同数据,缩减 = (1 - 2/10) × 100% = 80%。CCEA可能在题目背景中涉及有损压缩与无损压缩,因此记住不同类型适用于图像、音频和文本的情景。
11. IP Addressing and Subnet Mask Calculations | IP地址与子网掩码计算
hosts on such a /24 network is 2⁸ - 2 = 254 (subtracting network and broadcast addresses).
虽然IGCSE考查不多,但部分CCEA试卷包含基本的IPv4地址知识。IP地址192.168.1.10,子网掩码255.255.255.0表示网络部分是192.168.1,主机部分是.10。在这样的/24网络中,可能的主机数量为2⁸ - 2 = 254(减去网络地址和广播地址)。
mask. For instance, 192.168.1.100 AND 255.255.255.0 = 192.168.1.0. Compare with another IP's network address to see if they match.
你可能需要判断两个地址是否在同一子网中,方法是将IP地址与子网掩码进行逻辑与操作。例如,192.168.1.100 AND 255.255.255.0 = 192.168.1.0。将之与另一IP的网络地址比较即可判断。
12. Algorithm Efficiency and Basic Timing | 算法效率与基本计时
es at most log₂(1000000) ≈ 20 comparisons. Estimate time difference given processor speed.
CCEA可能包含基于算法步骤数的简单计时计算。例如,如果一个循环运行n次,每次迭代耗时0.1 ms,总时间 = n × 0.1 ms。线性搜索100万项最多需要100万次比较;二分搜索最多需要log₂(1000000) ≈ 20次比较。给定处理器速度,估算时间差。
You might also calculate the effect of caching or faster storage. Always show clear unit conversions and state assumptions. This skill ties computational thinking to numerical reasoning, a key aim of the CCEA specification.
你可能还需要计算缓存或更快存储带来的影响。务必清晰展示单位转换并说明假设。这项技能将计算思维与数值推理联系起来,是CCEA大纲的核心目标。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

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