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

IB & WJEC Computer Science: Calculation Practice Special Training | IB 与 WJEC 计算机科学:计算题专项训练

2026-07-13 14:30 · 本文部分内容由AI辅助创作

📚 IB & WJEC Computer Science: Calculation Practice Special Training | IB 与 WJEC 计算机科学:计算题专项训练

Welcome to this focused calculation practice for IB and WJEC Computer Science. Calculation problems appear across the syllabus, from data representation and Boolean logic to computer architecture and algorithms. This guide will walk you through essential question types, provide step-by-step solutions, and reinforce key formulas. Consistent practice is the best way to build speed and confidence for exams.

欢迎来到 IB 和 WJEC 计算机科学计算题专项训练。计算题遍布整个教学大纲,从数据表示、布尔逻辑到计算机体系结构和算法。本指南将带你练习核心题型,给出逐步解答并巩固关键公式。持续练习是提高解题速度和应考信心的重要途径。

1. Number Base Conversions | 进制转换计算

In computer science, binary, denary (decimal), and hexadecimal systems are fundamental. You must be able to convert between these bases quickly and accurately. Typical exam tasks ask you to convert a given number from one base to another, showing working.

在计算机科学中,二进制、十进制和十六进制是最基础的数制。你必须能够快速准确地在这些进制之间进行转换。典型的考题会要求你将一个数从一种进制转换为另一种进制,并展示计算过程。

Example 1: Convert the denary number 202 to binary and hexadecimal.

示例 1:将十进制数 202 转换为二进制和十六进制。

To convert 202₁₀ to binary, repeatedly divide by 2 and record remainders:

将 202₁₀ 转换为二进制,重复除以 2 并记录余数:

DivisionQuotientRemainder
202 ÷ 21010
101 ÷ 2501
50 ÷ 2250
25 ÷ 2121
12 ÷ 260
6 ÷ 230
3 ÷ 211
1 ÷ 201

Reading the remainders from bottom to top gives 11001010₂.

从下往上读余数,得到 11001010₂。

ets of four from the right: 1100 1010₂. 1100₂ = C₁₆, 1010₂ = A₁₆. Therefore, 202₁₀ = CA₁₆.

转换为十六进制时,从右侧开始每四位二进制分为一组:1100 1010₂。1100₂ = C₁₆,1010₂ = A₁₆。因此 202₁₀ = CA₁₆。

Example 2: Convert the hexadecimal number 1F₆ to binary and denary.

示例 2:将十六进制数 1F₆ 转换为二进制和十进制。

Thus, 1F₁₆ = 0001 1111₂ (or simply 11111₂). Denary value: 1×16¹ + 15×16⁰ = 16 + 15 = 31₁₀.

每一位十六进制数字转换为 4 位二进制:1₁₆ = 0001₂,F₁₆ = 1111₂。因此 1F₁₆ = 00011111₂(或 11111₂)。十进制值:1×16¹ + 15×16⁰ = 16 + 15 = 31₁₀。


2. Binary Arithmetic & Two's Complement | 二进制算术与补码

es: 0+0=0, 0+1=1, 1+0=1, 1+1=0 with a carry of 1. Subtraction is often performed using two's complement representation to avoid building a separate subtraction circuit.

二进制加法遵循简单规则:0+0=0,0+1=1,1+0=1,1+1=0 并向高位进 1。减法通常使用补码表示来实现,以避免设计独立的减法电路。

Example: Using 8-bit two's complement, perform 12 - 7.

示例:使用 8 位补码计算 12 - 7。

express both numbers in binary: 12 = 0000 1100₂, 7 = 0000 0111₂. To subtract, add the two's complement of 7 to 12. The two's complement of 7: invert bits → 1111 1000₂, then add 1 → 1111 1001₂.

首先用二进制表示两个数:12 = 0000 1100₂,7 = 0000 0111₂。要计算 12 - 7,将 7 的补码与 12 相加。7 的补码:按位取反 → 1111 1000₂,再加 1 → 1111 1001₂。

esult is 0000 0101₂ = 5₁₀. Correct. Also note that negative numbers are represented in two's complement form directly. For instance, -5 in 8-bit two's complement: 5 = 00000101₂ → invert → 11111010₂ → add 1 → 11111011₂.

相加:0000 1100₂ + 1111 1001₂ = (1) 0000 0101₂。舍去第 9 位进位,结果为 0000 0101₂ = 5₁₀,计算正确。负数直接用补码表示,例如 -5 的 8 位补码:5 = 00000101₂ → 取反 → 11111010₂ → 加 1 → 11111011₂。

When adding, watch for overflow. Overflow occurs when two numbers with the same sign produce a result with a different sign. E.g., 120 + 105 in 8-bit two's complement would overflow because the actual sum exceeds +127.

做加法时要注意溢出。当两个同号数相加结果符号相反时发生溢出。例如 8 位补码中 120 + 105 就会溢出,因为实际和超过 +127。


广告 / Sponsored

3. Floating Point Representation | 浮点数表示

Floating point numbers are used to represent real numbers with a wide range. In IB and WJEC courses, you may be required to manually convert a decimal number into a simplified floating point format or into IEEE 754 single precision (32-bit).

