📚 IGCSE CIE Computer Science: Detailed Solution of Typical Questions | IGCSE CIE 计算机:典型例题详解
This article presents a collection of carefully selected typical questions from the IGCSE CIE Computer Science syllabus, each accompanied by a clear, step-by-step solution. Covering topics such as data representation, logic circuits, programming concepts, databases, and networking, these worked examples will help students consolidate their understanding and practice answering examination-style questions. By studying these model solutions, learners can develop the reasoning skills needed to tackle unfamiliar problems with confidence.
本文精选了IGCSE CIE计算机科学课程中的典型例题,并为每道题提供了清晰、逐步的解答。内容涵盖数据表示、逻辑电路、编程概念、数据库和网络等主题,这些范例将帮助学生巩固理解并练习回答考试风格的题目。通过学习这些模型解答,学习者可以培养应对陌生问题所需的推理能力,从而自信地参加考试。
1. Binary to Hexadecimal Conversion | 二进制与十六进制转换
Question: Convert the 8-bit binary number 11011010 to its hexadecimal equivalent.
题目:将8位二进制数11011010转换为等值的十六进制数。
Step 1: Split the binary number into two nibbles (4 bits each) starting from the right. Here, 1101 1010.
步骤1:将二进制数从右向左拆分为两个半字节(每组4位)。此处为1101 1010。
Step 2: Convert each nibble to its decimal value. 1101₂ = 1×8 + 1×4 + 0×2 + 1×1 = 13; 1010₂ = 1×8 + 0×4 + 1×2 + 0×1 = 10.
步骤2:将每个半字节转换为十进制值。1101₂ = 1×8 + 1×4 + 0×2 + 1×1 = 13;1010₂ = 1×8 + 0×4 + 1×2 + 0×1 = 10。
Step 3: Express the decimal values in hexadecimal (10→A, 11→B, 12→C, 13→D, 14→E, 15→F). 13 = D, 10 = A.
步骤3:将十进制值用十六进制表示(10→A,11→B,12→C,13→D,14→E,15→F)。13 = D,10 = A。
Answer: The hexadecimal equivalent is DA.
答案:十六进制等值为DA。
2. Binary Addition and Overflow | 二进制加法与溢出
Question: Perform the addition of the two 8-bit binary numbers 10101101 and 01011110 using two’s complement representation. State whether an overflow occurs and explain your answer.
题目:使用二进制补码表示,将两个8位二进制数10101101和01011110相加。说明是否发生溢出并解释你的答案。
We add bit by bit from right to left, carrying over when the sum is 2 or 3. The calculation yields 1 00001011 (a 9-bit result). In 8-bit two’s complement, the leftmost 8 bits are kept, giving 00001011. Since the two operands have different sign bits (1 for negative and 0 for positive), an overflow cannot occur when adding numbers of opposite signs. Therefore, no overflow has occurred.
我们从右向左逐位相加,当和为2或3时产生进位。计算结果为1 00001011(9位结果)。在8位补码中,保留最左边8位,得到00001011。由于两个操作数的符号位不同(1表示负数,0表示正数),异号数相加不会发生溢出。因此,没有发生溢出。
3. Logic Gate Circuit and Truth Table | 逻辑门电路与真值表
Question: A logic circuit has two inputs, A and B. The output X is given by the expression (A AND B) OR (NOT A). Draw the combinational logic circuit and complete its truth table.
题目:一个逻辑电路有两个输入A和B。输出X由表达式 (A AND B) OR (NOT A) 给出。绘制该组合逻辑电路并完成其真值表。
The circuit uses an AND gate with inputs A and B, a NOT gate on A, and an OR gate taking the outputs of these two gates. The truth table can be built by evaluating all input combinations:
该电路使用一个与门(输入为A和B)、一个非门(作用于A)以及一个或门(获取这两个门的输出)。通过评估所有输入组合可以构建真值表:
| A | B | A AND B | NOT A | X |
|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 0 | 1 |
The completed truth table shows X is 1 for all input combinations except when A=1 and B=0.
完成的真值表显示,除了A=1且B=0时X为0外,其它组合X均为1。
4. Simplifying a Boolean Expression | 布尔表达式化简
Question: Simplify the Boolean expression F = A·B·C + A·B·C′ + A·B′·C using the laws of Boolean algebra. (The prime symbol ′ denotes NOT.)
题目:利用布尔代数定律化简表达式 F = A·B·C + A·B·C′ + A·B′·C。(符号′表示非。)
First, factor A·B from the first two terms: A·B·(C + C′) = A·B·1 = A·B. The expression becomes F = A·B + A·B′·C. Then factor A: A·(B + B′·C). Apply the distributive law within the parentheses: B + B′·C = (B + B′)·(B + C) = 1·(B + C) = B + C. Hence, F = A·(B + C).
首先,从前两项中提取公因子A·B:A·B·(C + C′) = A·B·1 = A·B。表达式变为 F = A·B + A·B′·C。然后提取A:A·(B + B′·C)。在括号内应用分配律:B + B′·C = (B + B′)·(B + C) = 1·(B + C) = B + C。因此,F = A·(B + C)。
The simplified expression is A AND (B OR C).
化简后的表达式为 A AND (B OR C)。
5. Pseudocode: Finding Maximum in an Array | 伪代码:查找数组中的最大值
Question: Write a pseudocode algorithm that takes an array of 10 numbers as input and outputs the largest value and its index position. If the maximum appears more than once, output the index of its first occurrence.
题目:编写一个伪代码算法,输入一个包含10个数字的数组,输出最大值及其索引位置。如果最大值出现多次,输出首次出现的索引。
Solution pseudocode:
解答伪代码:
BEGIN
DECLARE numbers : ARRAY[1:10] OF INTEGER
INPUT numbers
max ← numbers[1]
index ← 1
FOR i ← 2 TO 10
IF numbers[i] > max THEN
max ← numbers[i]
index ← i
ENDIF
ENDFOR
OUTPUT max, index
END
The algorithm iterates through the array, updating the maximum and its index whenever a larger element is found. Because it only updates when a strictly greater value is encountered, the first occurrence is recorded.
该算法遍历数组,每当发现更大的元素时便更新最大值及其索引。由于只有在遇到严格更大的值时才更新,因此记录的是首次出现的索引。
6. Flowchart for a Simple Condition | 简单条件的流程图
Question: A system checks whether a student’s test score is at least 50. If true, it outputs “Pass”; otherwise, it outputs “Fail”. Draw a flowchart to represent this decision process.
题目:一个系统检查学生的测试分数是否至少为50。如果是,输出“Pass”;否则输出“Fail”。绘制流程图表示该决策过程。
The flowchart begins with a start symbol, followed by an input/read symbol for the score. A decision diamond checks the condition score ≥ 50. The true branch leads to an output symbol showing “Pass”, while the false branch outputs “Fail”. Both branches converge to the end symbol.
流程图以开始符号开始,接着是输入/读取分数的符号。一个决策菱形检查条件 分数 ≥ 50。条件为真时导向输出“Pass”的符号,为假时输出“Fail”。两个分支汇聚到结束符号。
(Since a visual diagram cannot be displayed here, a brief textual description is provided. In exam settings, accurate use of the correct symbols – oval for start/end, parallelogram for input/output, diamond for decision, rectangle for process – is essential.)
(由于这里无法展示可视化图形,给出简要文字描述。在考试中,准确使用正确的符号至关重要——开始/结束用椭圆形,输入/输出用平行四边形,判断用菱形,处理用矩形。)
7. Database: SQL Query with Criteria | 数据库:带条件的SQL查询
Question: A table named STUDENTS has fields StudentID, Name, Form, and Grade. Write an SQL statement to display the Name and Grade of all students in Form ’10A’ who have a Grade higher than 80. Sort the results by Grade in descending order.
题目:一个名为STUDENTS的表包含字段StudentID、Name、Form和Grade。编写一条SQL语句,显示Form为“10A”且Grade大于80的所有学生的Name和Grade。查询结果按Grade降序排列。
The required SQL query uses SELECT, FROM, WHERE, and ORDER BY clauses. It is:
所需的SQL查询使用SELECT、FROM、WHERE和ORDER BY子句。如下:
SELECT Name, Grade FROM STUDENTS WHERE Form = ’10A’ AND Grade > 80 ORDER BY Grade DESC;
This command selects the two specified columns, filters rows satisfying both conditions, and sorts the output highest grade first.
该命令选择指定的两列,筛选出同时满足两个条件的行,并将输出按Grade降序排列。
8. Data Storage: Calculating File Size | 数据存储:计算文件大小
Question: A colour image has a resolution of 1024 × 768 pixels and a colour depth of 24 bits. Calculate the uncompressed file size of this image in megabytes (MB). Assume 1 MB = 1024 × 1024 bytes.
题目:一幅彩色图像的分辨率为1024×768像素,颜色深度为24位。计算该图像的未压缩文件大小,以兆字节(MB)为单位。假设1 MB = 1024 × 1024 字节。
Total number of pixels = 1024 × 768 = 786,432 pixels. Total bits = 786,432 × 24 = 18,874,368 bits. Convert bits to bytes (1 byte = 8 bits): 18,874,368 ÷ 8 = 2,359,296 bytes. Convert bytes to MB: 2,359,296 ÷ (1024 × 1024) = 2.25 MB.
总像素数 = 1024 × 768 = 786,432 像素。总比特数 = 786,432 × 24 = 18,874,368 比特。将比特转为字节(1字节=8比特):18,874,368 ÷ 8 = 2,359,296 字节。将字节转为MB:2,359,296 ÷ (1024 × 1024) = 2.25 MB。
Answer: The uncompressed file size is 2.25 MB.
答案:未压缩文件大小为2.25 MB。
9. Network Topology and Protocol | 网络拓扑与协议
Question: A small office has four computers connected to a central switch. Identify the network topology and explain one advantage of this topology. Also name a protocol used to send email over the internet.
题目:一个小型办公室有四台计算机连接到一个中央交换机。请识别该网络拓扑类型并解释该拓扑的一个优点。同时说出用于在互联网上发送电子邮件的一种协议。
The described topology is a star topology because all devices are connected to a central node (the switch). An advantage is that if one cable fails, only the attached device is affected, and the rest of the network remains operational. A protocol for sending email is SMTP (Simple Mail Transfer Protocol).
所描述的拓扑是星型拓扑,因为所有设备都连接到中央节点(交换机)。一个优点是如果某条电缆发生故障,只有连接的设备会受到影响,网络其余部分仍能正常工作。用于发送电子邮件的协议是SMTP(简单邮件传输协议)。
10. Error Detection Using Check Digits | 使用校验位进行错误检测
Question: An ISBN-13 code is 978-0-14-103614-?, where the last digit is the check digit calculated using the modulo-10 system with alternating weights of 1 and 3. Compute the missing check digit.
题目:一个ISBN-13编码为978-0-14-103614-?,其中最后一位是使用模10校验位系统,以1和3交替加权计算得到的校验位。计算缺失的校验位。
The first 12 digits are 9,7,8,0,1,4,1,0,3,6,1,4. Multiply each digit alternately by 1 and 3 starting with weight 1: (9×1)+(7×3)+(8×1)+(0×3)+(1×1)+(4×3)+(1×1)+(0×3)+(3×1)+(6×3)+(1×1)+(4×3) = 9+21+8+0+1+12+1+0+3+18+1+12 = 86. The check digit is chosen so that the total sum (including check digit ×1) is a multiple of 10. The next multiple of 10 is 90, so check digit = 90 – 86 = 4.
前12位数字为9,7,8,0,1,4,1,0,3,6,1,4。从权重1开始,以1和3交替乘以每位数字:(9×1)+(7×3)+(8×1)+(0×3)+(1×1)+(4×3)+(1×1)+(0×3)+(3×1)+(6×3)+(1×1)+(4×3) = 9+21+8+0+1+12+1+0+3+18+1+12 = 86。校验位应使得总和(含校验位×1)为10的倍数。下一个10的倍数为90,因此校验位 = 90 – 86 = 4。
The complete ISBN is 978-0-14-103614-4.
完整的ISBN为978-0-14-103614-4。
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课程辅导,国外大学本科硕士研究生博士课程论文辅导