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

Binary Numbers in IGCSE CCEA Computer Science | IGCSE CCEA 计算机:二进制考点精讲

2026-07-15 00:10 · 本文部分内容由AI辅助创作

📚 Binary Numbers in IGCSE CCEA Computer Science | IGCSE CCEA 计算机:二进制考点精讲

In IGCSE Computer Science, understanding the binary number system is essential. Computers use binary (base‑2) to represent all data and instructions, as their circuits rely on two stable states – on and off. This article covers the key concepts required for the CCEA specification, from converting between number bases and performing binary arithmetic to representing negative numbers and characters. Mastering these fundamentals will prepare you to tackle exam questions confidently.

在 IGCSE 计算机科学中,理解二进制是基础。计算机使用二进制(基数为2)来表示所有数据和指令,因为其电路依赖两种稳定状态——开和关。本文涵盖了 CCEA 考纲所需的关键概念,从不同数制之间的转换、二进制算术运算,到负数表示和字符编码。掌握这些基本原理将帮助你从容应对考试题目。


1. Why Binary? | 为什么使用二进制?

All modern computers are digital systems built from logic gates, which operate with two distinct voltage levels. A high voltage represents a logic '1' and a low voltage a logic '0'. This two‑state system is highly reliable because it is resistant to noise and easy to implement with transistors. Using binary allows data to be stored, processed and transmitted error‑free in complex circuits.

所有现代计算机都是由逻辑门构成的数字系统,逻辑门用两个截然不同的电压电平来工作。高电平代表逻辑“1”,低电平代表逻辑“0”。这种双态系统具有很高的可靠性,因为它抗干扰能力强,容易用晶体管实现。使用二进制能让数据在复杂电路中无误地存储、处理和传输。

Because any piece of information – numbers, text, images, sound – can be encoded as patterns of 0s and 1s, binary forms the universal language of computing. The simplicity of base‑2 arithmetic further simplifies the design of the processor's arithmetic logic unit (ALU).

因为任何信息——数字、文本、图像、声音——都可以编码为由 0 和 1 组成的模式,二进制便成了计算的通用语言。二进制算术的简便性也简化了处理器算术逻辑单元(ALU)的设计。


2. Bits, Nibbles, Bytes and Beyond | 位、半字节、字节及更大单位

The smallest unit of data in computing is a binary digit (bit), which can hold either a 0 or a 1. A group of four bits is called a nibble, and a group of eight bits is a byte resent 2⁸ = 256 different values, which is sufficient for one character in ASCII encoding.

计算中最小的数据单位是二进制位(bit),只能取值 0 或 1。四个位组成一个半字节,八个位组成一个字节。一个字节可以表示 2⁸ = 256 种不同的值,这足以表示 ASCII 编码中的一个字符。

Larger units are built from bytes: a kibibyte (KiB) is 2¹⁰ bytes (1024 bytes), a mebibyte (MiB) the decimal equivalents (e.g. kilobyte ≈ 1000 bytes) and be able to convert between them.

更大的单位由字节组成:kibibyte (KiB) 为 2¹⁰ 字节(1024 字节),mebibyte (MiB) 为 2²⁰ 字节,以此类推。考试中你需要了解这些二进制前缀,以及它们的十进制对应(例如 kilobyte ≈ 1000 字节),并能在它们之间进行换算。

UnitSizePower of 2
1 bit0 or 12⁰
1 nibble4 bits2²
1 byte8 bits2³
1 KiB1024 bytes2¹⁰

3. Binary to Denary Conversion | 二进制转换为十进制

To convert a binary integer to denary (base‑ multiply each bit by its column value and sum the results. For example, the binary number 1101₂ has the columns 8, 4, 2, 1. Adding the values where bits are 1 gives 8 + 4 + 1 = 13₁₀.

将二进制整数转换为十进制时,从右向左写出以 2⁰ = 1 开始的 2 的幂作为列权值。然后将每一位乘以其列值,再将结果相加。例如,二进制数 1101₂ 的列值为 8, 4, 2, 1。将位为 1 的权值相加得到 8 + 4 + 1 = 13₁₀。

For fractional binary numbers (covered in some specifications), the place values continue with negative powers of two: 0.5, 0.25, 0.125, etc. Always work systematically from left to right and check your total.

对于二进制小数(部分考纲涉及),权值继续使用 2 的负次幂:0.5、0.25、0.125 等。始终从左到右有条理地进行计算,并检查总和。


4. Denary to Binary Conversion | 十进制转换为二进制

The most reliable method is successive division by 2. Divide the denary number by 2, record the remainder (0 or 1), then repeat the division on the quotient. Continue until the quotient becomes 0. Reading the remainders from bottom to top gives the binary equivalent. For example, to convert 29₁₀:

最可靠的方法是连续除以 2 取余。将十进制数除以 2,记录余数(0 或 1),然后对商重复此操作。持续到商为 0。从下往上读取余数即得二进制数。以 29₁₀ 为例:

Reading up: 11101₂. Always verify by converting back using the method from Section 3.

从下往上读得:11101₂。务必用第 3 节的方法转换回去加以验证。

When working with a fixed number of bits (e.g. 8 bits), you may need to pad the leftmost side with leading zeros until the required length is reached, e.g. 29 in 8 bits is 00011101.

当使用固定的位数(如 8 位)时,可能需要在左侧填充前导零,直到达到要求长度,例如 29 的 8 位二进制表示为 00011101。


5. Hexadecimal Number System | 十六进制数系统

Hexadecimal (base‑16) provides a compact way to represent binary values. One hex digit represents four bits (a nibble). The digits are 0–9 followed by A (10) to F (15). For instance, 1010₂ = A₁₆ and 1111₂ = F₁₆.

十六进制(基数为 16)为表示二进制值提供了一种紧凑的方式。一位十六进制数字代表四个二进制位(一个半字节)。数字为 0–9 以及 A(10)到 F(15)。例如,1010₂ = A₁₆,1111₂ = F₁₆。

To convert binary to hex, split the binary number into groups of four bits from the right, then convert each group. To convert hex to denary, multiply each digit by its place value (powers of 16) and sum. For example, 2F₁₆ = 47₁₀. Hex is widely used to represent memory addresses, colour codes and error messages.

将二进制转换为十六进制时,从右向左每四位一组划分二进制数,然后分别转换每一组。将十六进制转换为十进制时,将每一位乘以其权值(16 的幂)并求和。例如 2F₁₆ = (2 × 16) + (15 × 1) = 47₁₀。十六进制广泛用于表示内存地址、颜色代码和错误信息。


广告 / Sponsored

6. Binary Addition | 二进制加法

Binary addition follows the same principles as denary addition, but the digits are limited to 0 and 1. The four basic rules are:

二进制加法遵循与十进制加法相同的原理,但数码只限于 0 和 1。四条基本规则为:

When adding two binary numbers, align them by the least significant bit (rightmost), add column by column, and record any carry. For example, adding 1011₂ (11) and 1110₂ (14):

当两个二进制数相加时,将它们按最低有效位(最右侧)对齐,逐列相加,并记录进位。例如,将 1011₂(11)和 1110₂(14)相加:

  1011
+ 1110
————
 11001

The result is 11001₂ (25). A carry can propagate across several columns, so work carefully and always check by converting to denary.

结果为 11001₂(25)。进位可能跨越多列传播,因此要仔细计算,并始终通过转换为十进制来检查。


7. Logical Shifts (Left and Right) | 逻辑移位(左移和右移)

Shifting the bits of a binary number left or right is a fast way to multiply or divide by powers of two. A logical left shift moves every bit one place to the left; the rightmost bit becomes 0. Each left shift multiplies the number by 2 (provided no overflow occurs). For example, 0011₂ (3) shifted left once becomes 0110₂ (6).

将二进制数的位向左或向右移动,是快速乘以或除以 2 的幂的一种方法。逻辑左移将每一位向左移动一位;最右边补 0。每左移一位相当于原数乘以 2(假设不发生溢出)。例如,0011₂(3)左移一位变成 0110₂(6)。

A logical right shift moves bits to the right; the leftmost bit becomes 0, and the bits at the right end drop off. Each right shift divides the integer by 2, ignoring any remainder. For unsigned numbers, this is efficient and widely used in low‑level programming.

逻辑右移将位向右移动;最左边补 0,右端的位移出。每右移一位相当于将整数除以 2,忽略余数。对于无符号数,这种操作高效,并广泛用于低级编程中。


8. Representing Negative Numbers with Two's Complement | 用二进制补码表示负数

In CCEA IGCSE, you must understand how negative integers are stored using two's complement. For an n‑bit system, the most significant bit (MSB) is used as a sign bit: 0 for positive, 1 for negative. To obtain the two's complement of a positive number (i.e. its negative), invert all bits (one's complement) and then add 1.

在 CCEA 的 IGCSE 考试中,你必须理解如何使用二进制补码存储负整数。在 n 位系统中,最高有效位用作符号位:0 为正,1 为负。要得到一个正数对应的补码(即它的负数),先按位取反(反码),然后再加 1。

For example, in an 8‑bit system, to represent –13: start with +13 = 00001101, flip all bits → 11110010, then add 1 → 11110011. Thus –13 is stored as 11110011. In two's complement, the range for 8 bits is –128 to +127.

例如,在 8 位系统中,表示 –13 的步骤:+13 = 00001101,全部取反 → 11110010,然后加 1 → 11110011。因此 –13 存储为 11110011。在 8 位补码系统中,可表示的范围是 –128 到 +127。

To convert back from two's complement to denary: if the MSB is 1, reverse the process (subtract 1 then invert bits) and interpret the resulting positive number, then add a minus sign. If MSB is 0, treat it as an ordinary binary number.

将补码转换回十进制时:若最高有效位为 1,则逆向操作(减 1 后按位取反),解读得到的结果为正数,然后加上负号。若最高有效位为 0,则当作普通二进制数处理。


9. Overflow Errors | 溢出错误

Overflow occurs when the result of an arithmetic operation requires more bits than are available in the allocated storage. In two's complement, overflow happens when adding two positive numbers yields a negative result, or two negative numbers yield a positive result. For example, in an 8‑bit system adding 120₁₀ (01111000) and 100₁₀ (01100100) gives 220₁₀, but the binary sum is 11011100, which in two's complement represents –36. The sign bit has changed incorrectly, indicating overflow.

当算术运算的结果需要的位数超出分配存储的位数时,就会发生溢出。在补码系统中,将两个正数相加得到负数,或将两个负数相加得到正数,都表明产生了溢出。例如,在 8 位系统中将 120₁₀(01111000)与 100₁₀(01100100)相加,应为 220₁₀,但二进制和为 11011100,在补码中表示 –36。符号位错误地变了,指示溢出。

Computers detect overflow by examining the carry into and out of the sign bit. When the carry‑in and carry‑out of the MSB differ, overflow has occurred. Programmers and hardware must handle overflow to prevent logic errors.

计算机通过检查符号位的进位进入和进位输出来检测溢出。当最高有效位的进位输入与进位输出不同时,便发生了溢出。程序员和硬件必须处理溢出,以避免逻辑错误。


10. Character Encoding and Binary | 字符编码与二进制

Computers store text as binary numbers using character sets. The ASCII (American Standard Code for Information Interchange) uses 7 bits to represent 128 characters – letters, digits, punctuation and control codes. For example, uppercase 'A' is 65₁₀ (1000001₂). Extended ASCII uses 8 bits to provide 256 codes, including accented and graphic characters.

计算机使用字符集将文本存储为二进制数。ASCII(美国信息交换标准码)使用 7 位表示 128 个字符——字母、数字、标点符号和控制码。例如,大写字母 'A' 的 ASCII 码为 65₁₀(1000001₂)。扩展 ASCII 使用 8 位提供 256 种代码,还包括带重音符号的字符和图形字符。

With the growth of global computing, Unicode was introduced to support all writing systems. UTF‑8, a variable‑length encoding, uses one to four bytes per character, maintaining backward compatibility with ASCII. Understanding these encodings helps you see how binary represents not just numbers but the entire digital world.

随着全球计算的发展,Unicode 被引入以支持所有书写系统。UTF‑8 是一种可变长度编码,每个字符使用一至四个字节,保持了与 ASCII 的向后兼容。了解这些编码有助于你理解二进制不仅表示数字,而且代表整个数字世界。


11. Exam Tips and Common Mistakes | 考试技巧与常见错误

When answering exam questions, always show your working clearly, especially in conversions and arithmetic. Label base subscripts (₂, ₁₀, ₁₆) to avoid confusion. A common mistake is to forget leading zeros when representing a number in a specific bit width – always pad to the required length.

回答考题时,务必清晰地展示计算步骤,尤其是在转换和运算中。给出基数下标(₂, ₁₀, ₁₆),以免混淆。一个常见错误是在用指定位数表示数时忘记前导零——务必补齐到要求长度。

Another pitfall is misreading the direction of left and right shifts: left is multiply, right is divide. When working with two's complement, check your arithmetic by adding the positive and negative value to see if they sum to zero (ignoring the carry out). Practise past‑paper questions regularly to build speed and accuracy.

另一个易错点是搞混左右移的方向:左乘右除。处理补码时,将正数与负数相加,看和是否为零(忽略进位输出),以验证计算。定期练习历年真题,提升解题速度与准确性。

Finally, remember that hexadecimal is only a shorthand – the computer still works in binary. Converting binary ↔ hex ↔ denary efficiently is a vital skill.

最后,记住十六进制只是简写形式——计算机依然以二进制工作。熟练地进行二进制 ↔ 十六进制 ↔ 十进制的转换是一项关键技能。


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

广告 / Sponsored
现货 Cambridge International AS & ALevel IT Coursebook剑桥国际IGC…
计算机 备考教辅 · 正版现货 · 与本文内容相关
查看详情 / View on Taobao参考价 ¥467.0

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

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