← 返回资讯屏轩教育 · 行业资讯

AS WJEC Computer Science Unit Test Mock Paper Analysis | AS WJEC 计算机:单元测试模拟卷解析

2026-07-25 07:19 · 本文部分内容由AI辅助创作

📚 AS WJEC Computer Science Unit Test Mock Paper Analysis | AS WJEC 计算机:单元测试模拟卷解析

This article provides a detailed walkthrough of a mock Unit 1 paper for WJEC AS Computer Science, covering key topics like data representation, computer architecture, algorithms, and programming fundamentals. Each section includes a typical exam-style question, followed by a step-by-step solution and commentary in both English and Chinese, designed to strengthen your understanding and exam technique.

本文详细解析了一份WJEC AS计算机科学单元1模拟试卷,涵盖数据表示、计算机体系结构、算法和编程基础等核心考点。每个小节包含一道典型试题,并提供逐步解题思路和双语评注,旨在加深理解并提升应试技巧。

1. Binary Addition and Overflow | 二进制加法与溢出

A mock question asks: Add the 8-bit unsigned integers 1101 0110₂ and 0110 1011₂, showing all carries. State whether an overflow occurs and explain why.

模拟题要求:将8位无符号整数1101 0110₂与0110 1011₂相加,写出所有进位,判断是否发生溢出并解释原因。

carry 1; 1+0+carry1 = 0 carry 1; and so on. The full working is shown in the table below.

首先,对齐各位并自右向左逐列相加,记录进位。0+1=1,无进位;1+1=0进1;1+0+进1=0进1;依此类推。完整过程见下表。

Carry11101000
Binary A11010110
Binary B01101011
Sum01000001

n, this indicates an overflow because the correct sum (256+64+1 = 321) exceeds the maximum value 255 that can be stored in 8 bits.

结果为0100 0001₂。然而,最高有效位(MSB)产生了一个进位(最左进位为1)。在无符号8位表示中,这表示发生了溢出,因为正确的和(256+64+1=321)超过了8位所能存储的最大值255。

Therefore, the 8-bit sum is invalid; the overflow flag would be set in a processor. Always check if the carry out of the MSB is 1 for unsigned numbers.

因此,8位和是无效的;处理器会设置溢出标志。对于无符号数,请务必检查最高有效位的进位是否为1。


2. Hexadecimal to Binary Conversion | 十六进制与二进制转换

A question states: Convert the hexadecimal value 3F.A₁₆ into an 8-bit binary representation with a fractional part. Explain the significance of the point.

题目说明:将十六进制值3F.A₁₆转换为带小数部分的8位及更多位的二进制表示,并解释小数点的意义。

₂. The hexadecimal point separates the integer and fractional parts, analogous to the binary point.

每个十六进制数字对应4位二进制。3₁₆=0011₂,F₁₆=1111₂,A₁₆=1010₂。十六进制小数点分隔整数和小数部分,作用类似于二进制小数点。

So 3F.A₁₆ becomes 0011 1111 . 1010₂. Removing leading zeros and trailing fractional zeros gives 111111.101₂. The integer part requires 6 bits; the fractional part is 3 bits. To represent as an 8-bit fixed-point number with, say, 4 integer and 4 fractional bits, we might need to pad or truncate: 00111111.1010₂ would be 0011 1111 1010₂ if 12 bits allowed.

因此3F.A₁₆转换为 0011 1111 . 1010₂。去除前导零和尾随小数零后得到111111.101₂。整数部分需6位,小数部分为3位。若要表示为8位定点数(例如4位整数、4位小数),可能需要补齐或截断:如0011 1111.1010₂。

The binary point is crucial in fixed-point arithmetic, as it determines the weighting of each bit. Without it, the number is ambiguous.

二进制小数点在定点运算中至关重要,它决定了每一位的权重。没有小数点,数值就变得模糊不清。


3. Logic Gates and Truth Table | 逻辑门与真值表

the Boolean expression Q = (A AND B) OR (NOT C) and produce the corresponding truth table.

常见题型:画出布尔表达式 Q = (A AND B) OR (NOT C) 的逻辑电路,并列出对应的真值表。

The circuit requires one AND gate, one NOT gate, and one OR gate. Input C goes to the NOT gate; the output of NOT C is combined with the output of A AND B via the OR gate to produce Q.

该电路需要一个与门、一个非门和一个或门。输入C接入非门;非门的输出与A和B的与门输出通过或门组合,产生Q。

