📚 GCSE Computer Science: Worked Examples for Typical Exam Questions | GCSE 计算机:典型例题详解
This article walks you through carefully chosen GCSE Computer Science worked examples. Each section presents a typical exam-style question, followed by clear step-by-step solutions in both English and Chinese. Use these to strengthen your understanding of binary, logic, algorithms, networking, and the fundamentals of computer architecture.
本文通过精选的GCSE计算机科学典型例题,逐一拆解解题思路与步骤。每个小节提供一道常见考题,并给出中英对照的详细解答。深入学习二进制、逻辑门、算法、网络和计算机体系结构等核心考点,帮助你巩固基础,从容应对考试。
1. Binary to Decimal Conversion | 二进制转十进制
Example: Convert the 8‑bit binary number 1101 0110 into decimal.
例题:将8位二进制数1101 0110转换为十进制。
Step 1: Label the place values from right (2⁰) to left (2⁷). For an 8‑bit number, the positions are 128, 64, 32, 16, 8, 4, 2, 1.
步骤1:从右向左标注位权值(2⁰到2⁷)。对8位二进制数,位权分别是128、64、32、16、8、4、2、1。
Step 2: Write the bits under the place values:
步骤2:将各位填入对应位权下方:
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
| 1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 |
Step 3: Multiply each bit by its place value and sum the results: (1×128) + (1×64) + (0×32) + (1×16) + (0×8) + (1×4) + (1×2) + (0×1) = 128 + 64 + 16 + 4 + 2 = 214.
步骤3:每位乘以其位权后求和:(1×128) + (1×64) + (0×32) + (1×16) + (0×8) + (1×4) + (1×2) + (0×1) = 128 + 64 + 16 + 4 + 2 = 214。
Answer: The decimal value is 214.
答案:十进制为214。
2. Binary Addition and Overflow | 二进制加法与溢出
Example: Add the two 8‑bit binary numbers 1011 0110 and 0110 1101. State whether an overflow occurs.
例题:将两个8位二进制数1011 0110和0110 1101相加,并说明是否发生溢出。
Step 1: Add column by column starting from the rightmost bit, carrying 1 when two 1s give 10.
步骤1:从最右列开始逐位相加,逢2进1。
Step 2: Perform the addition:
步骤2:执行加法运算:
1011 0110
+ 0110 1101
————————————
1 0010 0011
Step 3: The result has 9 bits, but we only have 8 bits to store the answer. The extra carry‑out (1) indicates an overflow. The stored 8‑bit result is 0010 0011, which is 35 in decimal, while the true sum is 291.
步骤3:结果出现了第9位,但我们只能用8位存储。最高位的额外进位1表示溢出。保留的8位结果为0010 0011(十进制35),而真实和为291。
Answer: Overflow occurs. The 8‑bit result is 0010 0011.
答案:发生溢出,8位结果为0010 0011。
3. Hexadecimal Representation | 十六进制表示
Example: Convert the binary number 1111 1010 0011 into hexadecimal.
例题:将二进制数1111 1010 0011转换为十六进制。
Step 1: Split the binary number into groups of 4 bits from the right: 1111 1010 0011.
步骤1:从右向左将二进制数分成4位一组:1111 1010 0011。
Step 2: Convert each group to its hex equivalent using the table: 1111 = F, 1010 = A, 0011 = 3.
步骤2:利用对照表将每组转换为十六进制:1111 = F,1010 = A,0011 = 3。
Step 3: Write the hex digits in the same order: F A 3 → FA3.
步骤3:按原顺序写出十六进制数字:F A 3 → FA3。
Answer: The hexadecimal value is FA3.
答案:十六进制为FA3。
4. ASCII and Unicode | ASCII与Unicode
Example: Explain why Unicode is often preferred over ASCII for modern applications. Give one disadvantage of Unicode.
例题:解释为什么在现代应用中Unicode通常比ASCII更受青睐,并给出Unicode的一个缺点。
ASCII uses 7 bits (extended ASCII uses 8) and can represent only 128 (or 256) characters, covering mainly English letters, digits, and basic symbols. Unicode can represent over 143,000 characters from many writing systems, including Chinese, Arabic, and emoji. This makes Unicode essential for global communication. A disadvantage is that Unicode characters typically require more storage per character (e.g. 8 to 32 bits), increasing file sizes compared to ASCII.
ASCII使用7位(扩展ASCII用8位),仅能表示128(或256)个字符,主要覆盖英文字母、数字和基本符号。Unicode可以表示超过143,000个字符,涵盖中文、阿拉伯文、表情符号等多种书写系统,是全球通用文本的必要条件。缺点是Unicode每个字符通常需要更多存储空间(如8至32位),相比ASCII文件体积更大。
Answer: Unicode supports far more characters, enabling multilingual texts, but uses more bits per character.
答案:Unicode支持大量字符,实现多语言文本,但每个字符占用更多位。
5. Logic Gates and Truth Tables | 逻辑门与真值表
Example: Draw the truth table for the circuit: Q = (A AND B) OR (NOT C).
例题:画出逻辑电路Q = (A AND B) OR (NOT C)的真值表。
Step 1: Identify the three inputs A, B, C. There are 2³ = 8 input combinations.
步骤1:确定三个输入A、B、C,共2³ = 8种输入组合。
Step 2: Build the truth table systematically:
步骤2:系统地构建真值表:
| A | B | C | A AND B | NOT C | Q |
| 0 | 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 | 1 |
The Boolean expression correctly evaluates each row.
布尔表达式计算结果与每一行相符。
6. Flowcharts and Pseudocode | 流程图与伪代码
Example: A program asks the user for a password and keeps asking until the correct password ‘TutorHao’ is entered. Draw a flowchart and write pseudocode for this process.
例题:一个程序要求用户输入密码,直到输入正确密码 ‘TutorHao’ 为止。画出流程图并写出伪代码。
Flowchart description: Start symbol → Input password → Decision: Is password equal to ‘TutorHao’? If yes, output ‘Access granted’ and Stop; if no, output ‘Wrong password’ and loop back to Input.
流程图描述:开始符 → 输入密码 → 判断框:密码是否等于’TutorHao’?是则输出“访问允许”并结束;否则输出“密码错误”并返回到输入框。
Pseudocode:
伪代码:
REPEAT
INPUT password
IF password = ‘TutorHao’ THEN
OUTPUT ‘Access granted’
ELSE
OUTPUT ‘Wrong password’
END IF
UNTIL password = ‘TutorHao’
Both the flowchart and pseudocode show a post‑tested loop (REPEAT…UNTIL). Alternatively, a WHILE loop could be used.
流程图和伪代码都展示了一个后测试循环(REPEAT…UNTIL),也可以改用WHILE循环。
7. Network Topologies and Protocols | 网络拓扑与协议
Example: Compare a star topology with a bus topology in terms of reliability and cost.
例题:从可靠性和成本方面比较星型拓扑与总线型拓扑。
In a star topology, each device has its own cable connecting to a central switch. If one cable fails, only that device is disconnected; the rest of the network remains operational. This makes star networks highly reliable. However, they require more cable and a switch, increasing cost.
在星型拓扑中,每个设备通过独立电缆连接到中心交换机。若某条电缆故障,仅该设备断开,网络其余部分仍正常运行,因此星型网络可靠性较高。但需要更多电缆和交换机,成本更高。
In a bus topology, all devices share a single main cable (backbone). A break anywhere in the backbone brings down the entire network. It is cheaper to install because less cable is needed and no dedicated switch is required, but the single point of failure makes it less reliable.
总线型拓扑中,所有设备共享一条主干电缆。主干上任一断裂都会导致整个网络瘫痪。安装便宜,因为所需电缆少且无需专用交换机,但单点故障使可靠性较低。
Answer: Star is more reliable but more expensive; bus is cheaper but less reliable.
答案:星型更可靠但成本高;总线型便宜但可靠性低。
8. Data Storage Units and Compression | 数据存储单位与压缩
Example: A 30‑second high‑quality audio clip is recorded with a sample rate of 44.1 kHz, 16‑bit bit depth, in stereo (2 channels). Calculate the file size in megabytes (MB). Then explain how lossy compression could reduce the file size.
例题:一段30秒的高质量音频以44.1 kHz采样率、16位位深度、立体声(2通道)录制。计算文件大小(MB),并说明有损压缩如何减小文件体积。
Step 1: File size = sample rate × bit depth × channels × duration = 44100 × 16 × 2 × 30 = 42,336,000 bits.
步骤1:文件大小 = 采样率 × 位深度 × 通道数 × 时长 = 44100 × 16 × 2 × 30 = 42,336,000 比特。
Step 2: Convert to bytes: 42,336,000 bits / 8 = 5,292,000 bytes. Convert to MB: 5,292,000 / (1024²) ≈ 5.05 MB.
步骤2:转换为字节:42,336,000 / 8 = 5,292,000 字节。转换为MB:5,292,000 / (1024²) ≈ 5.05 MB。
Lossy compression removes some audio data that is less audible to human ears (perceptual coding). For instance, MP3 compression can reduce the file size significantly while retaining acceptable sound quality.
有损压缩会去除人耳不易察觉的音频数据(感知编码)。例如MP3压缩可大幅缩减文件大小,同时保持可接受的音质。
Answer: Approximately 5.05 MB; lossy compression discards less important data to shrink the file.
答案:约5.05 MB;有损压缩丢弃次要数据以缩小文件。
9. Computer Architecture: Fetch-Decode-Execute | 计算机体系结构:取指-解码-执行
Example: Describe the role of the Program Counter (PC) and the Memory Address Register (MAR) during the fetch stage of the machine cycle.
例题:描述机器周期取指阶段中程序计数器(PC)和内存地址寄存器(MAR)的作用。
In the fetch stage, the CPU must read the next instruction from main memory. The Program Counter holds the address of the next instruction to be fetched. This address is copied to the Memory Address Register, which then sends the address along the address bus to RAM. The instruction stored at that address is returned via the data bus and placed into the Memory Data Register (MDR). The PC is then incremented to point to the next instruction.
在取指阶段,CPU必须从主存读取下一条指令。程序计数器(PC)保存待取指令的地址。该地址被复制到内存地址寄存器(MAR),MAR通过地址总线将地址发送到RAM。该地址处存储的指令通过数据总线返回,并存入内存数据寄存器(MDR)。随后PC递增,指向下一条指令。
Key point: PC provides the address; MAR delivers it to memory.
关键点:PC提供地址;MAR将地址传递给内存。
10. Programming Constructs: Sequence, Selection, Iteration | 编程结构:顺序、选择、迭代
Example: A shop gives a 10% discount if the total purchase exceeds £100. Write a short program (pseudocode or Python) that asks for the total amount, calculates the final price, and prints it. Identify the constructs used.
例题:某商店消费超过100英镑时给予10%折扣。编写一个简短程序(伪代码或Python),要求输入总金额,计算最终价格并输出。指出使用的编程结构。
Pseudocode solution:
伪代码解答:
INPUT total
IF total > 100 THEN
final ← total * 0.9
ELSE
final ← total
END IF
OUTPUT final
Constructs identified: Sequence (INPUT, assignments, OUTPUT), selection (IF…THEN…ELSE), and no explicit iteration here, though a loop could be added.
识别出的结构:顺序(INPUT、赋值、OUTPUT)、选择(IF…THEN…ELSE),此处无显式迭代,但可添加循环。
If the question asked for a program that processes multiple customers, we would include an iteration (e.g. FOR or WHILE).
如果问题需要处理多个客户,我们会包含迭代结构(如FOR或WHILE循环)。
Published by TutorHao | GCSE Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply