📚 GCSE OCR Computer Science: Binary Key Points Explained | GCSE OCR 计算机:二进制 考点精讲
Binary is the fundamental number system used by all digital computers. In the GCSE OCR Computer Science specification, you are expected to understand binary representation, conversion, arithmetic, and bit shifts. This guide breaks down every key point to help you master the topic.
二进制是所有数字计算机使用的基本数制。在 GCSE OCR 计算机科学考纲中,你需要掌握二进制表示、转换、算术运算和位移操作。本指南将逐一剖析每个考点,帮助你完全掌握该主题。
1. What is Binary? | 什么是二进制?
Binary is a base‑2 number system that uses only two digits: 0 and 1. Computers use binary because they are built from billions of tiny switches (transistors) that can be either off (0) or on (1).
二进制是一种以 2 为基数的数制,只使用两个数字:0 和 1。计算机采用二进制,是因为它们由数十亿个可以处于关 (0) 或开 (1) 状态的微小开关(晶体管)构成。
In any binary number, each digit is called a bit (binary digit). A group of 8 bits is known as a byte. The more bits available, the larger the range of values that can be represented.
在二进制数中,每一位数字称为一个比特(二进制位)。一组 8 个比特称为一个字节。可用的位数越多,能表示的数值范围就越大。
For example, a nibble (4 bits) can represent 16 different values (0–15), while a byte can represent 256 values (0–255).
例如,半个字节(4 位)可以表示 16 个不同值(0–15),而一个字节可以表示 256 个值(0–255)。
2. Binary Place Values | 二进制位权
Just as denary (base 10) has place values of 1, 10, 100, binary place values are powers of 2. The rightmost bit holds 2⁰ (1), the next holds 2¹ (2), then 2² (4), 2³ (8), and so on.
与十进制(基数为 10)的位权 1、10、100 类似,二进制的位权是 2 的幂。最右边的位表示 2⁰ (1),下一位 2¹ (2),然后是 2² (4)、2³ (8),依此类推。
In an 8‑bit binary number the place values from left to right are 128, 64, 32, 16, 8, 4, 2, 1.
在一个 8 位二进制数中,从左到右的位权依次为 128、64、32、16、8、4、2、1。
| 128 (2⁷) | 64 (2⁶) | 32 (2⁵) | 16 (2⁴) | 8 (2³) | 4 (2²) | 2 (2¹) | 1 (2⁰) |
|---|---|---|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 0 | 1 | 1 | 0 |
The binary number 1010 0110 (spaces are optional) therefore represents 128+32+4+2 = 166 in denary.
因此,二进制数 1010 0110(空格可选)表示的十进制值为 128+32+4+2 = 166。
Learning the place values by heart speeds up conversion dramatically.
熟记这些位权可以大幅加快转换速度。
3. Converting Binary to Denary | 二进制转十进制
To convert a binary number to denary, add the place values wherever there is a 1. Ignore the positions that hold a 0.
要将二进制数转换为十进制,只需将所有出现 1 的位权相加。出现 0 的位忽略。
Example: 0010 1100₂ has 1s in the 32, 8 and 4 columns. So 32+8+4 = 44.
示例:0010 1100₂ 在 32、8 和 4 列有 1。因此 32+8+4 = 44。
0010 1100₂ → 32 + 8 + 4 = 44₁₀
4. Converting Denary to Binary | 十进制转二进制
The most reliable method is successive division by 2, reading the remainders upwards. Alternatively, use a place‑value table and subtract the largest possible power of 2.
最可靠的方法是反复除以 2,然后从下往上读余数。也可以使用位权表,依次减去可能的最大 2 的幂。
Example: convert 83 to binary. The largest power ≤ 83 is 64, leaving 19. Next 16, leaving 3; then 2, leaving 1; finally 1. Write 1s for the used places and 0s elsewhere. Result: 0101 0011₂.
示例:将 83 转换为二进制。不超过 83 的最大 2 的幂是 64,剩下 19。接下来是 16,剩下 3;然后是 2,剩下 1;最后是 1。在使用的位写 1,其余写 0。结果为 0101 0011₂。
83₁₀ = 64 + 16 + 2 + 1 = 0101 0011₂
5. Binary Addition | 二进制加法
Binary addition follows four simple rules: 0+0=0, 0+1=1, 1+0=1, 1+1=0 carry 1. When three 1s are added, the result is 1 with a carry of 1.
二进制加法遵循四条简单规则:0+0=0,0+1=1,1+0=1,1+1=0 并进位 1。当三个 1 相加时,结果为 1 且进位 1。
Let’s add 0101₂ (5) and 0011₂ (3).
我们来计算 0101₂ (5) 与 0011₂ (3) 的加法。
0101₂
+ 0011₂
= 1000₂ (8)
Working from the right: 1+1 = 0 carry 1; then 1+0+carry1 = 0 carry 1; then 0+0+carry1 = 1; then 0+0 = 0. The final carry becomes a new most‑significant bit.
从右往左计算:1+1 = 0 进位 1;然后 1+0+进位1 = 0 进位 1;然后 0+0+进位1 = 1;最后 0+0 = 0。最后的进位成为新的最高有效位。
6. Overflow Errors | 溢出错误
When a calculation produces a result that requires more bits than are available, an overflow error occurs. The extra bit is lost and the answer becomes incorrect.
当计算结果需要的位数超出可用位数时,就会发生溢出错误。多余的位会丢失,答案因此出错。
In an 8‑bit system, adding 1111 1111₂ (255) and 0000 0001₂ (1) would give 1 0000 0000₂, but only 8 bits are stored, so the result is recorded as 0000 0000₂ — clearly wrong.
在 8 位系统中,1111 1111₂ (255) 加上 0000 0001₂ (1) 本应得到 1 0000 0000₂,但只存储 8 位,因此结果被记录为 0000 0000₂——这显然是错误的。
Examiners expect you to recognise when an overflow will happen and to state that a 9th bit would be needed to hold the correct result.
考官希望你能识别何时会发生溢出,并说明需要第 9 位才能容纳正确结果。
7. Left Binary Shift (Multiplication) | 左移(乘法)
Shifting all the bits in a binary number one place to the left multiplies the original value by 2. A left shift of n places multiplies the number by 2ⁿ.
将二进制数中的所有位左移一位会使原数值乘以 2。左移 n 位相当于乘以 2ⁿ。
New bits on the right are filled with 0. Bits that fall off the left may cause an overflow if the result no longer fits in the allocated number of bits.
右侧空出的新位用 0 填充。左侧移出的位如果导致结果超出分配位数,就会引发溢出。
Example: shifting 0011₂ (3) left by 1 gives 0110₂ (6); left by 2 gives 1100₂ (12).
示例:将 0011₂ (3) 左移 1 位得到 0110₂ (6);左移 2 位得到 1100₂ (12)。
3 × 2 = 6, 3 × 2² = 12
8. Right Binary Shift (Division) | 右移(除法)
A right shift divides the binary number by 2 (integer division). The rightmost bit is discarded, and the leftmost bits are filled with 0 — this is called a logical shift. Shifting right by n places divides by 2ⁿ.
右移会将二进制数除以 2(整数除法)。最右侧位被丢弃,左侧空位补 0——这称为逻辑移位。右移 n 位相当于除以 2ⁿ。
Example: 1010₂ (10) right‑shifted by 1 gives 0101₂ (5). Right‑shifting 0101₂ (5) gives 0010₂ (2) — the remainder is lost.
示例:1010₂ (10) 右移 1 位得到 0101₂ (5)。将 0101₂ (5) 右移得到 0010₂ (2)——余数被丢弃。
Remember that right shifting an odd number always discards the 1 in the least significant bit, so the result is the quotient of integer division.
请记住,右移一个奇数总是会丢弃最低有效位的 1,因此结果是整数除法的商。
9. Binary in Data Representation | 二进制在数据表示中的应用
All types of data inside a computer — from text to images and sound — are ultimately stored as sequences of binary digits. Characters are encoded using binary codes like ASCII (7‑ or 8‑bit) or Unicode, where each symbol is assigned a unique binary pattern.
计算机内部所有类型的数据——从文字到图像和声音——最终都以二进制数字序列存储。字符使用 ASCII(7 位或 8 位)或 Unicode 等二进制编码表示,每个符号被分配一个唯一的二进制模式
Published by TutorHao | GCSE Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导