IGCSE Computer Science: Binary Revision Guide | IGCSE 计算机:二进制 考点精讲

📚 IGCSE Computer Science: Binary Revision Guide | IGCSE 计算机:二进制 考点精讲

Welcome to your focused revision guide on the binary system, a core topic in IGCSE Computer Science. Mastering binary is essential not only for your exams but for understanding how all digital devices process and store data. This guide walks through every key concept with clear explanations, worked examples, and exam‑focused tips.

欢迎阅读这篇 IGCSE 计算机科学二进制专题复习指南。二进制是整个课程的核心考点,也是理解数字设备如何处理与存储数据的基础。本文将通过清晰的解释、例题和应试技巧,带你梳理每一个关键概念。

1. Understanding Binary | 理解二进制

Binary is a base‑2 number system that uses only two digits: 0 and 1. All data inside a computer, from text to images, is ultimately represented using sequences of these bits. Every digital circuit relies on two states, often represented by high and low voltages, making binary the natural language of computers.

二进制是一种基数为 2 的数制,只使用 0 和 1 两个数码。计算机内部的所有数据,从文字到图像,最终都以二进制序列表示。每个数字电路都依赖两种状态(通常用高电平和低电平表示),因此二进制是计算机的天然语言。

A single binary digit is called a bit. A group of 8 bits forms a byte, which is a standard building block for measuring memory. Larger units include the kilobyte (1024 bytes), megabyte, gigabyte, and terabyte. The place values in binary are powers of 2: 1, 2, 4, 8, 16, and so on, starting from the rightmost bit.

一个二进制数字称为一个比特(bit)。8 个比特组成一个字节(byte),这是衡量存储容量的基本单位。更大的单位包括千字节(1024 字节)、兆字节、吉字节和太字节。二进制的位权是 2 的幂:从最右侧开始依次为 1, 2, 4, 8, 16……


2. Binary to Decimal Conversion | 二进制转十进制

To convert a binary number to decimal, write down the place values above each bit, then sum the place values where a 1 appears. For example, the binary number 1011₂ is evaluated as (1 × 8) + (0 × 4) + (1 × 2) + (1 × 1) = 11 in decimal.

将二进制数转换为十进制时,先写出每位对应的位权,然后将出现 1 的位权相加。例如,二进制数 1011₂ 的计算过程为 (1 × 8) + (0 × 4) + (1 × 2) + (1 × 1) = 11。

You can use a quick table for an 8‑bit number: place values are 128, 64, 32, 16, 8, 4, 2, 1. If a binary byte is 01101001, add 64 + 32 + 8 + 1 = 105. Always double‑check by verifying that the largest place value is not greater than the decimal total.

你可以用一个简单的 8 位表格来转换:位权依次为 128、64、32、16、8、4、2、1。如果一个字节是 01101001,就把 64 + 32 + 8 + 1 = 105。务必检查最大位权是否超过十进制结果,以避免错误。


3. Decimal to Binary Conversion | 十进制转二进制

The most reliable method is successive division by 2. Divide the decimal number by 2; record the remainder (0 or 1). Continue dividing the quotient by 2 until the quotient reaches 0. The binary number is the remainders read from bottom to top.

最可靠的方法是“除 2 取余法”:将十进制数除以 2,记录余数(0 或 1),再用商继续除以 2,直到商为 0。从下往上读余数,就得到二进制数。

For 8‑bit representation, add leading zeros to make up 8 bits. For instance, 29 in binary: 29 ÷ 2 = 14 r1, 14 ÷ 2 = 7 r0, 7 ÷ 2 = 3 r1, 3 ÷ 2 = 1 r1, 1 ÷ 2 = 0 r1 → bottom‑up gives 11101₂, so 8‑bit becomes 00011101₂. You can also use the “subtract largest power of 2” method, but successive division is often faster.

如果要表示成 8 位二进制,就在前面补零,凑足 8 位。例如 29 转二进制:29 ÷ 2 = 14 余 1,14 ÷ 2 = 7 余 0,7 ÷ 2 = 3 余 1,3 ÷ 2 = 1 余 1,1 ÷ 2 = 0 余 1 → 从下往上得到 11101₂,因此 8 位形式为 00011101₂。你也可以用“减去最大 2 的幂”方法,但除 2 取余通常更快。


4. Binary Addition | 二进制加法

Binary addition follows simple rules: 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 0 with a carry of 1. When you add two bits and the result is 2 (10₂), you write down 0 and carry 1 to the next higher place value. For 1 + 1 + carry‑in = 3 (11₂), write 1 and carry 1.

二进制加法的基本规则是:0 + 0 = 0,0 + 1 = 1,1 + 0 = 1,1 + 1 = 0 并向高位进 1。当两个比特相加结果为 2(即 10₂)时,本位置 0 并进位 1。如果遇到 1 + 1 + 进位 1 = 3(即 11₂),则本位置 1 并进位 1。

Let’s add 00101101 (45) and 00100110 (38). Working right to left: 1+0=1, 0+1=1, 1+1=0 carry 1, and so on. The result is 01010011 (83). Exam questions often ask for an 8‑bit result, so you must show all carries and indicate if an overflow occurs when sum exceeds 255.

我们来计算 00101101(45)+ 00100110(38)。从右向左:1+0=1,0+1=1,1+1=0 进位 1,依此类推。结果是 01010011(83)。考试题目通常要求给出 8 位结果,所以你要写出所有进位,并判断和是否超过 255 而产生溢出。


5. Overflow Error | 溢出错误

When the result of an addition requires more bits than the register size can hold, an overflow error occurs. In an 8‑bit system, the largest unsigned number is 11111111₂ = 255. If the sum exceeds 255, the extra carry beyond the most significant bit is lost, causing an incorrect result.

当加法结果超出寄存器所能容纳的位数时,就会发生溢出错误。在 8 位系统中,最大无符号数是 11111111₂ = 255。如果和超过 255,超出最高位的进位就会丢失,导致结果错误。

For example, 11111111₂ (255) + 00000001₂ (1) ideally gives 100000000₂ (256), but in an 8‑bit register only the lower 8 bits 00000000 are stored, and the carry flag is set. The CPU typically uses a status register to detect overflow, and programs may crash or produce unexpected behaviour if overflow is not handled.

例如,11111111₂(255)+ 00000001₂(1)理论上是 100000000₂(256),但在 8 位寄存器中只能保存低 8 位 00000000,同时进位标志被置位。CPU 通常通过状态寄存器来检测溢出,如果程序未处理溢出,可能会崩溃或产生意外结果。


6. Logical Shifts | 逻辑移位

A logical shift moves all bits to the left or right by a specified number of places, filling vacated positions with zeros. A logical left shift by one place multiplies the unsigned number by 2; a logical right shift by one place divides by 2 (integer division). These operations are extremely fast and are used for quick multiplication and division by powers of two.

逻辑移位将所有比特向左或向右移动指定的位数,空缺位置用 0 填充。逻辑左移一位相当于无符号数乘以 2;逻辑右移一位相当于除以 2(整数除法)。这些操作速度极快,常用于快速乘以或除以 2 的幂。

If we have 00101100 (44) and perform a left logical shift of 2 places, we get 10110000 (176). Note that a left shift can cause overflow if a 1 bit is shifted out of the most significant position. A right logical shift on 00101100 by 2 gives 00001011 (11), which is 44 ÷ 4 (integer division).

如果有 00101100(44),逻辑左移 2 位得到 10110000(176)。注意,如果左移时把最高位的 1 移出去了,就会发生溢出。对 00101100 逻辑右移 2 位得到 00001011(11),相当于 44 ÷ 4 的整数结果。


7. Two’s Complement | 二进制补码

To represent negative numbers, modern computers use two’s complement. In an 8‑bit system, the most significant bit (MSB) indicates the sign: 0 for positive, 1 for negative. To convert a positive number to negative, invert all bits and add 1. For example, +18 in 8‑bit is 00010010₂; -18 becomes 11101101 + 1 = 11101110₂.

现代计算机使用二进制补码来表示负数。在 8 位系统中,最高位(MSB)表示符号位:0 为正,1 为负。要将正数取负,先按位取反,然后加 1。例如,+18 的 8 位形式是 00010010₂;-18 就是 11101101 + 1 = 11101110₂。

With two’s complement, addition works the same regardless of sign. The range of an 8‑bit signed integer is from -128 (10000000₂) to +127 (01111111₂). When performing subtraction, you can negate the subtrahend and add. Always be careful with overflow in signed context: if two positive numbers add to produce a negative result, overflow has occurred.

采用补码后,无论正负,加法运算规则一致。8 位有符号整数的范围是从 -128(10000000₂)到 +127(01111111₂)。做减法时,可以把减数取补码后再相加。注意有符号数溢出:如果两个正数相加得到负数,就说明发生了溢出。


8. Hexadecimal Numbers | 十六进制

Hexadecimal (base‑16) uses digits 0‑9 and letters A‑F (representing 10‑15). It is widely used in computing because it compactly represents binary values: one hex digit corresponds exactly to four binary bits (a nibble). This makes reading and writing memory addresses, colour codes, and machine code much easier.

十六进制(基数为 16)使用数码 0‑9 和字母 A‑F(表示 10‑15)。它广泛用于计算机领域,因为一个十六进制位正好对应四个二进制位(一个半字节),可以紧凑地表示二进制值。这让内存地址、颜色代码和机器码的读写变得简单许多。

To convert binary to hex, split the binary number into groups of four bits starting from the right. For example, 11010110₂ → 1101 (D) and 0110 (6), so the hex value is D6. To convert hex to decimal, multiply each digit by its place value (16ⁿ) or use binary as an intermediate step.

将二进制转十六进制时,从右往左每 4 位分成一组。例如,11010110₂ → 1101 (D) 和 0110 (6),十六进制就是 D6。将十六进制转十进制时,可以按位权 16ⁿ 相乘,或者先转为二进制再转十进制。


9. Binary Representations of Data: Text | 数据的二进制表示:文本

Text characters are stored as binary codes using character sets like ASCII and Unicode. Standard ASCII uses 7 bits to represent 128 characters, including English letters, digits, and control codes. Extended ASCII uses 8 bits, allowing 256 characters, which includes some symbols and accented letters but still falls short for global scripts.

文本字符通过字符集(如 ASCII 和 Unicode)以二进制编码存储。标准 ASCII 使用 7 位比特表示 128 个字符,包括英文字母、数字和控制字符。扩展 ASCII 使用 8 位,能表示 256 个字符,包含部分符号和带重音字母,但仍无法覆盖全球所有文字。

Unicode was developed to solve this limitation. The most common encoding, UTF‑8, is variable‑length: it can use 1 to 4 bytes per character, ensuring compatibility with ASCII while supporting thousands of characters from all writing systems. In IGCSE, you should know that increasing the number of bits per character increases the storage space needed for text files.

Unicode 正是为了解决这一局限而制定的。最常用的编码 UTF‑8 是变长编码:每个字符可使用 1 到 4 字节,既兼容 ASCII,又支持全世界成千上万的书写系统。在 IGCSE 考试中,你需要知道:每个字符的位数越多,文本文件所需的存储空间就越大。


10. Binary Representations of Data: Images & Sound | 数据的二进制表示:图像与声音

Images are stored as bitmaps, where each pixel’s colour is represented by a binary code. The colour depth, measured in bits per pixel, determines how many distinct colours are available. For example, 1 bit gives 2 colours (black and white), 8 bits gives 256 colours, and 24 bits gives about 16.7 million colours. Higher resolution and colour depth improve quality but increase file size.

图像以位图形式存储,每个像素的颜色用一个二进制码表示。颜色深度(每像素比特数)决定了可用颜色的数量。例如,1 位有 2 种颜色(黑白),8 位有 256 种颜色,24 位约有 1670 万种颜色。更高的分辨率和颜色深度能提高画质,但会增大文件体积。

Sound is sampled at regular intervals, and each sample is stored as a binary number. The sample rate (e.g. 44.1 kHz) and bit depth (e.g. 16 bits) determine the quality and size of digital audio. A higher sample rate captures higher frequencies, and a greater bit depth captures finer volume levels. Together, they control the fidelity and storage requirements of the sound file.

声音通过定期采样,每个采样值存为二进制数。采样率(如 44.1 kHz)和位深度(如 16 位)决定了数字音频的质量和文件大小。更高的采样率能捕捉更高频率,更大的位深度则能表现更细腻的音量层次。这两者共同决定了音频文件的保真度和存储需求。


11. Common Pitfalls and Exam Tips | 常见错误与应试技巧

Students often forget to show working when converting numbers, which can cost marks even if the final answer is correct. Always write down place values, division remainders, or grouping steps. For binary addition, clearly note the carries; for two’s complement, show the inversion and +1 steps. In shift operations, explicitly state the effect (multiply/divide by 2ⁿ) and check for bit loss.

考生常常忘记在转换数值时写出过程,即使最终答案正确也可能丢分。务必写出位权、除法的余数过程或分组步骤。做二进制加法时,要清楚标出进位;做补码时,展示取反和加 1 的过程。在移位操作中,明确写出效果(乘以/除以 2ⁿ),并检查是否有比特丢失。

Pay close attention to the number of bits specified in the question. If it says “using 8‑bit two’s complement”, you must give exactly 8 bits. Use the correct terminology: bit, byte, nibble, kilobyte, overflow, logical shift, sample rate, etc. For extended response questions about text, image, or sound representation, link the concept to file size, quality, and practical trade‑offs.

仔细注意题目指定的位数。如果题目要求“使用 8 位补码”,就必须给出恰好 8 位。使用正确的术语:比特、字节、半字节、千字节、溢出、逻辑移位、采样率等。涉及文本、图像或声音表示的文字题,要把概念与文件大小、质量以及实际折衷联系起来作答。


12. Summary | 考点总结

Binary is the foundation of all data representation and processing in computer systems. You need to be fluent in converting between binary, denary, and hexadecimal, perform binary arithmetic, understand logical shifts, two’s complement, and recognise how text, images, and sound are encoded. Regular practice with past paper questions is the best way to build speed and accuracy.

二进制是计算机系统中所有数据表示和处理的基础。你需要熟练掌握二进制、十进制和十六进制之间的转换,会做二进制算术,理解逻辑移位和补码,并清楚文本、图像和声音的编码方式。通过多做历年真题来提升速度和准确度,是备考的最佳方法。


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

更多咨询请联系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