浮点数用于表示具有较宽范围的实数。在 IB 和 WJEC 课程中,你可能会被要求手动将十进制数转换为简化的浮点格式或 IEEE 754 单精度(32 位)格式。

Example: Represent the decimal number -10.625 in IEEE 754 single precision.

示例:用 IEEE 754 单精度表示十进制数 -10.625。

ary. 10 = 1010₂, 0.625 × 2 = 1.25 → 1, 0.25×2=0.5→0, 0.5×2=1.0→1. So 10.625₁₀ = 1010.101₂.

步骤 1:将绝对值转换为二进制。10 = 1010₂,0.625 × 2 = 1.25 → 1,0.25×2=0.5→0,0.5×2=1.0→1。所以 10.625₁₀ = 1010.101₂。

Step 2: Normalize to 1.M × 2E is 3. IEEE 754 uses a bias of 127, so the stored exponent = 3 + 127 = 130₁₀ = 1000 0010₂.

步骤 2:规格化为 1.M × 2E。1010.101₂ = 1.010101₂ × 2³。真实指数为 3。IEEE 754 使用偏置值 127,存储的指数 = 3 + 127 = 130₁₀ = 1000 0010₂。

without the leading 1: 01010100000000000000000 (pad to 23 bits). Sign bit = 1 (negative).

步骤 3:取出尾数(小数部分,去掉前导 1):01010100000000000000000(补足 23 位)。符号位 = 1(负数)。

Final 32-bit representation: 1 | 10000010 | 01010100000000000000000 → in hex: C2AA0000₁₆.

最终 32 位表示:1 | 10000010 | 01010100000000000000000 → 十六进制:C2AA0000₁₆。

You may also be asked to convert back from a binary floating point pattern to decimal. Always separate sign bit, biased exponent, and mantissa, then compute value as (-1)s × 1.M × 2e-bias.

你可能还会被要求将二进制浮点模式转换回十进制。务必分离符号位、偏置指数和尾数,然后按 (-1)s × 1.M × 2e-bias 计算数值。


4. Logic Gate Calculations & Boolean Simplification | 逻辑门计算与布尔化简

Boolean algebra and logic gate calculations are central to digital logic. Exam questions often require simplification of expressions, drawing circuits, or calculating the output of a given gate network.

布尔代数和逻辑门计算是数字逻辑的核心。考试题目常要求化简表达式、绘制电路图或计算给定门网络的输出。

Example 1: Simplify the Boolean expression A·B + A·¬B using algebraic laws.

示例 1:使用代数定律化简布尔表达式 A·B + A·¬B。

Factor out A: A·(B + ¬B) = A·1 = A. This is a simple application of the complement law.

提取公因子 A:A·(B + ¬B) = A·1 = A。这是互补律的简单应用。

Example 2: Use a Karnaugh map to simplify F(A,B,C) = Σ(0,1,2,4).

示例 2:用卡诺图化简 F(A,B,C) = Σ(0,1,2,4)。

A 3-variable K-map groups minterms. The map:

BC\A01
001 (m0)1 (m4)
011 (m1)0 (m5)
110 (m3)0 (m7)
101 (m2)0 (m6)

Groups: an octet? No. We can form one group of four (0,1,4,5?) but minterm 5 is 0, so check carefully. Actually minterms 0,1,2,4. (0,1) give ¬A·¬B (since A=0, B=0 and C=0,1). (0,4) give ¬B·¬C? Group (2) is A=0, B=1, C=0: ¬A·B·¬C. Better grouping: group (0,1) → ¬A·¬B; group (0,4) → ¬B·¬C; group (2) isolated? That's not efficient. The correct grouping is pair (0,1) covering ¬A·¬B, pair (0,4) covering ¬B·¬C, pair (0,2) covering ¬A·¬C? Actually minterms: 0 (000), 1 (001), 2 (010), 4 (100). The optimal simplification is F = ¬A·¬B + ¬B·¬C + ¬A·¬C? Check duplication. Using K-map, we can group 0-1 (vertical pair: ¬A·¬B), group 0-2 (horizontal pair: ¬B·¬C? Wait, 0 (00) and 2 (10) differ in A, so ¬B·¬C? 0: B=0, C=0; 2: B=1, C=0; inconsistent. So not that. Actually correct grouping: (0,1) → ¬A·¬B (A=0,B=0); (4,0?) cell 4 is A=1,B=0,C=0, cell 0 is A=0,B=0,C=0 → they differ in A, so ¬B·¬C correct (both B=0,C=0). Thus group (0,4) gives ¬B·¬C. Left with minterm 2: A=0,B=1,C=0. Can it combine? With 0? 0 (000) and 2 (010) differ in B, so ¬A·¬C? Yes A=0,C=0 → ¬A·¬C covers both 0 and 2. So combined groups: (0,4) → ¬B·¬C, (0,1) → ¬A·¬B, (0,2) → ¬A·¬C. But this covers all? 0 appears three times, okay. The simplified expression: F = ¬B·¬C + ¬A·¬B

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

广告 / Sponsored
IBDP国际文凭计算机科学学生用书 高级及标准水平 Computer Science for the IB Diplo…
计算机 备考教辅 · 正版现货 · 与本文内容相关
查看详情 / View on Taobao参考价 ¥524.0

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

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