NOT C, then Q. For example, when A=0, B=1, C=0: A AND B = 0; NOT C = 1; so Q = 0 OR 1 = 1.

真值表有2³=8行。我们评估中间列:A AND B、NOT C,然后得到Q。例如当A=0、B=1、C=0时:A AND B = 0;NOT C = 1;因此Q = 0 OR 1 = 1。

ABCA AND BNOT CQ
000011
001000
010011
011000
100011
101000
110111
111101

Always label inputs and outputs clearly in your circuit diagram, and ensure that NOT is represented by a small circle at the input of the OR gate or a separate triangle with a bubble.

在电路图中务必清晰标注输入输出,并保证非门以或门输入处的小圆圈或带气泡的三角符号表示。


4. CPU Registers and the Fetch-Decode-Execute Cycle | CPU寄存器与取指-译码-执行周期

A question might ask: Identify the roles of the Program Counter (PC) and Memory Address Register (MAR) during the fetch phase, and describe what happens to the Accumulator after an ADD instruction.

可能的问题:指出取指阶段程序计数器(PC)和内存地址寄存器(MAR)的作用,并描述执行ADD指令后累加器(ACC)的变化。

During fetch, the PC holds the address of the next instruction to be fetched. This address is copied to the MAR, which then sends it along the address bus to main memory. The instruction stored at that location is transferred to the Memory Data Register (MDR), and the PC is incremented.

在取指阶段,PC保存下一条待取指令的地址。该地址被复制到MAR,MAR随后通过地址总线送往主存。存储在该位置的指令被传送到内存数据寄存器(MDR),同时PC递增。

After an ADD instruction is executed, the result of the addition is stored in the Accumulator. The Accumulator is a general-purpose register that holds intermediate arithmetic and logic results. For example, if the instruction ADD #5 adds 5 to the current accumulator value, the new sum overwrites the previous content.

ADD指令执行后,加法结果存储在累加器中。累加器是通用寄存器,用于存放中间算术和逻辑运算结果。例如,若指令ADD #5将5与当前累加器值相加,则新的和会覆盖之前的内容。

Understanding these registers is vital for writing assembly-level trace tables, a common WJEC exam task.

理解这些寄存器对编写汇编级跟踪表至关重要,这是WJEC考试中的常见任务。


广告 / Sponsored

5. Lossless and Lossy Compression | 无损压缩与有损压缩

Explain, using an example, the difference between lossless and lossy compression. A mock question: Why is JPEG suitable for photographs but not for text documents?

举例说明无损压缩和有损压缩的区别。模拟题:为什么JPEG适用于照片,却不适用于文本文档?

Lossless compression reduces file size without any loss of information; the original data can be perfectly reconstructed. Run-length encoding (RLE) is a simple lossless method. For instance, 'AAAABBBCC' compresses to '4A3B2C'.

无损压缩减小文件大小但不丢失任何信息;原始数据可被完全还原。游程编码(RLE)是一种简单的无损方法,例如'AAAABBBCC'压缩为'4A3B2C'。

Lossy compression permanently discards some data deemed less perceptible, achieving much higher compression ratios. JPEG uses this by reducing colour detail that the human eye is less sensitive to. This makes it excellent for photographs, where a slight loss of detail is unnoticeable.

有损压缩永久地丢弃一些被认为不太可感知的数据,获得更高的压缩比。JPEG通过减少人眼不太敏感的色彩细节来实现,因此非常适合照片,微小的细节丢失不易察觉。

However, for text documents, every character is critical; losing even a single bit can corrupt meaning. Hence, lossy compression would be disastrous. Text uses lossless formats like ZIP or PNG (for images with text).

然而,对于文本文档,每个字符都至关重要;哪怕丢失一个比特都可能破坏语义。因此,有损压缩将是灾难性的。文本使用ZIP或PNG(用于含文本的图像)等无损格式。


6. Cybersecurity Threats: Phishing | 网络安全威胁:网络钓鱼

A scenario-based question: An employee receives an email appearing to be from their bank, asking them to click a link and verify their password. Identify the attack type and suggest two ways the organisation can protect against it.

情景题:一名员工收到一封看似来自银行的电子邮件,要求点击链接并验证密码。请识别攻击类型,并提出组织可以采取的两种防护措施。

This is a phishing attack, a form of social engineering where attackers impersonate legitimate entities to steal sensitive information such as login credentials. The link likely leads to a fake website that mimics the real bank's page.

