📚 AS CIE Computer Science: Unit Test Mock Exam Walkthrough | AS CIE 计算机:单元测试模拟卷解析
Mock exams are a vital part of your AS Computer Science preparation. In this walkthrough, we take a close look at typical unit test questions and break down exactly how to approach each one. By working through these worked examples, you will strengthen your understanding of key concepts and improve your exam technique. Every question is designed to reflect the style and depth of real CIE papers, so treat this revision guide as your personalised study companion for topics covering information representation, hardware, networking, databases, algorithm design, and ethics.
模拟考试是AS计算机科学备考的重要环节。本篇解析将带你仔细梳理典型的单元测试题目,逐一拆解答题思路。通过这些解题示例,你将巩固核心概念,提升考试技巧。每题都力求贴近CIE真题的风格与深度,请把这份复习指南当作你的专属学习伴侣,覆盖信息表示、硬件、网络、数据库、算法设计以及道德等主题。
1. Binary to Hexadecimal Conversion | 二进制转十六进制
Question: Convert the binary number 11011010 into hexadecimal. Show your working.
题目:将二进制数 11011010 转换为十六进制,写出过程。
Start by splitting the binary number into groups of four bits from the right. Here, 11011010 becomes 1101 and 1010. The group 1101 is 13 in denary, which corresponds to D in hex. The group 1010 is 10 in denary, which is A in hex. Therefore, the hexadecimal value is DA. Always ensure you group from the least significant bit; if the leftmost group has fewer than four bits, pad with leading zeros.
首先从右向左将二进制数每四位分为一组。11011010 分成 1101 和 1010。1101 的十进制值是 13,对应十六进制的 D;1010 的十进制值是 10,对应 A。因此十六进制结果为 DA。分组时务必从最低位开始,若最左一组不足四位,需要在前面补零。
2. Logic Gate Combinations and Truth Tables | 逻辑门组合与真值表
Question: Draw the truth table for the logic circuit: Q = (A AND B) OR (NOT C).
题目:画出逻辑电路 Q = (A AND B) OR (NOT C) 的真值表。
We have three inputs: A, B, C. First evaluate (A AND B), then NOT C, and finally combine them with OR. With three inputs, there are 2³ = 8 rows. For example, when A=0, B=1, C=1: A AND B = 0, NOT C = 0, so Q = 0 OR 0 = 0. When A=1, B=1, C=0: A AND B = 1, NOT C = 1, Q = 1. The complete truth table shows Q = 1 for the rows where either (A AND B) is true or C is false. Always list all combinations in binary counting order to avoid omissions.
这里有 A、B、C 三个输入。先算 (A AND B),再算 NOT C,最后进行 OR 运算。三个输入共有 2³ = 8 行。例如当 A=0, B=1, C=1 时,A AND B=0,NOT C=0,因此 Q=0 OR 0=0。当 A=1, B=1, C=0 时,A AND B=1,NOT C=1,Q=1。完整真值表显示,只要 (A AND B) 为真或 C 为假,Q 就输出 1。务必按二进制计数顺序列出所有组合,避免遗漏。
3. The Fetch-Decode-Execute Cycle | 取指令-译码-执行周期
Question: Describe the roles of the Program Counter (PC) and the Current Instruction Register (CIR) during the fetch stage of the machine cycle.
题目:描述在机器周期的取指阶段,程序计数器(PC)和当前指令寄存器(CIR)的作用。
During fetch, the address of the next instruction is held in the Program Counter. This address is sent via the address bus to main memory, and the instruction stored at that address is retrieved. The instruction is then placed in the Current Instruction Register. After the fetch, the PC is incremented to point to the next instruction. The CIR holds the instruction while it is being decoded and executed. A common mistake is to confuse the PC with the Memory Address Register (MAR); remember that the PC contains the address of the next instruction to fetch, while the MAR holds any address being accessed.
在取指阶段,下一条指令的地址存放在程序计数器(PC)中。该地址通过地址总线送往主存,从该地址读出指令。指令随后放入当前指令寄存器(CIR)。取指完成后,PC 递增指向下一条指令。CIR 在译码和执行期间保存当前指令。常见错误是将 PC 与存储器地址寄存器(MAR)混淆;记住 PC 存的是下一条待取指令的地址,而 MAR 可存放任何被访问的地址。
4. LAN vs WAN: Key Differences | 局域网与广域网的核心区别
Question: Compare LAN and WAN in terms of geographical spread, ownership, and typical transmission media.
题目:从地理范围、所有权和典型传输介质三个方面比较局域网(LAN)和广域网(WAN)。
A LAN covers a small area, such as a building or campus, and is usually owned by a single organisation. It often uses Ethernet cables or Wi‑Fi, offering higher data transfer rates and lower latency. A WAN spans cities, countries, or even continents, and infrastructure is typically owned by multiple entities, such as ISPs. WANs commonly use fibre optic cables, leased lines, or satellite links. Exam answers should highlight that LAN hardware (switches, hubs) is managed privately, whereas WAN requires public or leased communication systems.
LAN 覆盖小型区域,如大楼或校园,通常由单个组织拥有。它常用以太网线或 Wi‑Fi,数据传输速率高、延迟低。WAN 跨越城市、国家乃至大洲,基础设施通常由多个实体(如 ISP)共同拥有。WAN 普遍使用光纤、专线或卫星链路。考试答案应强调:LAN 硬件(交换机、集线器)为私有管理,而 WAN 依赖公共或租用的通信系统。
5. IP Addressing and MAC Addressing | IP 地址与 MAC 地址
Question: Explain why a device on a network needs both an IP address and a MAC address.
题目:解释网络中的设备为何同时需要 IP 地址和 MAC 地址。
An IP address is a logical address used for routing data across different networks. It identifies the network and the host, allowing packets to travel from source to destination globally. A MAC address is a physical address hardcoded into the network interface card (NIC). It is used for delivering frames within the same local network segment. IP can change when the device moves networks, while the MAC remains constant. Essentially, IP gets the packet to the right network, and MAC gets it to the right device on that network.
IP 地址是逻辑地址,用于在不同网络之间路由数据。它标识网络和主机,使得数据包能够从源端跨越全球到达目的端。MAC 地址是固化在网卡(NIC)中的物理地址,用于在同一局域网段内传送帧。IP 地址在设备切换网络时可能改变,而 MAC 地址保持不变。简言之,IP 把数据包送到正确网络,MAC 再把它交给该网络内的正确设备。
6. Lossless and Lossy Compression | 无损压缩与有损压缩
Question: A student compresses a text file and an image file. Identify suitable compression types for each and justify your answers.
题目:某学生对文本文件和图像文件进行压缩。请为每种文件选择合适的压缩类型并说明理由。
For the text file, lossless compression is essential. Text contains precise information where even a single changed character could alter meaning. Algorithms like run‑length encoding or Huffman coding reconstruct the original file exactly. For the image, lossy compression is acceptable if slight quality loss is tolerable, for example in a photograph for a website. JPEG uses lossy compression to greatly reduce file size. However, if the image is a technical diagram or medical scan, lossless (like PNG) would be required to preserve every detail.
文本文件必须使用无损压缩。文本包含精确信息,更改一个字符都可能改变含义。游程编码或霍夫曼编码等算法可以完全重建原文件。对于图像,若可接受微小质量损失,如有损压缩,例如网站上的照片,JPEG 采用有损压缩便能大幅减小文件体积。但若是技术图纸或医学扫描影像,则需使用 PNG 等无损压缩,以保留所有细节。
7. Parity Bits for Error Detection | 奇偶校验位进行错误检测
Question: A byte 1011001 is transmitted using even parity. Append the correct parity bit and explain how an error can be detected upon receipt.
题目:使用偶校验传输字节 1011001。添加正确的校验位,并解释接收方如何检测错误。
Count the number of 1s in 1011001: there are four 1s, which is even. For even parity, the parity bit should make the total number of 1s even. Since four is already even, the appended parity bit is 0. The transmitted data becomes 10110010. The receiver counts the 1s in the entire byte including parity; if the count is odd, an error has occurred. Note that simple parity can only detect an odd number of bit errors and cannot locate or correct them.
统计 1011001 中 1 的个数:共有四个 1,为偶数。偶校验要求加上校验位后所有位中 1 的总数为偶数。既然已有四个 1,校验位应为 0,发送数据为 10110010。接收方统计含校验位的整个字节中 1 的个数;若结果为奇数,则检测到错误。需要注意的是,简单的奇偶校验只能检测奇数个位错误,无法定位或纠正。
8. Introduction to Database Normalisation | 数据库规范化入门
Question: A table storing orders has columns: OrderID, CustomerName, ProductCode, ProductName, Quantity. Explain why this table is not in First Normal Form (1NF) and suggest how to fix it.
题目:一个存储订单的表包含列:OrderID、CustomerName、ProductCode、ProductName、Quantity。解释该表为何不符合第一范式(1NF),并提出修改方案。
The table potentially contains repeating groups if a single order has multiple products. For example, OrderID might appear multiple times with different ProductCode values, yet the table structure does not properly separate these. To satisfy 1NF, each cell must hold atomic values and there should be no duplicated rows. A better design is to split into Orders (OrderID, CustomerName) and OrderDetails (OrderID, ProductCode, Quantity). ProductName should be moved to a Products table linked by ProductCode to avoid redundancy. This ensures data integrity and reduces update anomalies.
如果一个订单包含多个产品,该表就可能存在重复组。例如相同的 OrderID 会因不同 ProductCode 而多次出现,而表结构未正确分离。为满足 1NF,每个单元格必须存放原子值,不能有重复行。更好的设计是拆分为 Orders(OrderID, CustomerName)和 OrderDetails(OrderID, ProductCode, Quantity)。ProductName 应移入 Products 表并通过 ProductCode 关联,以避免冗余。这样能保证数据完整性,减少更新异常。
9. Pseudocode and Trace Tables | 伪代码与追踪表
Question: The following pseudocode is executed: FOR Count ← 1 TO 3, Total ← Total + Count * 2, ENDFOR. The initial value of Total is 0. Produce a trace table showing the values of Count and Total after each iteration.
题目:执行以下伪代码:FOR Count ← 1 TO 3,Total ← Total + Count * 2,ENDFOR。Total 初始值为 0。画出追踪表,展示每次迭代后 Count 和 Total 的值。
A trace table helps simulate code step by step. Iteration 1: Count = 1, Total = 0 + (1*2) = 2. Iteration 2: Count = 2, Total = 2 + (2*2) = 6. Iteration 3: Count = 3, Total = 6 + (3*2) = 12. After the loop, Count is 3 and Total is 12. Always update values in order and check the loop condition carefully. Many exam mark schemes award marks for clear, labelled tables with correct final values.
追踪表有助于逐步模拟代码执行。第一次迭代:Count=1,Total=0+(1×2)=2。第二次:Count=2,Total=2+(2×2)=6。第三次:Count=3,Total=6+(3×2)=12。循环结束后 Count 为 3,Total 为 12。务必按顺序更新数值,并仔细检查循环条件。许多考试评分标准对清晰标注、终值正确的表格给予分数。
10. Ethics and Software Licensing | 道德与软件许可
Question: Describe one ethical issue related to the use of open source software in a commercial product and suggest how the developer can comply with the associated license.
题目:描述在商业产品中使用开源软件可能涉及的一个道德问题,并说明开发者应如何遵守相关许可。
A common ethical concern is failing to attribute the original authors, which violates both the spirit and the letter of many open source licenses (e.g., MIT, GPL). If a developer embeds open source code without including the required copyright notice and license text, they are misrepresenting the work as entirely their own. To comply, the developer must read the specific license terms, include the original copyright notice in the product documentation or about screen, and, if the license is copyleft (like GPL), release their own source code under the same terms. Ignoring these obligations can lead to legal action and reputational damage.
常见道德问题是不标注原作者的贡献,这违反了众多开源许可(如 MIT、GPL)的精神与条文。如果开发者嵌入开源代码却不附带必需的版权声明和许可证文本,就相当于把作品完全说成是自己的。为遵守许可,开发者必须阅读具体条款,在产品文档或“关于”页面中加入原始版权声明;若许可证为著佐权类型(如 GPL),还需以相同条款公开自己的源代码。忽视这些义务可能招致法律诉讼和声誉损失。
11. Operating Systems and Interrupt Handling | 操作系统与中断处理
Question: When a user presses a key on the keyboard, an interrupt is generated. Outline the steps the operating system takes to handle this interrupt.
题目:用户按下键盘上的一个键时会产生中断。简述操作系统处理该中断的步骤。
First, the keyboard controller sends an interrupt signal to the CPU via the interrupt request line. The CPU finishes its current instruction, then checks the interrupt register. It saves the current process state (program counter, registers) onto the stack. The CPU uses the interrupt vector to locate the appropriate Interrupt Service Routine (ISR) for the keyboard. The ISR reads the key code from the keyboard buffer and makes the character available to the active application. After execution, the original process state is restored, and the CPU resumes its previous task. Prioritisation ensures that urgent interrupts are handled first.
首先,键盘控制器通过中断请求线路向CPU发送中断信号。CPU完成当前指令后检查中断寄存器。它将当前进程的状态(程序计数器、寄存器)压栈保存。CPU利用中断向量定位对应的键盘中断服务程序(ISR)。ISR从键盘缓冲区读取按键码,将字符提供给活动应用程序。执行完毕后恢复原进程状态,CPU继续原先的任务。中断优先级机制确保紧急中断优先处理。
12. Common Security Threats and Prevention | 常见安全威胁与防范
Question: Identify two different forms of malware and explain how each can be prevented.
题目:识别两种不同类型的恶意软件,并分别说明如何防范。
A virus attaches itself to legitimate programs and spreads when the infected program is executed. Prevention includes using antivirus software with real‑time scanning, avoiding downloads from untrusted sources, and keeping the OS updated. A Trojan horse disguises itself as useful software but performs malicious actions in the background. Users should only install software from official repositories or signed sources, and employ application whitelisting where possible. Both threats can be mitigated by regular staff training, ensuring firewalls are correctly configured, and maintaining isolated backups.
病毒附着在合法程序上,当感染程序运行时传播。防范措施包括使用具有实时扫描功能的杀毒软件、避免从不可信来源下载、保持操作系统更新。特洛伊木马伪装成有用软件,在后台执行恶意操作。用户应只从官方仓库或经过签名的来源安装软件,并尽可能采用应用白名单策略。两种威胁都可通过定期员工培训、正确配置防火墙以及维护隔离备份来减轻风险。
Published by TutorHao | AS CIE 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