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

GCSE CIE Computer Science: Binary In-Depth Revision | GCSE CIE 计算机:二进制考点精讲

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

📚 GCSE CIE Computer Science: Binary In-Depth Revision | GCSE CIE 计算机:二进制考点精讲

In GCSE CIE Computer Science, the topic of binary underpins everything else you will learn. From how data is stored and processed to the way computers solve problems, a solid grasp of binary numbers, conversions, addition, overflow, and logical shifts is absolutely essential. This guide walks you through every key point in the syllabus with clear explanations, worked examples, and common exam traps to avoid.

在 GCSE CIE 计算机科学中,二进制这一主题是你所学一切的基础。从数据的存储和处理方式,到计算机解决问题的方法,扎实掌握二进制数、转换、加法、溢出和逻辑移位等知识至关重要。本指南将通过清晰的解释、实例讲解以及常见的考试陷阱,带你逐一攻克大纲中的每一个要点。


1. Why Computers Use Binary | 为什么计算机使用二进制

Computers are built from billions of tiny switches called transistors, which can only be in one of two states: ON or OFF. These two states naturally map to the digits 1 and 0, making binary the simplest and most reliable way to represent data electronically. Using binary reduces errors caused by voltage fluctuations and allows logic gates to perform calculations using Boolean algebra.

计算机由数十亿个称为晶体管的微型开关构成,这些开关只能处于两种状态之一:开或关。这两种状态自然对应数字 1 和 0,使得二进制成为电子表示数据的最简单、最可靠的方式。使用二进制可以降低电压波动引起的错误,并使逻辑门能够利用布尔代数进行计算。

All data inside a computer — numbers, text, images, sound, and program instructions — is ultimately stored and processed as sequences of binary digits (bits). Therefore, understanding binary is the first step towards understanding how computers work at the hardware level.

计算机内部的所有数据——数字、文本、图像、声音和程序指令——最终都以二进制数字(比特)序列的形式存储和处理。因此,理解二进制是理解计算机硬件工作原理的第一步。


2. The Binary Number System | 二进制数系统

The binary system is a base‑2 number system that uses only two digits: 0 and 1. Each digit in a binary number represents an increasing power of 2, starting from 2⁰ (1) on the far right. This is exactly the same principle as decimal (base‑10), except the place values are powers of 2 instead of powers of 10.

二进制系统是基数为 2 的数字系统,仅使用两个数字:0 和 1。二进制数中的每一位代表 2 的递增幂,从最右侧的 2⁰(1)开始。这与十进制(基数为 10)的原理完全相同,只是位值是 2 的幂而不是 10 的幂。

For example, the 8‑bit binary number 10011011 can be expanded as:

例如,8 位二进制数 10011011 可以展开为:

1×2⁷ + 0×2⁶ + 0×2⁵ + 1×2⁴ + 1×2³ + 0×2² + 1×2¹ + 1×2⁰

Bit position76543210
Place value1286432168421
Example bit10011011

In the CIE exam you will often work with 8‑bit registers, so memorising the binary place values from 1 to 128 is strongly recommended. For 8‑bit numbers, the range of unsigned integers is 0 to 255 (2⁸ − 1).

在 CIE 考试中,你常常会用到 8 位寄存器,所以强烈建议记住 1 到 128 的二进制位值。对于 8 位无符号整数,其范围是 0 到 255(2⁸ − 1)。


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

To convert a binary number to decimal, simply add up the place values where a 1 appears. The quickest method is to write the place values above each bit and add the ones that align with a 1.

要将二进制数转换为十进制,只需将出现 1 的位值相加。最快的方法是在每位上方写出位值,然后将与 1 对齐的位值相加。

Example: Convert 01010110 to decimal.

示例:将 01010110 转换为十进制。

gnoring the leading zero, the bits with 1 are at 64, 16, 4, 2. Sum = 64 + 16 + 4 + 2 = 86.

位值(从左到右):128、64、32、16、8、4、2、1。忽略前导零,出现 1 的位是 64、16、4、2。总和 = 64 + 16 + 4 + 2 = 86。