这是网络钓鱼攻击,一种社会工程手段,攻击者冒充合法实体以窃取登录凭证等敏感信息。该链接很可能指向一个模仿真实银行页面的虚假网站。

Organisational protections include: implementing email filtering to detect and quarantine suspicious messages, and conducting regular staff training to recognise phishing indicators (e.g., misspellings, urgent language, unfamiliar URLs).

组织防护措施包括:实施电子邮件过滤以检测和隔离可疑邮件,并定期开展员工培训,使其能识别钓鱼迹象(如拼写错误、紧迫措辞、不熟悉的URL)。

Additionally, multi-factor authentication can limit damage even if credentials are compromised. Firewis and anti-phishing toolbars provide further technical layers.

此外,即使凭证被窃取,多因素身份验证也可以限制损害。防火墙和反钓鱼工具栏提供了更多的技术层面保护。


7. Algorithm Complexity and Linear Search | 算法复杂度与线性搜索

A question: Show the steps of a linear search to find the value 34 in the list [12, 45, 23, 34, 67]. State the best- and worst-case time complexity in Big O notation.

题目:展示线性搜索在列表[12, 45, 23, 34, 67]中查找值34的步骤。用大O符号表示最佳和最坏情况的时间复杂度。

Linear search starts at index 0: 12 not equal to 34 (1 comparison). Index 1: 45 ≠ 34 (2). Index 2: 23 ≠ 34 (3). Index 3: 34 matches (4 comparisons, item found). It returns index 3.

线性搜索从索引0开始:12不等于34(1次比较)。索引1:45≠34(2次)。索引2:23≠34(3次)。索引3:34匹配(4次比较,找到),返回索引3。

Best-case complexity is O(1) when the target is at the first position. Worst-case complexity is O(n) when the target is at the last position or not present, requiring n comparisons for an n-item list.

最佳情况复杂度为O(1),当目标位于第一个位置时。最坏情况复杂度为O(n),当目标位于最后一个位置或不存在时,对于含n个项的列表需要n次比较。

Linear search is simple but inefficient for large datasets; binary search (O(log n)) is faster but requires sorted data.

线性搜索简单,但对大数据集效率低下;二分搜索(O(log n))更快,但要求数据已排序。


8. Data Structures: Stack Operations | 数据结构:栈操作

A question gives an empty stack and a sequence of operations: push(5), push(10), pop(), push(3), push(7), pop(). Show the stack contents after each step and the value returned by each pop.

题目给出一个空栈和操作序列:push(5), push(10), pop(), push(3), push(7), pop()。显示每一步后栈的内容以及每次pop返回的值。

A stack is a LIFO (Last In, First Out) structure. Operations: push adds to the top; pop removes and returns the top element.

栈是一种LIFO(后进先出)结构。操作:push将元素添加到栈顶;pop移除并返回栈顶元素。

StepOperationStack Content (top -> bottom)Popped Value
1push(5)[5]-
2push(10)[10, 5]-
3pop()[5]10
4push(3)[3, 5]-
5push(7)[7, 3, 5]-
6pop()[3, 5]7

If the stack is implemented using an array, a stack pointer (or top index) keeps track of the next free slot. Popping from an empty stack would cause underflow, an error that must be handled.

如果用数组实现栈,则需要一个栈指针(或顶部索引)来跟踪下一个空闲位置。从空栈弹出会导致下溢错误,必须加以处理。


9. Object-Oriented Programming: Class and Object | 面向对象编程:类与对象

A programming question: Define a class 'Dog' with attributes name (string), age (integer), and a method bark() that outputs 'Woof!'. Then instantiate two objects and call the method.

编程题:定义一个类 'Dog',具有属性 name(字符串)、age(整数)和一个输出 'Woof!' 的方法 bark()。然后实例化两个对象并调用该方法。

In pseudocode common to WJEC papers, the class definition encapsulates data and methods. Attributes are declared as private for data hiding; public methods provide an interface.

在WJEC试卷常见的伪代码中,类定义封装了数据和方法。属性声明为私有以实现数据隐藏;公有方法提供接口。

e name, age; public procedure new(n, a) sets name=n, age=a; public procedure bark() print('Woof!'). Then object1 = new Dog('Rex', 3); object2 = new Dog('Luna', 5); object1.bark() would display Woof!.

类Dog:私有 name, age;公有过程 new(n, a) 设置 name=n, age=a;公有过程 bark() 打印 'Woof!'。然后 object1 = new Dog('Rex', 3); object2 = new Dog('Luna', 5); object1.bark() 会显示 Woof!。

