📚 Binary Fundamentals for AQA GCSE Computer Science | AQA GCSE 计算机:二进制考点精讲
Understanding the binary number system is the absolute foundation of GCSE Computer Science. Every piece of data a computer processes — whether it is a number, a character, a colour, or a sound — is ultimately represented and manipulated as a sequence of 1s and 0s. In the AQA specification, you are expected not only to convert between binary, denary, and hexadecimal, but also to perform binary arithmetic, explain how characters and images are stored, and describe how data compression works. This guide brings together all the essential binary topics you will meet in your exam, with clear explanations and practical examples.
理解二进制数制是 GCSE 计算机科学最根本的基础。计算机处理的每一条数据——无论是数字、字符、颜色还是声音——最终都以一串串 1 和 0 来表示和操作。在 AQA 考试大纲中,你不仅要能在二进制、十进制和十六进制之间进行转换,还要会做二进制算术,解释字符和图像是如何存储的,并描述数据压缩的原理。本指南汇集了你在考试中将碰到的所有二进制核心专题,并配有清晰的解释和实用示例。
1. Why Computers Use Binary | 为什么计算机使用二进制
Computers are built from billions of tiny electronic switches called transistors. Each transistor can be in one of two clear states: fully ON (representing a 1) or fully OFF (representing a 0). This two-state system is much more reliable than trying to detect multiple voltage levels. Using binary means circuits are simpler, less prone to errors, and capable of extremely fast switching. Everything in a computer, from the processor control unit to the memory cells, is designed around this on-off logic.
计算机由数十亿个称为晶体管的微小电子开关构成。每个晶体管可以处于两种明确状态之一:完全导通(表示 1)或完全截止(表示 0)。这种双态系统比尝试检测多个电压水平要可靠得多。使用二进制意味着电路更简单、更不易出错,并且能够实现极快切换。计算机中的一切,从处理器控制单元到存储单元,全都围绕着这种通断逻辑进行设计。
2. Binary and Denary Place Values | 二进制与十进制的位值
In denary (base 10), each column is worth ten times the column to its right: units, tens, hundreds, and so on. In binary (base 2), each column is worth twice the column to its right. The rightmost bit is the least significant bit (LSB) with a value of 2⁰ = 1. The next bit is 2¹ = 2, then 2² = 4, then 8, 16, 32, 64, 128, and so forth. An 8-bit binary number, such as 10110110, can be converted to denary by adding the place values where a 1 appears: 128 + 32 + 16 + 4 + 2 = 182.
在十进制(基数为 10)中,每一列是右边一列的十倍:个位、十位、百位等等。在二进制(基数为 2)中,每一列是右边一列的两倍。最右边的位是最低有效位(LSB),位值为 2⁰ = 1。下一位是 2¹ = 2,然后是 2² = 4,接着是 8、16、32、64、128 等等。一个 8 位二进制数,例如 10110110,可以通过将出现 1 的位值相加来转换为十进制:128 + 32 + 16 + 4 + 2 = 182。
- Typical 8-bit place values / 典型的 8 位位值表:
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
| 1 | 0 | 1 | 1 | 0 | 1 | 1 | 0 |
128+32+16+4+2 = 182
3. Converting Denary to Binary | 十进制转二进制
To convert a denary number to 8-bit binary, repeatedly subtract the largest possible place value, writing a 1 for each place value that fits, and a 0 when it does not. For example, to convert 200 to binary: 128 fits (1), remainder 72; 64 fits (1), remainder 8; 32 does not fit (0); 16 does not fit (0); 8 fits (1), remainder 0; then 0 for 4, 2, and 1. Result: 11001000.
要将一个十进制数转换为 8 位二进制,反复减去可能的最大位值,凡够减该位值就写 1,不够减就写 0。例如将 200 转换为二进制:128 够减(1),余数 72;64 够减(1),余数 8;32 不够减(0);16 不够减(0);8 够减(1),余数 0;然后 4、2、1 均写 0。结果为 11001000。
An alternative method is successive division by 2, reading the remainders from bottom to top. Both methods should give exactly the same binary pattern. Practise with numbers under 256 until the process feels automatic.
另一种方法是连续除以 2,然后从下往上读取余数。两种方法应得出完全相同的二进制模式。用 256 以下的数字多加练习,直到这个过程变得自然而然。
4. Binary Addition | 二进制加法
Binary addition follows four simple rules: 0+0=0, 0+1=1, 1+0=1, and 1+1=0 carry 1 (which is 10 in binary, i.e., 2 in denary). A fifth rule covers when you already have a carried bit: 1+1+1=1 carry 1. The addition process works column by column from the rightmost bit, just like denary addition. For instance, adding 01011010 (90) and 00101101 (45) yields 10000111 (135) with a carry moving through several columns.
二进制加法遵循四条简单规则:0+0=0,0+1=1,1+0=1,还有 1+1=0 并进位 1(这在二进制中就是 10,即十进制的 2)。第五条规则涵盖已有进位数的情况:1+1+1=1 并进位 1。加法过程从最右位开始,逐列进行,与十进制加法一样。例如,将 01011010(90)与 00101101(45)相加,得到 10000111(135),进位会跨越多列传递。
Exam questions often ask you to show the carry row. Always align your binary numbers neatly, write a small carry above the next column, and check your final result by converting back to denary if time allows.
考题经常要求你写出进位行。始终将二进制数整齐地对齐,在下一列上方标出进位标记,如果时间允许,再转换回十进制核对最终结果。
5. Overflow Errors | 溢出错误
A computer stores numbers in fixed-length registers, often 8 bits. When the result of a binary addition requires more bits than the register can hold, an overflow error occurs. For example, adding 11011010 (218) and 01001101 (77) would give 100100111 (295) if we could use 9 bits. In an 8-bit system, the leftmost carry bit is lost, and the stored result becomes 00100111 (39), which is clearly incorrect. Overflow typically happens when adding two large positive numbers or two negative numbers in two’s complement, and programmers must take steps to detect and handle it.
计算机把数字存储在固定长度的寄存器中,通常是 8 位。当二进制加法的结果需要的位数超出寄存器所能容纳的位数时,就会发生溢出错误。例如,将 11011010(218)与 01001101(77)相加,如果能用 9 位,结果应为 100100111(295)。在一个 8 位系统中,最左侧的进位位会丢失,存储的结果变成 00100111(39),这显然是错误的。溢出通常发生在两个大正数相加或两个负数(用补码表示时)相加时,程序员必须采取措施检测并处理它。
6. Binary Logical Shifts | 二进制逻辑移位
Shifting the bits of a binary number left or right is a fast way to multiply or divide by powers of two. A left logical shift moves every bit one place to the left, the LSB becomes 0, and the original MSB falls off the end. For example, shifting 00001101 (13) left by one gives 00011010 (26), effectively doubling the number. Shifting left by two places multiplies by 4.
将一个二进制数的位向左或向右移动,是一种快速乘以或除以 2 的幂的方法。逻辑左移将每一位向左移动一位,最低有效位补 0,而原来的最高有效位被移出舍弃。例如,将 00001101(13)左移一位得到 00011010(26),相当于让数字乘以 2。左移两位就是乘以 4。
A right logical shift moves bits to the right; the MSB is filled with 0, and the LSB falls away. Shifting 00011010 (26) right by one place gives 00001101 (13), which is integer division by 2, discarding any remainder. You must remember that logical shifts treat the binary pattern as an unsigned integer and do not preserve the sign bit. AQA also expects you to understand the difference between logical and arithmetic shifts when dealing with negative numbers, but those are covered under two’s complement representation.
逻辑右移将位向右移动;最高有效位补 0,最低有效位移出,相当于整数除以 2,并丢弃余数。例如,将 00011010(26)右移一位得到 00001101(13)。你必须记住,逻辑移位将二进制模式视为无符号整数,并且不保留符号位。AQA 还要求你理解在处理负数时逻辑移位与算术移位的区别,不过这将在补码表示法中涉及。
7. Hexadecimal as a Shorthand | 十六进制作为简写形式
Binary numbers quickly become long and difficult for humans to read. Hexadecimal (base 16) provides a compact way of representing binary. Each hex digit represents exactly four bits (a nibble). The hex digits are 0-9 and A-F, where A=10, B=11, C=12, D=13, E=14, F=15. To convert a binary number, split it into groups of four bits from the right, then replace each group with its hex equivalent. 10111100 becomes 1011 1100, which is B (11) and C (12), so BC in hexadecimal.
二进制数很快就会变得很长,人类难以阅读。十六进制(基数为 16)提供了一种紧凑的二进制表示方式。每个十六进制数字恰好代表四个二进制位(一个半字节)。十六进制数字为 0-9 以及 A-F,其中 A=10、B=11、C=12、D=13、E=14、F=15。要把一个二进制数转换为十六进制,只需从右侧开始四位一组进行拆分,然后把每组替换为对应的十六进制值。10111100 拆成 1011 1100,即 B(11)和 C(12),因此十六进制表示为 BC。
Common uses include colour codes in HTML (e.g., #FF00A3), memory addresses, and MAC addresses. In your exam, you must be able to convert quickly between denary, binary, and hexadecimal, so memorise the 16 hex-digit-to-binary correspondences.
常见的应用包括 HTML 中的颜色代码(例如 #FF00A3)、内存地址以及 MAC 地址。在考试中,你必须能快速地在十进制、二进制和十六进制之间进行转换,因此要熟记 16 个十六进制数字与二进制的对应关系。
8. Representing Characters: ASCII and Unicode | 字符的表示:ASCII 与 Unicode
Characters are represented inside a computer by assigning a unique binary number to each letter, digit, or symbol. The most widely used early system was ASCII (American Standard Code for Information Interchange), which uses 7 bits to represent 128 characters. This includes uppercase and lowercase English letters, digits 0-9, punctuation, and control characters. For example, ‘A’ is 65 in denary, which is binary 1000001.
计算机内部通过为每个字母、数字或符号分配一个唯一的二进制编号来表示字符。早期使用最广泛的系统是 ASCII(美国信息交换标准代码),它用 7 位二进制表示 128 个字符,包括大写和小写英文字母、数字 0-9、标点符号以及控制字符。例如,’A’ 的十进制值是 65,二进制为 1000001。
Extended ASCII uses 8 bits to support 256 characters, enough for accented letters and some additional symbols, but still not enough for languages with thousands of characters, like Chinese or Japanese. Unicode was developed to provide a unique number for every character in every language, as well as emojis. Unicode can be implemented with different encoding forms, such as UTF-8, which uses 1 to 4 bytes per character while maintaining compatibility with ASCII. AQA questions may ask you to explain why Unicode is needed and how it differs from ASCII.
扩展 ASCII 使用 8 位来支持 256 个字符,足够覆盖带重音的字母和一些额外符号,但对于拥有数千字符的语言(如中文或日文)仍然不够。Unicode 的开发目标就是为每种语言的每个字符,以及表情符号,提供一个唯一的编号。Unicode 可以用不同的编码形式实现,例如 UTF-8,每个字符使用 1 到 4 个字节,同时保持与 ASCII 兼容。AQA 的题目可能会要求你解释为什么需要 Unicode,以及它与 ASCII 的区别。
9. Representing Images: Bitmaps and Pixels | 图像的表示:位图与像素
A bitmap image is made up of a grid of tiny squares called pixels (picture elements). In a simple black-and-white image, each pixel can be represented by a single bit: 0 for white, 1 for black. To store more colours or shades of grey, more bits are assigned to each pixel. A colour depth of 2 bits per pixel gives 4 possible colours (2²). With 8 bits per pixel, 256 colours are possible, and 24-bit colour (8 bits for red, 8 for green, 8 for blue) allows around 16.7 million colours.
位图图像由一个称为像素(图像元素)的小方格网格组成。在简单的黑白图像中,每个像素用一位表示:0 表示白色,1 表示黑色。要存储更多颜色或灰度,就需要为每个像素分配更多位。每像素 2 位的色深可以表示 4 种颜色(2²)。每像素 8 位可以表示 256 种颜色,而 24 位色彩(红、绿、蓝各 8 位)可呈现约 1670 万种颜色。
The resolution of an image is the number of pixels it contains, often stated as width × height, e.g., 1920×1080. Higher resolution and higher colour depth produce better quality images but result in larger file sizes. In the exam you might be asked to calculate the file size of a bitmap using the formula: file size (in bits) = width × height × colour depth, and then convert to bytes (÷8) and appropriate metric prefixed units (kilobyte, megabyte).
图像的分辨率是指它所包含的像素数量,通常表示为宽 × 高,例如 1920×1080。分辨率越高、色深越大,图像质量越好,但产生的文件也越大。考试中可能会要求你使用公式计算位图的文件大小:文件大小(位) = 宽 × 高 × 色深,然后转换为字节(除以 8)以及合适的单位(千字节、兆字节)。
| Factor / 影响因素 | Effect on file size / 对文件大小的影响 |
| Increase resolution / 提高分辨率 | Larger / 变大 |
| Increase colour depth / 增加色深 | Larger / 变大 |
10. Representing Sound: Sampling | 声音的表示:采样
Sound is an analogue signal, a continuously varying wave. To store sound digitally, the amplitude (loudness) of the sound wave is measured at regular time intervals, a process called sampling. Each measurement is recorded as a binary number. The sample rate is how many samples are taken per second, measured in hertz (Hz). A typical CD-quality sample rate is 44.1 kHz, meaning 44,100 samples per second. The bit depth determines the number of possible amplitude values: 16-bit audio can distinguish 65,536 different levels.
声音是一种模拟信号,是一种连续变化的波形。为了以数字方式存储声音,需要每隔固定的时间间隔测量声波的振幅(响度),这个过程叫做采样。每个测量值都记录为一个二进制数。采样率是指每秒采集的样本数量,以赫兹(Hz)为单位。典型的 CD 音质采样率是 44.1 kHz,即每秒 44,100 个样本。位深度决定了可能的振幅值数量:16 位音频可以区分 65,536 个不同的水平。
Higher sample rates and higher bit depths capture sound more accurately and reduce distortion, but they significantly increase the file size. The formula to calculate sound file size is: file size = sample rate × bit depth × duration in seconds (for mono sound; double for stereo). AQA questions often ask you to explain the trade-off between quality and storage.
更高的采样率和更深的位深度能更准确地捕捉声音并减少失真,但会显著增大文件尺寸。计算声音文件大小的公式是:文件大小 = 采样率 × 位深度 × 时长(秒)(单声道;立体声需翻倍)。AQA 的题目经常要求你解释音质与存储之间的权衡。
11. Data Compression: Lossless and Lossy | 数据压缩:无损与有损
Compression reduces the number of bits needed to store or transmit data. There are two main types: lossless and lossy. Lossless compression reduces file size without losing any information; the original file can be perfectly reconstructed. It works by finding and eliminating repetitive patterns. Run-length encoding (RLE) is a simple lossless method: a sequence such as AAAAABBCCC could be stored as 5A2B3C. Lossless compression is essential for text files, program code, and some image formats like PNG.
压缩可以减少存储或传输数据所需的位数。主要有两种类型:无损与有损。无损压缩在减小文件大小的同时不会丢失任何信息;原始文件可以被完美重建。它通过发现并消除重复模式来工作。行程编码(RLE)是一种简单的无损方法:像 AAAAABBCCC 这样的序列可以存储为 5A2B3C。无损压缩对于文本文件、程序代码以及某些图像格式(如 PNG)至关重要。
Lossy compression permanently removes less important data to achieve far smaller file sizes. This works well with images (JPEG), sound (MP3), and video (MPEG), where the human eye or ear cannot easily detect the missing detail. The key exam point is that lossy compression makes the reduction irreversible, and excessive compression can lead to noticeable artefacts, such as blurry images or muffled audio. When answering questions, always link the type of compression to the nature of the data and whether perfect reconstruction is required.
有损压缩会永久性地去除不太重要的数据,以实现更小的文件尺寸。这适用于图像(JPEG)、声音(MP3)和视频(MPEG),因为人眼或耳朵不易察觉到缺失的细节。考试的重点在于有损压缩会使缩减不可逆,并且过度压缩可能导致明显的失真,例如图像模糊或声音沉闷。答题时,始终要将压缩类型与数据性质以及是否需要完美重建联系起来。
12. Common Pitfalls and Exam Tips | 常见错误与应试技巧
A common mistake is confusing the most significant bit (MSB) and least significant bit (LSB) when writing binary numbers; always remember the LSB is on the right. Many students lose marks by forgetting to include leading zeros when giving an 8-bit representation — ‘101’ must be written as 00000101 if the question specifies 8 bits. When performing binary addition, always write the carry row neatly above, and double-check columns where three 1s add up.
一个常见错误是在书写二进制数时弄混最高有效位(MSB)和最低有效位(LSB);始终记住 LSB 在右侧。很多学生因为忘记在 8 位表示时补上高位零而丢分——如果题目指定 8 位,’101′ 必须写作 00000101。做二进制加法时,务必在上一行整齐地写出进位,并仔细检查三 1 相加的情形。
When calculating file sizes, watch out for unit conversions: 1 kilobyte = 1024 bytes, but exam boards often accept 1000 for simplicity unless specified otherwise. Always show your working clearly; even if the final answer is wrong, you can pick up method marks. Finally, practise converting between binary, denary, and hex until it becomes second nature — speed and accuracy can win you valuable time in the exam.
计算文件大小时,注意单位换算:1 千字节 = 1024 字节,但考试局若无特别说明通常允许按 1000 简化计算。始终清晰展示运算过程;即使最终答案错了,你也能拿到方法分。最后,要反复练习二进制、十进制和十六进制之间的转换,直到变成条件反射——速度与准确性能为你在考试中赢得宝贵的时间。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply