Unit Test Mock Paper Walkthrough | 单元测试模拟卷解析

📚 Unit Test Mock Paper Walkthrough | 单元测试模拟卷解析

Mock papers are one of the most effective revision tools for OCR GCSE Computer Science. This walkthrough takes you through a typical unit test, covering key topics such as data representation, hardware, networking, algorithms, and the wider impacts of technology. Each question is broken down with a step‑by‑step solution and examiner‑style tips to help you maximise your marks.

模拟试卷是OCR GCSE计算机科学最有效的复习工具之一。本解析将带领你完成一份典型的单元测试,涵盖数据表示、硬件、网络、算法及技术的更广泛影响等关键主题。每道题目都配有逐步解答和考官风格的提示,帮助你尽可能多地得分。


1. Hexadecimal and Binary Conversion | 十六进制与二进制转换

Question: Convert the hexadecimal number 3F to an 8‑bit binary number. Show your working. (2 marks)

问题: 将十六进制数3F转换为一个8位二进制数。请展示你的计算步骤。(2分)

To convert from hexadecimal to binary, split the hex number into individual digits and convert each digit into a 4‑bit nibble. The hex digit 3 is decimal 3, which is 0011 in binary (2+1). The hex digit F represents decimal 15, so its binary equivalent is 1111 (8+4+2+1). Joining these two nibbles gives 00111111. The question asks for an 8‑bit answer, so we present the result as 00111111. It is already 8 bits wide and does not need leading zeros to be removed.

将十六进制转换为二进制时,先把十六进制数拆分成单个数字,再将每位数字转换为4位的二进制半字节。十六进制数字3是十进制3,对应二进制0011(2+1)。十六进制数字F表示十进制15,其二进制等价形式为1111(8+4+2+1)。将这两个半字节组合起来得到00111111。题目要求输出8位二进制,因此答案直接写作00111111,它已经是8位宽度,无需去掉前导零。

Answer: 00111111

答案: 00111111

A common mistake is to treat F as 1111 but forget to place it in the lower nibble, or to write 111111 and add zeros incorrectly. Always check that each hex digit exactly fills four bits when moving to an 8‑bit representation.

常见的错误是虽然将F视为1111,却忘记了要将其放置在低位半字节中,或者是写出了111111之后又错误地补零。请务必记住,转换为8位二进制时,每个十六进制位准确地占据四个比特位。


2. Binary Addition with Overflow | 二进制加法与溢出

Question: Add the 8‑bit binary numbers 10101101 and 01110010. Show your working and state whether an overflow occurs, explaining why. (3 marks)

问题: 将两个8位二进制数10101101和01110010相加。展示计算过程,说明是否发生溢出并解释原因。(3分)

Start by aligning the two binary numbers from the rightmost bit, the least significant bit (LSB). Work column by column carrying forward any carry bit into the next column. The step‑by‑step addition is shown below:

从最右侧的最低有效位(LSB)开始对齐两个二进制数,然后逐列相加,并将进位传递到下一列。逐步加法如下所示:

LSB (col 0): 1 + 0 = 1 (carry 0)
col 1: 0 + 1 = 1 (carry 0)
col 2: 1 + 0 = 1 (carry 0)
col 3: 1 + 0 = 1 (carry 0)
col 4: 0 + 1 = 1 (carry 0)
col 5: 1 + 1 = 0 (carry 1)
col 6: 0 + 1 + 1 (carry) = 0 (carry 1)
col 7 (MSB): 1 + 0 + 1 (carry) = 0 (carry 1)

The calculated 8‑bit sum is 00011111, with a final carry‑out of 1 beyond the most significant bit (MSB). An 8‑bit register can only hold values from 0 to 255 in unsigned representation. Since there is a carry out of the MSB, the true result (287) cannot be stored in 8 bits – an overflow has occurred. In unsigned binary arithmetic, overflow happens precisely when there is a carry beyond the MSB.

计算得到的8位和为00011111,并且在最高有效位(MSB)之外产生了一个最终的进位1。8位寄存器在无符号表示下只能保存0到255之间的值。由于MSB之外有一个进位,真正的结果(287)无法用8位存储,因此发生了溢出。在无符号二进制算术中,溢出恰恰发生在MSB之外产生进位的时候。

Answer: Sum = 00011111. Overflow occurs because a carry of 1 is generated beyond the most significant bit, meaning the result exceeds the 8‑bit range.

答案: 和为00011111。发生了溢出,因为最高有效位之外产生了一个进位1,意味着结果超出了8位范围。

For the marks, you would receive 1 mark for the correct binary addition, 1 mark for correctly identifying that overflow occurs, and 1 mark for the explanation linking the carry out to the limited bit width.

在得分方面,正确的二进制加法可得1分,正确判断溢出可得1分,将进位与有限的位宽相联系进行解释可再得1分。


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

Question: Complete the truth table for the logic circuit represented by the Boolean expression Q = (A AND B) OR (NOT C). (3 marks)

问题: 完成由布尔表达式 Q = (A AND B) OR (NOT C) 表示的逻辑电路的真值表。(3分)

There are three inputs (A, B, C), so the truth table requires 2³ = 8 rows to cover all input combinations. You need to evaluate the expression for each row. First compute the intermediate column (A AND B) and the column (NOT C), then apply the OR operation to those two results to obtain Q. Remember that AND returns 1 only when both inputs are 1; OR returns 1 if at least one input is 1; and NOT flips the input bit.

有三个输入(A, B, C),因此真值表需要 2³ = 8 行才能覆盖所有输入组合。你需要为每一行求出表达式的值。首先计算中间列 (A AND B) 以及 (NOT C),然后对这两个中间结果应用 OR 运算以获得 Q。请记住,AND 仅当两个输入都是 1 时输出 1;OR 只要至少有一个输入为 1 就输出 1;而 NOT 会将输入位翻转。

The completed truth table is given below. For each row, check the AND and NOT separately before combining them with OR.

完成的真值表如下所示。对每一行,先分别求出 AND 和 NOT 的结果,再通过 OR 将其合并。

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 更多咨询请联系16621398022(同微信)

Comments

屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from aleveler.com

Subscribe now to keep reading and get access to the full archive.

Continue reading