OOP principles such as encapsulation and abstraction are key. In the exam, you may also be asked about inheritance or polymorphism, but this simple example illustrates the basics.

面向对象编程的原则,如封装和抽象是关键。考试中可能还会问到继承或多态,但这个简单示例说明了基础知识。


10. SQL Query Writing | SQL查询编写

A database question: Given a table 'Students' with fields ID, Name, YearGroup, Grade, write an SQL statement to retrieve the names and grades of all students in Year 12 with a grade higher than 'C'.

数据库题:给定表 'Students',包含字段 ID, Name, YearGroup, Grade,编写一条SQL语句,检索所有12年级且成绩高于'C'的学生的姓名和成绩。

The required SQL uses SELECT and WHERE with conditions. Grade comparison is alphabetical: 'A' > 'B' > 'C', etc. So 'higher than C' means grades 'A' or 'B'.

所需的SQL使用SELECT和WHERE及其条件。成绩比较按字母顺序:'A' > 'B' > 'C' 等。因此 '高于C' 指成绩为'A'或'B'。

SELECT Name, Grade

FROM Students

WHERE YearGroup = 'Year12' AND (Grade = 'A' OR Grade = 'B');

Alternative: WHERE YearGroup = 'Year12' AND Grade IN ('A','B'); This returns the correct columns. Always ensure string literals are in single quotes and table/field names match the given schema.

另一种写法:WHERE YearGroup = 'Year12' AND Grade IN ('A','B'); 返回正确的列。务必确保字符串字面量用单引号括起,表名和字段名与给定模式匹配。

SQL is a high-yield topic in the WJEC Unit 1 exam, often appearing in short-answer or structured questions.

SQL是WJEC单元1考试中的高频考点,常以简答或结构化题型出现。


11. Representing Sound as Digital Data | 声音的数字化表示

A question: Explain how an analogue sound wave is converted into a digital form using sampling, and state the effect of increasing the sample rate on file size and quality.

题目:解释如何通过采样将模拟声波转换为数字形式,并说明提高采样率对文件大小和质量的影响。

An analogue-to-digital converter (ADC) takes measurements of the wave's amplitude at regular intervals (the sample rate). Each sample is quantised to the nearest available binary value determined by the bit depth.

模数转换器(ADC)以固定间隔(采样率)测量声波的振幅。每个采样被量化为由位深度决定的最接近的二进制值。

If the sample rate is 44.1 kHz, 44,100 samples are taken per second. A higher sample rate captures higher frequencies more accurately, improving quality, but it also increases the number of samples per second, hence the file size grows proportionally.

如果采样率为44.1 kHz,则每秒采集44,100个样本。更高的采样率能更准确地捕捉高频声音,提升音质,但会增加每秒的样本数量,因此文件大小也成比例增加。

Bit depth also impacts quality; 16-bit audio provides 65,536 possible amplitude levels, reducing quantisation noise compared to 8-bit.

位深度也会影响质量;与8位相比,16位音频提供65,536个可能的振幅级别,减少了量化噪声。


12. Error Checking: Checksum Calculation | 错误校验:校验和计算

A mock question provides the three bytes: 1100 0101, 0011 0110, 1010 0011, followed by a checksum byte 0111 1000. Verify whether the data is valid using the checksum method where the sum of all bytes (including checksum) must result in a total where the 8-bit sum (ignoring overflow) equals zero.

模拟题给出三个字节:1100 0101, 0011 0110, 1010 0011,后跟校验和字节0111 1000。使用校验和方法验证数据是否有效,该方法要求所有字节的总和(含校验和)在忽略溢出的8位和中为零。

0 (9 bits). Discard the carry, leaving 1001 1110. Now add the checksum: 1001 1110 + 0111 1000 = 1 0001 0110. Discard the carry, result is 0001 0110, not zero.

首先用二进制加法相加三个数据字节。1100 0101 + 0011

Published by TutorHao | AS Computer Science Revision Series | aleveler.com

广告 / Sponsored
Linux高级程序设计(高等院校计算机技术十二五规划教材)/刘加海/季江民/浙江大学出版社
计算机 备考教辅 · 正版现货 · 与本文内容相关
查看详情 / View on Taobao参考价 ¥55.6

更多咨询请联系16621398022(同微信)

备考资讯每日更新,关注不错过
考纲变化 · 科目分析 · 学习方法
扫码关注公众号 tutorhao
在微信里长按二维码识别关注
或截图后用「扫一扫 → 相册」选择本图
公众号:tutorhao