Be careful not to include place values where the bit is 0. In the exam, show your working clearly: writing the place values above the binary string helps avoid silly mistakes.

注意不要包含位值为 0 的项。在考试中,要清晰地展示你的计算过程:在二进制数字上方写出位值有助于避免低级错误。


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

There are two common methods taught for converting decimal to binary; both are acceptable in CIE exams. The first method involves repeatedly subtracting the largest possible power of 2 that fits, placing a 1 under that place value and moving to the remainder. The second method uses successive division by 2, reading the remainders backwards.

将十进制转换为二进制有两种常用方法,CIE 考试中两种都可以接受。第一种方法是反复减去能容纳的最大 2 的幂,在该位值下写 1,然后对余数重复操作。第二种方法是用连续除以 2 取余数,然后反向读取余数。

6 is 4 → 1 at 4. Remainder 2 → 1 at 2. Fill remaining positions with 0. Result: 01010110.

86 的减法转换法:≤ 86 的最大幂是 64(2⁶)→ 在位值 64 处放 1。余数 22。 ≤ 22 的最大幂是 16 → 在位值 16 处放 1。余数 6。 ≤ 6 的最大幂是 4 → 在位值 4 处放 1。余数 2 → 在位值 2 处放 1。其余位置补 0。结果:01010110。

Always check your answer by reconverting to decimal. For 8‑bit representations, make sure you pad with leading zeros to reach exactly 8 bits.

始终通过重新转换为十进制来检查你的答案。对于 8 位表示,请确保用前导零补足到正好 8 位。


5. Hexadecimal Representation | 十六进制表示法

Hexadecimal (base‑16) is used extensively in computing as a more compact and human‑friendly way to represent binary numbers. The digits are 0‑9 followed by A (10), B (11), C (12), D (13), E (14), F (15). Each hex digit neatly corresponds to exactly 4 bits (a nibble), so an 8‑bit number can be expressed with just two hex digits.

十六进制(基数为 16)在计算领域被广泛使用,作为一种更紧凑、更易于人类阅读的二进制表示方式。十六进制数字为 0‑9 之后是 A(10)、B(11)、C(12)、D(13)、E(14)、F(15)。每个十六进制数字正好对应 4 位(一个半字节),因此一个 8 位数字可以用两个十六进制数字表示。

frequently ask you to convert between binary, decimal, and hexadecimal. Practice splitting binary numbers into groups of 4 starting from the right.

例如,二进制 1101 0110 用十六进制表示为 D6:1101 = 13 = D,0110 = 6。CIE 考试经常要求你在二进制、十进制和十六进制之间进行转换。练习从右边开始将二进制数分成 4 位一组。

Hexadecimal is especially useful for memory addresses, colour codes (e.g. #FF0000 for red), and machine code, all of which you will encounter later in the course.

十六进制对于内存地址、颜色代码(例如红色的 #FF0000)以及机器代码特别有用,这些你都会在课程后续部分遇到。


6. Binary Addition and Overflow | 二进制加法与溢出

Binary addition follows rules similar to decimal addition, but only the digits 0 and 1 are used. The four basic rules are:

二进制加法的规则与十进制加法类似,但只使用数字 0 和 1。四条基本规则是:

When adding two 8‑bit numbers, the result might need more than 8 bits to be represented correctly. If the result exceeds 255 (the maximum for unsigned 8‑bit), an overflow error occurs. In CIE exams, you must be able to identify overflow and explain that it means the sum is too large for the available number of bits.

当两个 8 位数字相加时,结果可能需要超过 8 位才能正确表示。如果结果超过 255(8 位无符号数的最大值),就会发生溢出错误。在 CIE 考试中,你必须能够识别溢出,并解释这意味着和太大,超出了可用位数所能表示的范围。

Example: 10101010 (170) + 10010110 (150). Addition gives 101000000, which is 9 bits. The leftmost 1 overflows, leaving 01000000 (64). This is incorrect unless a carry flag is used. In a register‑based question, stating that an overflow occurred and explaining the consequence is a typical 2‑mark answer.

示例:10101010(170)+ 10010110(150)。相加得到 101000000,共 9 位。最左边的 1 溢出,剩下 01000000(64)。除非使用了进位标志,否则这个结果不正确。在关于寄存器的题目中,说明发生了溢出并解释其后果是一个典型的 2 分答案。


广告 / Sponsored

7. Unsigned and Two’s Complement Representation | 无符号与二进制补码表示法

So far we have treated binary as unsigned, meaning all numbers are positive. However, computers need to represent negative integers as well. CIE introduces two’s complement for signed 8‑bit numbers. In two’s complement, the most significant bit (MSB) acts as a sign bit: 0 for positive, 1 for negative. The value is computed as −(MSB value) + sum of remaining positive bits.

到目前为止,我们一直将二进制视为无符号数,即所有数字都是正数。但是,计算机也需要表示负整数。CIE 引入了 8 位有符号数用的二进制补码表示法。在二进制补码中,最高有效位(MSB)作为符号位:0 表示正数,1 表示负数。该数的值通过 −(MSB 的值) 加上其余各位的正值来计算。

For an 8‑ 16 + 4 = −108. Positive numbers have the same representation as unsigned. The range for 8‑bit two’s complement is −128 to +127.

对于 8 位二进制补码数,MSB 表示 −128,接下来是 64、32……一直到位值 1。因此 10010100 等于 −128 + 16 + 4 = −108。正数的表示方式与无符号数相同。8 位二进制补码的范围是 −128 到 +127。

You must be able to convert a negative integer to two’s complement using the method of writing the positive binary, inverting all bits, then adding 1. CIE often asks you to show how a negative number would be stored in a register.

你必须能够使用“写出正数二进制、将所有位取反、然后加 1”的方法,将一个负整数转换为二进制补码。CIE 经常要求你展示一个负数在寄存器中的存储方式。


8. Logical Shifts (Left and Right) | 逻辑移位(左移与右移)

A logical shift moves every bit in a register one or more places to the left or right. Zeros fill the vacated positions. Shifting left by one position is equivalent to multiplying the unsigned number by 2. Shifting right by one position is equivalent to performing integer division by 2, discarding any remainder.

逻辑移位将寄存器中的每一位整体向左或向右移动一个或多个位置。空出的位置用零填充。左移一位相当于无符号数乘以 2。右移一位相当于整数除以 2,舍弃余数。

For example, 00101100 (44 decimal) left‑shifted once gives 01011000 (88). Right‑shifting 00101101 (45) once gives 00010110 (22) — the least significant 1 is lost, demonstrating integer division.

例如,00101100(十进制 44)左移一位得到 01011000(88)。将 00101101(45)右移一位得到 00010110(22)——最低位的 1 丢失,体现了整数除法。

CIE will test your understanding of how logical shifts can perform fast multiplication and division by powers of 2 without using complex circuitry. You should also be aware that a left shift can cause overflow if a 1 is shifted out of the MSB. The exam may ask you to predict the result after one or more shifts, including any bits lost.

CIE 会测试你对逻辑移位如何在不使用复杂电路的情况下,实现快速乘以或除以 2 的幂的理解。你还应该意识到,如果 1 从 MSB 移出,左移可能导致溢出。考试可能会要求你预测一次或多次移位后的结果,包括丢失的位。


9. Representing Characters: ASCII and Unicode | 表示字符:ASCII 与 Unicode

To store text, computers assign a unique binary code to each character. The most fundamental character set is ASCII (American Standard Code for Information Interchange), which originally used 7 bits to represent 128 characters, including English letters, digits, punctuation, and control codes. Extended ASCII uses 8 bits, covering 256 characters.

为了存储文本,计算机为每个字符分配一个唯一的二进制代码。最基本的字符集是 ASCII(美国信息交换标准代码),它最初使用 7 位来表示 128 个字符,包括英文字母、数字、标点符号和控制码。扩展 ASCII 使用 8 位,涵盖 256 个字符。

ASCII cannot represent characters from languages other than English, which is why Unicode was developed. Unicode uses up to 32 bits per character (common formats like UTF‑8 and UTF‑16 are variable‑length) and can encode over a million characters from all modern and historical scripts. In the CIE syllabus, you need to understand the need for larger character sets and why Unicode is superior for global use.

ASCII 无法表示英语以外的语言字符,这就是 Unicode 被开发出来的原因。Unicode 每个字符最多使用 32 位(常见的 UTF‑8 和 UTF‑16 等格式是可变长度的),可以编码来自所有现代和历史文字体系的一百多万个字符。在 CIE 教学大纲中,你需要理解对更大字符集的需求,以及为什么 Unicode 在全球范围使用时更优越。


10. Representing Images with Binary | 使用二进制表示图像

a grid of pixels. The colour of each pixel is stored as a binary number. In a simple black‑and‑white image, each pixel can be represented by a single bit — 256 colours per pixel. Modern true colour uses 24 bits (8 bits each for red, green, blue).

位图图像由像素网格构成。每个像素的颜色被存储为一个二进制数。在简单的黑白图像中,每个像素可以用一个位来表示——0 表示白色,1 表示黑色。在更复杂的图像中,颜色深度定义了每个像素使用的位数。例如,8 位的颜色深度允许每个像素有 2⁸ = 256 种颜色。现代真彩色使用 24 位(红、绿、蓝各 8 位)。

s often ask you to compute file sizes given image dimensions and colour depth, or to work backwards to find the number of colours. Moreover, you should understand that increasing resolution (more pixels) or colour depth (more bits per pixel) improves image quality but increases storage requirements.

未压缩的位图文件大小可以通过以下公式计算:宽度 × 高度 × 颜色深度(以位为单位)。CIE 题目常常要求你根据图像尺寸和颜色深度计算文件大小,或者反向推导出颜色数量。此外,你应该理解,增加分辨率(更多像素)或颜色深度(每像素更多位)可以提升图像质量,但会增加存储需求。


11. Representing Sound with Binary | 使用二进制表示声音

Sound is analogue by nature — a continuous wave of varying pressure. To store sound digitally, an Analogue‑to‑Digital Converter (ADC) samples the amplitude of the wave at regular intervals. Each sample is assigned a binary value based on the measured voltage. Two parameters are crucial: sampling rate (number of samples per second, measured in Hz) and bit depth (number of bits used to store each sample).

声音本质上是模拟的——它是一个连续变化的压力波。为了以数字方式存储声音,模拟数字转换器(ADC)会以固定的时间间隔对声波的振幅进行采样。每个采样根据测得的电压被赋予一个二进制值。两个关键参数是:采样率(每秒采样次数,以 Hz 为单位)和位深度(用于存储每个采样的位数)。

ccurate digital representation, but result in larger file sizes. The classic example is CD‑quality audio: 44.1 kHz sampling rate and 16‑ reo = 2). You should also be familiar with the term sample rate and how it relates to the number of possible amplitude values (2bit depth).

更高的采样率和更大的位深度可以产生更准确的数字表示,但会导致文件更大。经典例子是 CD 品质音频:44.1 kHz 的采样率和 16 位的位深度。CIE 考试可能会要求你计算声音文件的大小:采样率 × 位深度 × 持续时长(秒)× 声道数(例如,立体声 = 2)。你还应该熟悉术语“采样率”,以及它与可能的振幅值数量(2^位深度)之间的关系。


12. Common Exam Pitfalls and Tips | 常见考试陷阱与提示

Many students lose marks on binary questions through avoidable mistakes. Here are the most important pitfalls to watch for:

许多学生在二进制题目上因为可避免的错误而丢分。以下是最需要注意的陷阱:

Practice with past paper questions under timed conditions. Binary questions are often worth a lot of marks and can be secured with careful, methodical working. Always double‑check conversions by reversing them on your answer sheet.

在定时条件下练习历年真题。二进制题目往往分值很高,通过细致、有条理的计算可以确保得分。始终在答题纸上反向验算你的转换结果。

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

广告 / Sponsored
培生爱德思计算机科学学生用书教材Pearson Edexcel International GCSE Computer…
计算机 备考教辅 · 正版现货 · 与本文内容相关
查看详情 / View on Taobao参考价 ¥349.0

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

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