📚 GCSE Computer Science: Binary Exam Essentials | GCSE 计算机:二进制考点精讲
Binary is the basic language of all digital technology. Mastering binary arithmetic, conversions, shifts, and hexadecimal representation is essential for every GCSE Computer Science student. This guide breaks down every key topic and provides clear, bilingual explanations to help you approach exam questions with confidence.
二进制是所有数字技术的基础语言。掌握二进制运算、转换、移位以及十六进制表示对每位 GCSE 计算机科学学生都至关重要。本指南将逐一讲解各关键主题,并提供清晰的双语解释,帮助你自信应对考试题目。
1. Introduction to Binary | 二进制简介
Binary is a base-2 number system used by computers to represent all data and instructions. Unlike the decimal system which uses ten digits (0–9), binary uses only two digits: 0 and 1. Each digit is called a bit. Computers rely on binary because their circuits have two stable states: on (1) and off (0). Understanding binary is fundamental, as it underpins data representation, arithmetic logic, and how all digital devices store and process information.
二进制是计算机用来表示所有数据和指令的基数为2的数字系统。与使用十个数字(0–9)的十进制系统不同,二进制只使用两个数字:0和1。每个数字称为一个比特(位)。计算机依赖二进制是因为其电路有两种稳定状态:开(1)和关(0)。理解二进制是基础,因为它支撑着数据表示、算术逻辑以及所有数字设备存储和处理信息的方式。
2. Bits, Bytes and Nibbles | 位、字节和半字节
A bit (binary digit) is the smallest unit of data, representing a single 0 or 1. A group of 8 bits is called a byte, which can represent 2⁸ = 256 different values (0 to 255). A nibble consists of 4 bits, or half a byte, and can represent 16 values (0–15). Storage sizes are measured using bytes and their multiples: kilobyte (KB), megabyte (MB), gigabyte (GB) and terabyte (TB). In computing, 1 KB is typically 1024 bytes (2¹⁰), not 1000 bytes, though some contexts use decimal definitions.
位(比特)是最小的数据单位,表示单个0或1。8位构成一个字节,可以表示2⁸ = 256个不同的值(0到255)。半字节由4位组成,即半个字节,可表示16个值(0–15)。存储大小使用字节及其倍数:千字节(KB)、兆字节(MB)、吉字节(GB)和太字节(TB)。在计算领域中,1 KB通常为1024字节(2¹⁰),而不是1000字节,尽管某些情况下使用十进制定义。
3. Place Values in Binary | 二进制位值
In a binary number, each column holds a place value that is a power of 2. The rightmost column is 2⁰ = 1, then 2¹ = 2, 2² = 4, 2³ = 8, 2⁴ = 16, 2⁵ = 32, 2⁶ = 64, 2⁷ = 128, and so on. When working with 8‑bit numbers, the place values from left to right are 128, 64, 32, 16, 8, 4, 2, 1. To convert a binary number into decimal, you multiply each bit by its place value and sum the results.
在二进制数中,每一列都有一个位值,该位值是2的幂。最右边的列是2⁰ = 1,然后是2¹ = 2,2² = 4,2³ = 8,2⁴ = 16,2⁵ = 32,2⁶ = 64,2⁷ = 128,依此类推。对于8位数,从左到右的位值依次为128、64、32、16、8、4、2、1。要将二进制数转换为十进制,需要将每一位乘以其位值后求和。
4. Binary to Decimal Conversion | 二进制转十进制
Example: Convert the 8‑bit binary number 01101001₂ to its decimal equivalent. Multiply each bit by its place value: (0×128) + (1×64) + (1×32) + (0×16) + (1×8) + (0×4) + (0×2) + (1×1). This gives 0 + 64 + 32 + 0 + 8 + 0 + 0 + 1 = 105. So 01101001₂ = 105₁₀. Notice that a leading zero does not change the value; it simply ensures the number is 8 bits long.
示例:将8位二进制数01101001₂转换为十进制。将每一位乘以其位值:(0×128) + (1×64) + (1×32) + (0×16) + (1×8) + (0×4) + (0×2) + (1×1)。得到0+64+32+0+8+0+0+1 = 105。因此01101001₂ = 105₁₀。请注意前导零不改变数值,它只保证该数为8位长。
An alternative approach is to draw a table with the powers of 2 and place the bits underneath. This helps you avoid mistakes when writing out long binary strings.
另一种方法是画出一个包含2的幂次的表格,并将各个位填在下方。这有助于避免在书写长二进制串时出错。
5. Decimal to Binary Conversion | 十进制转二进制
Method 1: Repeated division by 2. Divide the decimal number by 2 and record the remainder (either 0 or 1). Continue dividing the quotient by 2 until the quotient becomes 0. The binary number is formed by reading the remainders from the last one obtained to the first. Example: Convert 105 to binary. 105 ÷ 2 = 52 remainder 1; 52 ÷ 2 = 26 remainder 0; 26 ÷ 2 = 13 remainder 0; 13 ÷ 2 = 6 remainder 1; 6 ÷ 2 = 3 remainder 0; 3 ÷ 2 = 1 remainder 1; 1 ÷ 2 = 0 remainder 1. Reading remainders upwards gives 1101001₂. Written as an 8‑bit number, add a leading zero: 01101001₂.
方法一:重复除以2。用2除十进制数,记下余数(0或1)。继续除商,直到商为0。从下往上读取余数即可得到二进制数。示例:将105转为二进制。105 ÷ 2 = 52 余 1;52 ÷ 2 = 26 余 0;26 ÷ 2 = 13 余 0;13 ÷ 2 = 6 余 1;6 ÷ 2 = 3 余 0;3 ÷ 2 = 1 余 1;1 ÷ 2 = 0 余 1。从下往上读余数得1101001₂。写成8位数时,添加前导零:01101001₂。
Method 2: Place value subtraction. List the powers of 2 up to the required number of bits. Find the largest power that fits into the decimal number, set that bit to 1 and subtract the power. Repeat with the remainder until you reach zero. Both methods are acceptable in exams.
方法二:位值减法。列出所需的2的幂次。找出能放入十进制数的最大幂次,将该位设为1并减去该幂。对余数重复此过程直至为零。考试中两种方法均可使用。
6. Binary Addition | 二进制加法
Binary addition follows four basic rules: 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 0 with a carry of 1 to the next column. When three 1s are added (1 + 1 + carry‑in), the result is 1 with a carry of 1. You add columns from right to left, just like in decimal addition.
二进制加法遵循四条基本规则:0 + 0 = 0,0 + 1 = 1,1 + 0 = 1,以及1 + 1 = 0 并向下一列进位1。当有三个1相加时(1+1+进位),结果为1并产生进位1。加法从右向左逐列进行,就像十进制加法一样。
Example: Add the two 4‑bit numbers 0101₂ (5) and 0011₂ (3). Starting from the right: 1 + 1 = 0 carry 1; next column: 0 + 1 + carry 1 = 0 carry 1; next: 1 + 0 + carry 1 = 0 carry 1; final: 0 + 0 + carry 1 = 1. Result: 1000₂, which equals 8 in decimal. Check: 5 + 3 = 8, confirming the addition is correct.
示例:将两个4位数0101₂(5)和0011₂(3)相加。从右开始:1+1=0 进位1;下一列:0+1+进位1=0 进位1;再下一列:1+0+进位1=0 进位1;最后一列:0+0+进位1=1。结果:1000₂,相当于十进制8。验证:5+3=8,确认加法正确。
7. Overflow Errors | 溢出错误
Overflow occurs when the result of a binary addition is too large to fit into the number of bits available for storage. For example, an 8‑bit unsigned binary number can represent values from 0 to 255 (11111111₂). If you add 11111111₂ and 00000001₂, the correct result is 100000000₂, which requires 9 bits. In an 8‑bit register, however, only the lowest 8 bits are kept, so the stored value becomes 00000000₂ (0). The extra carry bit is lost, causing an overflow error.
当二进制加法结果过大,无法容纳在存储所用的位数中时,就会发生溢出。例如,一个8位无符号二进制数可表示0到255(11111111₂)。若将11111111₂与00000001₂相加,正确结果为100000000₂,需要9位。然而,在8位寄存器中,只保留最低的8位,因此存储的值变为00000000₂(0)。多出的进位位丢失,导致溢出错误。
Processors include a carry flag that can be used to detect overflow and handle it in subsequent instructions. In GCSE exams, you need to identify when an overflow would happen and explain why the result is incorrect.
处理器包含进位标志,可用于检测溢出并在后续指令中处理。在 GCSE 考试中,你需要判断何时会发生溢出,并解释结果为何不正确。
8. Binary Shifts | 二进制移位
A binary left shift moves all bits one or more places to the left. Zeros fill the empty positions on the right. Each left shift multiplies the original number by 2. For instance, 00001101₂ (13) shifted left once becomes 00011010₂ (26); shifting left twice gives 00110100₂ (52), which is 13 × 4. A logical right shift for unsigned numbers moves bits to the right, discarding the rightmost bit and inserting a zero on the left. This divides the number by 2, with any remainder lost. Example: 00001100₂ (12) shifted right once results in 00000110₂ (6).
二进制左移将所有位向左移动一位或多位,右边空出的位置用零填充。每左移一位,原数乘以2。例如,00001101₂(13)左移一位变为00011010₂(26);左移两位变为00110100₂(52),即13×4。对于无符号数的逻辑右移,将所有位向右移动,丢弃最右边的位并在左边插入零。这相当于将数值除以2,余数被丢弃。示例:00001100₂(12)右移一位得到00000110₂(6)。
Arithmetic right shifts are used for signed numbers (where the most significant bit is the sign). The sign bit is replicated during the shift to preserve the sign of the number. Be careful: shifting left can cause overflow if a 1 is pushed out of the leftmost bit, leading to a loss of data.
算术右移用于有符号数(最高位为符号位)。移位时复制符号位以保留数的符号。注意:左移时如果1被移出最左位,就可能导致数据丢失,从而发生溢出。
9. Hexadecimal Numbers | 十六进制数
Hexadecimal, or base‑16, is widely used in computing as a more compact way to represent binary data. It uses the digits 0–9 plus the letters A–F to represent the decimal values 10–15. Each hex digit corresponds exactly to 4 bits (one nibble). For example, binary 1111₂ is F₁₆, and 1010₂ is A₁₆. Hex numbers are often written with a subscript 16 or a prefix 0x, such as 2F₁₆ or 0x2F.
十六进制(基数为16)在计算中广泛用于更紧凑地表示二进制数据。它使用数字0–9
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课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply