📚 Common Mistake Questions in IGCSE Edexcel Computer Science | IGCSE Edexcel 计算机:易错题精讲
In IGCSE Edexcel Computer Science, certain topics consistently trip up students, leading to avoidable mistakes in exams. This article walks you through the most common pitfalls, explains the correct reasoning, and provides tips to help you avoid losing marks. Each section focuses on a specific type of question, showing both the wrong approach and the right way to answer it.
在 IGCSE Edexcel 计算机科学考试中,有一些主题经常让学生犯错,导致不必要的失分。本文带你逐一分析最常见的易错点,解释正确的解题思路,并提供技巧帮助你避免失分。每一节重点讲解一种易错题型,展示错误做法和正确答案的对比。
1. Binary to Hexadecimal Conversion and Overflow Errors | 二进制与十六进制转换及溢出错误
A common error occurs when students convert more than 8 bits to hexadecimal without padding. For example, converting the binary number 1111011 to hex requires grouping from the right in nibbles, so it becomes 0111 1011, which is 7B. Leaving out the leading zero leads to incorrect grouping and a wrong answer. Overflow in binary addition is another pitfall: if you add two 8-bit numbers and the result requires 9 bits, the 9th bit is overflow, not a carry to be ignored in the result. The sum is truncated to 8 bits and the overflow flag is set.
常见的错误发生在学生把超过8位的二进制数转换为十六进制时没有补足位数。例如,把二进制数 1111011 转换为十六进制时,需要从右向左每4位一组,因此补为 0111 1011,即 7B。如果漏掉前导零,分组就会出错,导致答案错误。二进制加法中的溢出是另一个易错点:如果你将两个8位数相加,结果需要9位,第9位就是溢出,而不是结果中可以忽略的进位。最终的和被截断为8位,并设置溢出标志。
Another mistake is confusing hexadecimal digits with decimal values, such as treating A as 11 or 12. Always remember: A=10, B=11, C=12, D=13, E=14, F=15. When converting hex to binary, write each hex digit as a 4-bit group, even for leading zeros.
另一个错误是把十六进制数字与十进制值混淆,例如把A当成11或12。一定要记住:A=10, B=11, C=12, D=13, E=14, F=15。将十六进制转换为二进制时,每个十六进制数字写成4位二进制,即使是前导零也要写出来。
- Common Mistake: Grouping 1111011 as 1111 011 → F3. | 常见错误:将 1111011 分为 1111 011 → F3。
- Correct: 0111 1011 → 7B. | 正确做法:0111 1011 → 7B。
- Overflow: 11001100 + 10101010 = (1)01110110 → overflow, result 01110110. | 溢出:11001100 + 10101010 = (1)01110110 → 溢出,结果为 01110110。
2. Logic Gate Combinations: NAND and NOR Misunderstandings | 逻辑门组合:NAND和NOR的误解
Students often memorise truth tables for individual gates but struggle when gates are combined. A typical error is to apply the AND operation to a NAND gate’s output incorrectly. For NAND, remember it is NOT AND: output is 1 except when all inputs are 1. So a NAND followed by a NOT is just an AND gate, but many invert twice unnecessarily. Another mistake is treating NOR as an OR gate followed by an amplifier. NOR output is 1 only when all inputs are 0. In a circuit with both AND and NAND gates, trace each gate separately, annotating intermediate outputs.
学生通常会背诵单个门的真值表,但在组合门电路中就容易出错。一个典型错误是把与非门的输出当成与门那样处理。对于与非门,记住它是非与:只有当所有输入都为1时输出才为0,其余情况输出1。所以一个与非门后面接一个非门,实际上就是一个与门,但许多人会进行不必要的两次取反。另一个错误是把或非门当成或门加放大器。或非门仅在所有输入都为0时输出1。在处理既有与门又有与非门的电路中,要逐个追踪每个门,标注中间输出。
Example: Inputs A=0, B=1 to a NAND gate outputs 1. Then that 1 goes to an AND gate with C=1. The final output is 1 AND 1 = 1. If you mistakenly thought NAND output was 0, the final answer would be wrong. Always complete truth tables column by column.
例如:输入 A=0, B=1 到与非门,输出为1。然后这个1与 C=1 进入与门,最终输出为 1 AND 1 = 1。如果你错误地认为与非门输出为0,最终答案就会错。一定要逐列完成真值表。
| A | B | NAND (A,B) | C | AND(NAND,C) |
|---|---|---|---|---|
| 0 | 1 | 1 | 1 | 1 |
3. Tracing Pseudocode with Nested Loops | 追踪嵌套循环的伪代码
A very common mistake in algorithm questions is miscounting the number of iterations in nested loops. If an outer loop runs 3 times and the inner loop runs 4 times, the inner code executes 3 × 4 = 12 times. Students often multiply incorrectly or forget that the inner loop resets for each outer iteration. Another error is updating a variable inside a loop and assuming it accumulates only once per outer cycle. Trace tables must be filled row by row, with each row representing one execution of the loop body.
在算法题中,一个非常常见的错误是嵌套循环的迭代次数计数错误。如果外层循环执行3次,内层循环执行4次,那么内部代码执行 3 × 4 = 12 次。学生经常乘错,或者忘记内层循环在外层每次迭代时都会重新开始。另一个错误是在循环内更新变量,却假设它每个外层周期只累加一次。跟踪表必须逐行填写,每一行代表循环体的一次执行。
Example: FOR i = 1 TO 2, FOR j = 1 TO 3, total = total + 1. Trace table should show i=1, j=1 → total+1; i=1, j=2 → total+1; i=1, j=3 → total+1; i=2, j=1 → total+1; etc. Total increments 6 times. A common mistake is writing i=1, j=1,2,3 in one row and adding only 1 to total, forgetting that each j value is a separate step.
例如:FOR i = 1 TO 2, FOR j = 1 TO 3, total = total + 1。跟踪表应该显示:i=1, j=1 → total+1; i=1, j=2 → total+1; i=1, j=3 → total+1; i=2, j=1 → total+1 等。total 总共增加6次。常见错误是把 i=1, j=1,2,3 写在一行,只给 total 加1,忘记了每个 j 值都是独立的步骤。
4. Array Indexing: 0-based vs 1-based | 数组索引:从0开始还是从1开始
IGCSE pseudocode may use either 0-based or 1-based indexing depending on the question. Students often assume arrays always start at 0, but many exam questions use 1-based indexing (e.g., array[1] to array[5]). A typical error is to reference array[0] when the valid indices are 1 to n. In binary search or linear search, using the wrong low/high boundary leads to index out of bounds or infinite loops. Read the question carefully; if it says ‘a one-dimensional array StudentName[5]’, indices are 1,2,3,4,5 unless stated otherwise.
IGCSE 伪代码可能会根据题目要求使用从0开始的索引或从1开始的索引。学生经常假设数组总是从0开始,但很多考试题目使用从1开始的索引(例如 array[1] 到 array[5])。一个典型错误是当有效索引为 1 到 n 时,却引用了 array[0]。在二分查找或线性查找中,使用了错误的低/高边界会导致索引越界或无限循环。仔细阅读题目:如果它写着“一个一维数组 StudentName[5]”,那么索引是 1,2,3,4,5,除非有特别说明。
When tracing an algorithm that uses array positions, always note the index origin. If a loop says FOR k = 0 TO 4, the array must support index 0. But if the array is declared as array[5], it might cause an error. Many students lose marks by assuming and not checking.
当追踪使用数组位置的算法时,一定要标明索引的起始值。如果循环写成 FOR k = 0 TO 4,数组必须支持索引0。但如果数组声明为 array[5],就可能出错。许多学生因为假设而没有检查而丢分。
5. Network Protocols: TCP/IP Layers and Their Functions | 网络协议:TCP/IP层次及其功能
Confusing the responsibilities of each TCP/IP layer is a frequent mistake. The four layers are Application, Transport, Internet, and Link (or Network Access). Students often mix up which layer handles IP addressing and which handles port numbers. IP addressing and routing belong to the Internet layer; error checking and port-based delivery belong to Transport layer (TCP/UDP). A common error is saying that TCP provides encryption – it does not; TLS/SSL operate above the Transport layer.
混淆 TCP/IP 各层的职责是一个常见错误。四层分别是应用层、传输层、互联网层和链路层(或网络接入层)。学生经常搞混哪一层处理 IP 地址,哪一层处理端口号。IP 寻址和路由属于互联网层;错误检查和基于端口的传输属于传输层(TCP/UDP)。常犯的错误是说 TCP 提供加密——其实它不提供;TLS/SSL 在传输层之上运作。
- Application Layer: HTTP, FTP, SMTP, DNS – user-facing services. | 应用层:HTTP、FTP、SMTP、DNS——面向用户的服务。
- Transport Layer: TCP (reliable, connection-oriented) and UDP (fast, connectionless). Provides port numbers. | 传输层:TCP(可靠、面向连接)和 UDP(快速、无连接)。提供端口号。
- Internet Layer: IP – logical addressing and routing. | 互联网层:IP——逻辑寻址和路由。
- Link Layer: MAC addresses, switches, Ethernet. | 链路层:MAC 地址、交换机、以太网。
Questions often ask: ‘Which layer does a router operate at?’ Answer: Internet layer (IP). A switch operates at Link layer. Getting these swapped is a classic mistake.
题目经常问:“路由器工作在哪一层?”答案是互联网层(IP)。交换机工作在链路层。把这两个交换是经典错误。
6. Encryption: Symmetric vs Asymmetric Keys | 加密:对称密钥与非对称密钥
Students often get tripped up on which key is used for encryption and decryption in asymmetric encryption. In symmetric encryption, the same secret key encrypts and decrypts—fast but key distribution is a problem. In asymmetric (public-key) encryption, the sender encrypts with the recipient’s public key, and the recipient decrypts with their private key. A common mistake is saying the sender encrypts with their own private key; that would be for digital signatures, not confidentiality. Another error is thinking asymmetric is always slower—it is, but the question might ask why it is used alongside symmetric (hybrid: asymmetric to exchange symmetric key).
学生经常在非对称加密中使用哪个密钥进行加密和解密的问题上出错。在对称加密中,同一个秘密密钥用于加密和解密——速度快,但密钥分发是问题。在非对称(公钥)加密中,发送方用接收方的公钥加密,接收方用自己的私钥解密。常见错误是说发送方用自己的私钥加密——那是用于数字签名,而不是机密性。另一个错误是认为非对称加密总是慢——确实慢,但题目可能问为什么它与对称加密一起使用(混合:用非对称加密交换对称密钥)。
When describing digital signatures, it’s the opposite: sender encrypts (signs) with their own private key, receiver decrypts with sender’s public key. Mixing these scenarios costs marks.
当描述数字签名时,则相反:发送方用自己的私钥加密(签名),接收方用发送方的公钥解密。混淆这些场景会失分。
7. Sorting Algorithms: Bubble Sort Passes and Swaps | 排序算法:冒泡排序的趟数和交换次数
Bubble sort questions frequently ask for the number of passes or comparisons. A list of n items requires a maximum of n-1 passes, and each pass does n-1 comparisons if not optimised. Students often write n passes or forget that after the first pass the largest element is in its final position. When tracing a bubble sort, if the list becomes sorted before the maximum number of passes, the algorithm can stop early if a ‘no swap’ flag is used. Many students continue the passes unnecessarily and then miscount swaps.
冒泡排序题经常要求回答趟数或比较次数。有 n 个元素的列表最多需要 n-1 趟,如果没有优化,每趟进行 n-1 次比较。学生经常写成 n 趟,或者忘记第一趟后最大元素就已经在最终位置。当追踪冒泡排序时,如果列表在最大趟数之前就已经排好序,若使用了“无交换”标志,算法可以提前停止。许多学生不必要地继续执行趟数,然后算错交换次数。
Example: Sort [5, 2, 4, 1] using bubble sort.
Pass 1: 5,2 → swap → 2,5,4,1; 5,4 → swap → 2,4,5,1; 5,1 → swap → 2,4,1,5. 3 comparisons, 3 swaps.
Pass 2: 2,4 (no swap); 4,1 → swap → 2,1,4,5; 4,5 (no). 3 comparisons, 1 swap.
Pass 3: 2,1 → swap → 1,2,4,5; 2,4 (no); 4,5 (no). 3 comp, 1 swap. Sorted in 3 passes. Total comparisons 9, total swaps 5. Not 4 passes.
例如:对 [5, 2, 4, 1] 使用冒泡排序。
第一趟:5,2 → 交换 → 2,5,4,1;5,4 → 交换 → 2,4,5,1;5,1 → 交换 → 2,4,1,5。3次比较,3次交换。
第二趟:2,4(无交换);4,1 → 交换 → 2,1,4,5;4,5(无)。3次比较,1次交换。
第三趟:2,1 → 交换 → 1,2,4,5;2,4(无);4,5(无)。3次比较,1次交换。3趟排好。总共比较9次,交换5次。不是4趟。
8. Error Types: Syntax vs Logic vs Runtime | 错误类型:语法错误、逻辑错误和运行时错误
Edexcel exams love to ask about error types, and students often confuse logical errors with runtime errors. A syntax error is a mistake in the language rules (e.g., missing colon, misspelled keyword) that prevents compilation/translation. A logic error is when the program runs but produces wrong results (e.g., using < instead of > in a condition). A runtime error occurs during execution and causes the program to crash (e.g., division by zero, stack overflow). Many students wrongly classify a logic error as a syntax error because they see an unexpected output.
Edexcel 考试喜欢考错误类型,学生经常把逻辑错误和运行时错误搞混。语法错误是违反语言规则的错误(如缺少冒号、关键字拼写错误),会导致无法编译/翻译。逻辑错误是程序能运行但产生错误结果(如在条件中使用 < 而不是 >)。运行时错误发生在执行过程中并导致程序崩溃(如除以零、栈溢出)。许多学生因为看到非预期的输出,就把逻辑错误错误地归类为语法错误。
Practice: “A program calculates area = length + width instead of length * width.” This is a logic error. “A program crashes because it tries to access array index 10 when size is 5.” This is a runtime error. “PRINT ‘Hello’ without closing quote.” Syntax error.
练习:“一个程序计算面积 = 长 + 宽,而不是长 × 宽。”这是逻辑错误。“程序因为试图访问索引10而崩溃,但数组大小是5。”这是运行时错误。“PRINT ‘Hello’ 缺少闭合引号。”语法错误。
9. Boolean Algebra Simplification: De Morgan’s Laws | 布尔代数简化:德摩根定律
Applying De Morgan’s laws incorrectly is one of the top algebraic mistakes. The laws state: NOT (A AND B) = (NOT A) OR (NOT B), and NOT (A OR B) = (NOT A) AND (NOT B). Students frequently forget to change the operator. So NOT (A AND B) becomes (NOT A) AND (NOT B) — this is wrong. A good trick: break the line, change the sign. For a gate-level question, a NAND gate is equivalent to AND followed by NOT, which by De Morgan is OR with inverted inputs. Many students draw an AND gate with a NOT on output and think it’s the same as NAND, but they confuse truth tables when multiple inputs come in.
错误应用德摩根定律是最常见的代数错误之一。定律是:NOT (A AND B) = (NOT A) OR (NOT B),以及 NOT (A OR B) = (NOT A) AND (NOT B)。学生经常忘记更换运算符。所以 NOT (A AND B) 变成了 (NOT A) AND (NOT B)——这是错的。好记的技巧:断开连线,更换符号。在门级问题中,与非门等价于与门后面加非门,根据德摩根定律,相当于用了反向输入的或门。许多学生画出与门并在输出端加上非门,以为这就等同于与非门,但当有多个输入时他们就搞混真值表。
Example: Simplify NOT( (NOT A) AND B ). By De Morgan: = NOT(NOT A) OR NOT B = A OR NOT B. Correct. Common wrong answer: NOT A AND NOT B.
例如:简化 NOT( (NOT A) AND B )。用德摩根定律:= NOT(NOT A) OR NOT B = A OR NOT B。正确。常见错误答案:NOT A AND NOT B。
10. SQL Queries: Misunderstanding WHERE and GROUP BY | SQL查询:误解WHERE和GROUP BY
IGCSE SQL questions often require retrieving filtered data or aggregated results. A frequent mistake is using WHERE with aggregate functions like COUNT, SUM, AVG. For example: ‘SELECT * FROM Students WHERE COUNT(Subject) > 5’ is invalid. WHERE filters rows before aggregation; you must use HAVING for conditions on aggregates. Another error is forgetting that GROUP BY groups rows with identical values in a column and then an aggregate function operates on each group. Students sometimes include non-aggregated columns in SELECT without adding them to GROUP BY, which causes an error.
IGCSE 的 SQL 题目经常要求查询过滤数据或聚合结果。一个常见错误是在 WHERE 中使用聚合函数,如 COUNT, SUM, AVG。例如:‘SELECT * FROM Students WHERE COUNT(Subject) > 5’ 是无效的。WHERE 在聚合之前过滤行;你必须使用 HAVING 来对聚合结果施加条件。另一个错误是忘记 GROUP BY 将列中相同值的行分组,然后聚合函数作用于每个组。学生有时在 SELECT 中包含非聚合列却没有将它们加入 GROUP BY,这会导致错误。
Correct form: SELECT Subject, COUNT(*) FROM Results GROUP BY Subject HAVING COUNT(*) > 5. Also, remember that = is used for exact match, and LIKE with % for pattern matching. Misusing = instead of LIKE leads to no rows returned.
正确形式:SELECT Subject, COUNT(*) FROM Results GROUP BY Subject HAVING COUNT(*) > 5。此外,记住 = 用于精确匹配,LIKE 配合 % 用于模式匹配。错误地用 = 代替 LIKE 会导致没有结果返回。
11. Binary Addition and Two’s Complement for Negative Numbers | 二进制加法与用补码表示负数
Students often miscalculate two’s complement representation. To represent -6 in 8-bit two’s complement: start with +6 = 00000110, invert bits → 11111001, add 1 → 11111010. A common mistake is forgetting to add 1 after inversion, giving 11111001, which is -7. Another error is treating the most significant bit (MSB) as a minus sign outside the calculation, leading to wrong decimal conversions. When given a two’s complement negative number like 11111010, to find its magnitude: invert → 00000101, add 1 → 00000110 = 6, so it is -6. Some students incorrectly interpret the entire binary as a large positive number.
学生经常算错补码表示。要用8位补码表示 -6:从 +6 = 00000110 开始,取反 → 11111001,加 1 → 11111010。常见错误是取反后忘记加 1,得到 11111001,那是 -7。另一个错误是把最高有效位 (MSB) 当作计算外的负号,导致十进制转换错误。当给定一个补码负数如 11111010,要求得其大小:取反 → 00000101,加 1 → 00000110 = 6,所以它是 -6。有些学生会错误地把整个二进制串解释为很大的正数。
In binary addition with two’s complement, overflow occurs when the carry into the MSB is different from the carry out of the MSB. For example, adding two positive numbers and getting a negative result indicates overflow. Many students ignore the overflow flag and report the wrong signed result.
在使用补码的二进制加法中,当进入 MSB 的进位与离开 MSB 的进位不同时,发生溢出。例如,两个正数相加得到负数结果,就表示溢出。许多学生忽略溢出标志,报告错误的有符号结果。
Example: 01100000 (+96) + 00100000 (+32) = 10000000 (-128 in two’s complement). Overflow occurred. Correct handling: overflow flag set, result invalid as signed 8-bit.
示例:01100000 (+96) + 00100000 (+32) = 10000000(补码中的 -128)。发生溢出。正确处理:溢出标志置位,作为有符号8位结果无效。
12. Hexadecimal in Colors and Memory Dumps | 十六进制在颜色及内存转储中的应用
Hex is heavily used in RGB color representation and memory dumps. A typical question gives a hex color code like #FF6A3E and asks for the intensity of red, green, and blue. Each pair represents a color: FF=red (255), 6A=green (106), 3E=blue (62). Students often misinterpret the order or forget that hex is base-16, so ‘6A’ is 6×16 + 10 = 106. Another error occurs in memory dump analysis: given a hex dump, each byte is two hex digits. If an instruction is 4 bytes, reading the wrong offset leads to incorrect opcode or operand. Always read in little-endian or big-endian as specified; IGCSE usually uses simple byte-wise left-to-right order, but confirm.
十六进制广泛用于 RGB 颜色表示和内存转储。典型题目会给出类似 #FF6A3E 的颜色代码,要求回答红、绿、蓝的强度。每两位代表一种颜色:FF=红 (255),6A=绿 (106),3E=蓝 (62)。学生经常搞错顺序,或者忘记十六进制是基16,因此 ‘6A’ 是 6×16 + 10 = 106。另一个错误发生在内存转储分析中:给定一个十六进制转储,每个字节是两位十六进制数字。如果一条指令是4字节,读错偏移量会导致错误的操作码或操作数。总是按照指定的大小端顺序读取;IGCSE 通常使用简单的从左到右逐字节顺序,但要确认。
Remember: a color code #00FF00 is pure green, not pure blue. A memory address like 0x1A3F plus offset 0x0002 gives address 0x1A41, not 0x1A3F2. Hex addition must align digits: 1A3F + 2 = 1A41.
记住:颜色代码 #00FF00 是纯绿色,不是纯蓝色。内存地址如 0x1A3F 加上偏移量 0x0002 得到地址 0x1A41,而不是 0x1A3F2。十六进制加法要对齐位数:1A3F + 2 = 1A41。
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课程辅导,国外大学本科硕士研究生博士课程论文辅导