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

IB Computer Science: Calculation Drill | IB 计算机:计算题专项训练

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

📚 IB Computer Science: Calculation Drill | IB 计算机:计算题专项训练

IB Computer Science examinations often include numerical questions that test your ability to apply concepts precisely – from binary arithmetic to algorithm efficiency. This article presents a structured drill covering the most common calculation-based topics, complete with worked examples and step-by-step reasoning.

IB 计算机科学考试中常出现需要精确计算的应用题,涉及二进制运算、算法效率等。本文提供一套结构化的计算题专项训练,涵盖最常见题型,并配有详细示例与步骤讲解,帮助你在计算类题目上稳拿分数。


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

To convert a binary number to hexadecimal, group the bits into nibbles of four starting from the right (least significant bit). Each group is then replaced by its hex digit equivalent.

将二进制数转换为十六进制,从右侧最低位开始将二进制位每4位分为一组,每一组用对应的十六进制数字替换。

mple: Convert 11010110₂ to hex. Group as 1101 0110. 1101₂ = D₁₆, 0110₂ = 6₁₆, giving D6₁₆.

示例:将 11010110₂ 转为十六进制。分组为 1101 和 0110。1101₂ = D₁₆,0110₂ = 6₁₆,结果为 D6₁₆。

To convert hexadecimal to binary, reverse the process: replace each hex digit with its 4‑bit binary equivalent. For instance, A3₁₆ = 1010 0011₂.

将十六进制转为二进制则反向操作:每个十六进制数字替换为对应的4位二进制。例如 A3₁₆ = 1010 0011₂。

6 r1, 6 ÷ 2 = 3 r0, 3 ÷ 2 = 1 r1, 1 ÷ 2 = 0 r1. Reading remainders upwards gives 110101₂.

十进制转二进制采用除2取余法。53₁₀ 转二进制:53 ÷ 2 = 26 余1,26 ÷ 2 = 13 余0,13 ÷ 2 = 6 余1,6 ÷ 2 = 3 余0,3 ÷ 2 = 1 余1,1 ÷ 2 = 0 余1。余数从下往上读得 110101₂。


2. Two’s Complement Representation | 补码表示与运算

In an 8‑bit two’s complement system, the most significant bit indicates the sign (0 for positive, 1 for negative). The representable range is −128 to +127.

在8位补码系统中,最高位表示符号(0正1负),可表示范围为 −128 至 +127。

bits, then add 1. For −23: magnitude 23 = 00010111₂, invert → 11101000, add 1 → 11101001₂.

求负整数的补码:先写出其绝对值的二进制,所有位取反后加1。如 −23:绝对值 23 = 00010111₂,取反得 11101000,加1得 11101001₂。

h overflow ignored if it falls outside the representable range. For example, −35 + 22 in 8‑ (MSB=1); to check its magnitude, invert and add 1 → 00001101₂ = 13, so the result is −13.

补码加法按普通二进制加法规则进行,超出表示范围的溢出忽略。例如 −35 + 22 在8位系统:−35 为 11011101₂,22 为 00010110₂,和为 11110011₂。结果为负(最高位1),验证其值:取反加1得 00001101₂ = 13,故结果为 −13。


广告 / Sponsored

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

(A AND B) OR (NOT C), a truth table exhaustively lists all input combinations and calculates the output.

对于给定的布尔表达式,如 F = (A AND B) OR (NOT C),真值表列出所有输入组合并计算相应的输出。

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

The truth table shows that F is 1 when C is 0, regardless of A and B, or when both A and B are 1 while C is 1. This is a typical pattern that can be simplified using a Karnaugh map.

真值表表明,当 C 为 0 时无论 A、B 取值 F 都为 1,此外在 C=1 且 A=B=1 时 F 也为 1。这是可用卡诺图化简的典型模式。


4. Boolean Algebra Simplification | 布尔代数化简

The absorption law states A + A·B = A. Proof: A + A·B = A·(1 + B) = A·1 = A.

吸收律:A + A·B = A。证明:A + A·B = A·(1 + B) = A·1 = A。

A + A·C + B·A + B·C = A + A·C + A·B + B·C. Then factor A: = A·(1 + C + B) + B·C = A + B·C.

化简 (A + B)(A + C)。展开

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