📚 Year 12 CAIE Computer Science: Unit Test Mock Exam Analysis | Year 12 CAIE 计算机:单元测试模拟卷解析
This article provides a detailed breakdown of a mock unit test designed for Year 12 CAIE Computer Science students. It covers key topics from the AS syllabus including data representation, networking, logic circuits, processor fundamentals, system software, databases, pseudocode, and security. By working through each question and its thorough explanation, learners can reinforce their understanding and identify areas for improvement.
本文详细解析了一套专为Year 12 CAIE计算机科学学生设计的单元测试模拟卷。内容涵盖了AS大纲中的核心主题,包括数据表示、网络、逻辑电路、处理器基础、系统软件、数据库、伪代码以及安全等。通过每个问题及其深入的讲解,学习者可以巩固理解并识别需要加强的知识点。
1. Data Representation & Binary Arithmetic | 数据表示与二进制运算
Question 1: (a) Express the unsigned decimal integer 107 as an 8‑bit two’s complement number. (b) Add the two 8‑bit binary numbers 01010101 and 01101000, and determine if an overflow occurs. (c) Encode 107 using packed BCD.
问题1:(a) 将无符号十进制整数107表示为8位二进制补码。(b) 将两个8位二进制数01010101和01101000相加,并判断是否发生溢出。(c) 使用压缩BCD码表示107。
1011. Pad to 8 bits with a leading zero to obtain 01101011. As a positive number, its two’s complement representation remains 01101011.
步骤(a):107的二进制可以通过连续除以2或注意到107 = 64 + 32 + 8 + 2 + 1得到1101011。在前面补零得到8位格式01101011。因为是正数,其补码表示与无符号形式相同,仍为01101011。
its has a most significant bit (MSB) of 1, indicating a negative value in two’s complement. Since both addends are positive, the correct sum should be positive 189, which cannot fit in 8‑bit two’s complement (range -128 to +127). Therefore, an overflow has occurred.
步骤(b):执行二进制加法:01010101(十进制85)+ 01101000(十进制104)= 10111101。结果的最高位(MSB)是1,在补码中表示负数。由于两个加数都是正数,正确的和应为正189,这超出了8位补码的表示范围(-128 到 +127)。因此发生了溢出。
Step (c): Packed BCD represents each decimal digit with a 4‑ 0111. Pack them consecutively to form 0001 0000 0111. This is often written as the hexadecimal pattern 0x107, but it does not equal the binary value of 107; it is merely a digit‑wise encoding.
步骤(c):压缩BCD码用4位二进制表示每个十进制数字。数字1→0001,0→0000,7→0111。将它们依次连接得0001 0000 0111。通常写作十六进制模式0x107,但这并非数值107的二进制;它只是按位编码。
2. IP Addressing and Subnetting | IP寻址与子网划分
Question 2: A host on a TCP/IP network is assigned the IPv4 address 192.168.1.25 with a subnet mask of 255.255.255.224. Write the mask in slash notation, compute the network address, the broadcast address, and the first and last usable host addresses.
问题2:一台TCP/IP网络主机的IPv4地址为192.168.1.25,子网掩码为255.255.255.224。请写出斜线表示法中的掩码,并计算网络地址、广播地址以及第一个和最后一个可用主机地址。
nes, hence the CIDR notation is /27. The block size is 2⁵ = 32 (since 5 host bits remain).
子网掩码255.255.255.224的二进制为11111111.11111111.11111111.11100000₂,包含27个1,因此斜线记法为/27。块大小为2⁵ = 32(因为剩余5个主机位)。
is 192.168.1.0/27. The broadcast address is one less than the next network boundary: 192.168.1.31. First usable host: 192.168.1.1; last usable host: 192.168.1.30.
网络地址:找出刚好小于25的32的倍数 → 0。因此网络为192.168.1.0/27。广播地址是下一个网络边界减1:192.168.1.31。第一个可用主机:192.168.1.1;最后一个可用主机:192.168.1.30。
| Address Type | Dotted Decimal |
|---|---|
| Network | 192.168.1.0 |
| First Host | 192.168.1.1 |
| Last Host | 192.168.1.30 |
| Broadcast | 192.168.1.31 |
The table above summarises the usable range. All addresses from 192.168.1.1 to 192.168.1.30 can be assigned to devices; 192.168.1.0 and 192.168.1.31 are reserved.
上表总结了可用地址范围。从192.168.1.1到192.168.1.30之间的地址均可分配给设备;192.168.1.0和192.168.1.31保留。
3. Combinational Logic: Half Adder | 组合逻辑:半加器
Question 3: A half adder takes two single‑bit inputs A and B. (a) Complete the truth table for outputs Sum (S) and Carry (C). (b) Use a Karnaugh map to obtain simplified Boolean expressions for S and C. (c) Draw the logic circuit using standard gates.
问题3:半加器接收两个单比特输入A和B。(a) 完善输出Sum (S) 和Carry (C) 的真值表。(b) 使用卡诺图推导S和C的简化布尔表达式。(c) 绘制使用标准逻辑门的电路图。
Truth table:
| A | B | S | C |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
真值表如上。
Karnaugh map for S
Published by TutorHao | Year 12 Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图