Paper 1 · Computer Systems 试卷一 · 计算机系统

1.1 · Number systems

1.1 · 数制系统

Binary, denary and hexadecimal

二进制、十进制与十六进制

Everything a computer stores is a pattern of bits. This section is about reading those patterns three ways, adding them, shifting them, and using one bit to carry a sign.

计算机存储的一切都是位(bit)的模式。本节将学习以三种方式解读这些模式,对它们进行加法运算、移位,以及用一个位来表示正负号。

Core for all candidates 所有考生均需掌握的核心内容 Covers 1.1.1 to 1.1.6 涵盖 1.1.1 至 1.1.6 Nearly always Question 1 on Paper 1 几乎总是试卷一的第 1 题

Explainer · 1.1.1

讲解 · 1.1.1

Why computers use binary

为什么计算机使用二进制

A computer is built from millions of tiny switches. Each switch is either on or off, so it naturally holds one of two states. Representing everything with just two values means the hardware only has to tell those two states apart, which it can do reliably even when signals are weak or noisy.

计算机由数百万个微小的开关构成。每个开关要么开、要么关,因此天然地只能保持两种状态之一。仅用两个值来表示一切,意味着硬件只需要区分这两种状态,即使信号微弱或有噪声,也能可靠地做到这一点。

Df

Any data (a number, a letter, a colour, a sound sample) is first converted to binary, a pattern of 0s and 1s, before the computer can work with it.

任何数据(数字、字母、颜色、声音采样)在计算机处理之前,都会先被转换为二进制,即由 0 和 1 组成的模式。

That binary is then processed by logic gates and held in registers, small stores inside the processor.

该二进制数据随后由逻辑门处理,并保存在寄存器中,即处理器内部的小型存储单元。

Explainer · 1.1.2

讲解 · 1.1.2

Denary, binary and hexadecimal

十进制、二进制与十六进制

A number system has a base: how many different digits it uses, and what each column is worth.

一个数制系统有一个基数:它使用多少个不同的数字符号,以及每一列各代表多少。

System数制 Base基数 Digits数字符号 Column values列值
Denary十进制 10 0 to 90 至 9 ... 1000   100   10   1
Binary二进制 2 0, 1 128   64   32   16   8   4   2   1
Hexadecimal十六进制 16 0 to 9, A to F0 至 9,A 至 F ... 4096   256   16   1

In hex the letters carry on where the digits stop: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15. The 0478 syllabus works with whole numbers only, up to 16 bits.

在十六进制中,字母接续数字未尽之处:A = 10、B = 11、C = 12、D = 13、E = 14、F = 15。0478 考纲只涉及最多 16 位的整数。

Try it yourself

动手试试

The number explorer

数字探索器

Click the bits to turn them on and off. Every place value that is switched on counts towards the number. The same 8-bit pattern is read three ways at once.

点击各个位来开启或关闭它们。每一个被开启的位所对应的位值都会计入总数。同一个 8 位模式会同时以三种方式解读。

The largest number 8 bits can hold is 11111111 = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255 (one less than 28).

8 位能表示的最大数是 11111111 = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255(比 28 少 1)。

Explainer · 1.1.2 (b)

讲解 · 1.1.2 (b)

Converting by hand

手动换算

Binary → denary

二进制 → 十进制

Write the place values above the bits. Add up every value where there is a 1.

在每个位的上方写出其位值,然后把所有为 1 的位所对应的位值相加。

128 64 32 16 8 4 2 1 0 1 0 0 1 0 1 1 64 + 8 + 2 + 1 = 75

Denary → binary

十进制 → 二进制

Take the largest place value that fits, put a 1 there, subtract it, and repeat. 75 − 64 = 11; 11 − 8 = 3; 3 − 2 = 1; 1 − 1 = 0.

取能够容纳的最大位值,在那一位写上 1,减去该位值,然后重复此过程。75 − 64 = 11;11 − 8 = 3;3 − 2 = 1;1 − 1 = 0。

128 64 32 16 8 4 2 1 0 1 0 0 1 0 1 1 = 01001011

Hexadecimal → binary, and back

十六进制 → 二进制,及其逆运算

One hex digit is exactly four bits (a nibble). Convert each digit to its 4-bit code, keeping the leading zeros, and join them up.

一个十六进制数字恰好对应四个位(一个半字节)。将每个数字转换为其 4 位编码,保留前导零,再将它们拼接起来。

4 B 0100 1011 → 01001011 Going the other way: split the binary into groups of 4 from the RIGHT, pad the left group with 0s, then read each nibble as a hex digit.
!

Markers report a hex digit converted to three bits, not four: 5 is 0101, not 101. Always write all four bits of every nibble.

考官报告显示,考生常把一个十六进制数字转换为三个位而非四个位:5 应为 0101,而不是 101。务必写出每个半字节完整的四个位。

Denary ↔ hexadecimal

十进制 ↔ 十六进制

Denary to hex: divide by 16 repeatedly and read the remainders from the bottom up (10 to 15 become A to F). Hex to denary: multiply each digit by its column value (1, 16, 256, ...) and add. Or go through binary, which many candidates find safer.

十进制转十六进制:反复除以 16,从下往上读取余数(10 到 15 对应 A 到 F)。十六进制转十进制:将每个数字乘以其列值(1、16、256……)再相加。也可以借助二进制中转,许多考生认为这样更保险。

Explainer · 1.1.3

讲解 · 1.1.3

Why hexadecimal is used

为什么使用十六进制

The computer still works in binary. Hex is for the humans reading it: because one hex digit stands for four bits, a long binary pattern becomes a quarter as long and much easier to read, copy and check.

计算机内部仍然以二进制运作。十六进制是给阅读它的人看的:由于一个十六进制数字代表四个位,一长串二进制模式就能缩短为四分之一的长度,更便于阅读、抄写和核对。

1011 0110 0011 1101 → B63D
!

A common wrong answer: that hex “stores more data” or “takes less memory”. It does not. The same bits are stored either way; hex is only a shorter way of writing them.

一个常见的错误答案是:十六进制"能存储更多数据"或"占用更少内存"。事实并非如此。无论用哪种表示法,存储的位都是相同的;十六进制只是书写这些位的一种更短的方式。

Places you will see hexadecimal: MAC addresses (six pairs of hex digits identifying a device), IPv6 addresses, HTML colour codes (#1D4ED8), and error codes and memory dumps.

你会在以下场合见到十六进制:MAC 地址(六组用于标识设备的十六进制数字对)、IPv6 地址、HTML 颜色代码(#1D4ED8),以及错误代码和内存转储。

Try it yourself · 1.1.4

动手试试 · 1.1.4

Binary addition and overflow

二进制加法与溢出

Add two 8-bit numbers column by column, right to left: 0+0=0, 1+0=1, 1+1=0 carry 1, 1+1+1=1 carry 1. Pick two values and press Add to see every carry.

从右到左逐列相加两个 8 位数字:0+0=0、1+0=1、1+1=0 进位 1、1+1+1=1 进位 1。选择两个数值并按"相加"查看每一次进位。

!

In the exam you must show the binary addition and every carry. Converting to denary, adding, and converting back scores nothing, even if the answer is right, because it does not demonstrate binary addition.

在考试中,你必须展示二进制加法过程以及每一次进位。先转换为十进制、相加、再转换回来,即使答案正确也不得分,因为这没有体现出二进制加法。

Overflow happens when the result needs a 9th bit: the true total is more than 255, which will not fit in an 8-bit register. A larger register (16-bit and so on) can hold larger numbers.

溢出发生在结果需要第 9 个位时:真实总和超过 255,无法容纳在 8 位寄存器中。更大的寄存器(如 16 位)可以容纳更大的数字。

Try it yourself · 1.1.5

动手试试 · 1.1.5

Logical binary shift

逻辑二进制移位

A shift slides every bit along by one or more places. A bit pushed off the end is lost; a 0 is fed in at the other end. Each left shift multiplies the number by 2; each right shift divides it by 2.

移位会将每一个位向一侧滑动一位或多位。被推出末端的位会丢失;另一端则补入一个0。每左移一位,数值乘以 2;每右移一位,数值除以 2。

If a shift pushes a 1 off the end, information is lost and the multiply or divide no longer gives the right answer. Markers also report shifts done the wrong way, and 1s fed in instead of 0s.

如果移位将一个1推出末端,信息就会丢失,乘法或除法的结果也不再正确。考官还报告过移位方向做反、以及补入 1 而非 0 的情况。

Try it yourself · 1.1.6

动手试试 · 1.1.6

Two’s complement: negative numbers

二进制补码:负数的表示

To store negatives, the left-most column changes from +128 to −128. Everything else keeps its value. A 1 in that column means the number is negative; a 0 means it is positive. The range for 8 bits becomes −128 to +127.

为了存储负数,最左边一列的值从 +128 变为 −128。其余各列保持不变。该列为 1 表示数字为负,为 0 表示数字为正。8 位的取值范围因此变为 −128 到 +127。

!

Markers report a negative two’s complement value read as if it were an ordinary positive binary number, then a minus sign stuck on the front. Use the −128 column: for 11001111 that is −128 + 64 + 8 + 4 + 2 + 1 = −49. Also: “sign and magnitude” is not on this syllabus, two’s complement is the method.

考官报告显示,考生常把一个负的二进制补码值当作普通的正二进制数来解读,再在前面简单加上一个负号。请使用−128 这一列:对于 11001111,即 −128 + 64 + 8 + 4 + 2 + 1 = −49。另外要注意:"符号加数值法"不在本考纲范围内,补码才是本考纲采用的方法。

Check your understanding

检验你的理解

The binary number 10110100 is which denary and hexadecimal value?

二进制数 10110100 对应的十进制和十六进制值分别是多少?

Check your understanding

检验你的理解

Two 8-bit registers hold 200 and 100. What happens when they are added?

两个 8 位寄存器分别保存 200 和 100。将它们相加会发生什么?

Check your understanding

检验你的理解

00011000 is shifted 2 places left. What is the result?

00011000 向左移动 2 位,结果是多少?

Common mistakes

常见错误

Markers reported these patterns for 1.1.3 / 1.1.4 / 1.1.5 / 1.1.6 考官针对 1.1.3 / 1.1.4 / 1.1.5 / 1.1.6 报告了以下模式

RecurringOn binary addition, candidates converted to denary, added, and converted back. That earns nothing: the question asks you to demonstrate binary addition, so the carries must be shown in the binary working.

反复出现在二进制加法上,考生先转换为十进制、相加、再转换回来。这样得不到任何分数:题目要求展示二进制加法过程,因此进位必须体现在二进制运算过程中。

On two’s complement, a negative value was read as an ordinary positive binary number with a minus sign added on. The left-most column is −128, and it is part of the sum.

在二进制补码上,负值被当作普通正二进制数解读,再简单加上负号。最左边一列是−128,它也是求和的一部分。

On logical shift, some shifted the wrong way, or fed 1s into the register instead of 0s. On hex, a nibble was written with three bits, and hex was wrongly said to “store more” or “use less memory”.

在逻辑移位上,有考生移位方向做反,或在寄存器中补入1而不是 0。在十六进制上,有考生把一个半字节写成三个位,并错误地认为十六进制"能存储更多"或"占用更少内存"。

✕

Denary detour: “01100010 = 98, 00111010 = 58, 98 + 58 = 156 = 10011100.” No binary addition shown.

十进制绕道:"01100010 = 98,00111010 = 58,98 + 58 = 156 = 10011100。"没有展示二进制加法过程。

✓

Binary working with carries: line up the two numbers, add each column right to left, write the carry above the next column, and show the final sum row.

带进位的二进制运算:将两个数字对齐,从右到左逐列相加,把进位写在下一列上方,并展示最终的求和结果行。

✕

Two’s complement misread: 11001111 → “64 + 8 + 4 + 2 + 1 = 79, so −79”.

二进制补码误读:11001111 → "64 + 8 + 4 + 2 + 1 = 79,所以是 −79"。

✓

Sign column included: 11001111 → −128 + 64 + 8 + 4 + 2 + 1 = −49.

纳入符号列:11001111 → −128 + 64 + 8 + 4 + 2 + 1 = −49。

Revision questions

复习题

Past-paper style. Write an answer, then reveal the marking points and mark yourself.

采用历年真题风格。写下答案,然后展开评分要点给自己打分。

Question 1 · 2 marks 第 1 题 · 2 分

[2]Convert the binary number 01101101 to denary and to hexadecimal.

[2]将二进制数 01101101 转换为十进制和十六进制。

Question 2 · 1 mark 第 2 题 · 1 分

[1]State one reason a programmer might display a long binary value in hexadecimal.

[1]陈述程序员将较长的二进制值以十六进制显示的一个原因。

Question 3 · 3 marks 第 3 题 · 3 分

[3]Add the 8-bit binary numbers 01011010 and 00110110. Show all your working, including carries.

[3]将 8 位二进制数 01011010 和 00110110 相加。展示所有运算过程,包括进位。

Question 4 · 3 marks 第 4 题 · 3 分

[3]10100000 is shifted 2 places right. Give the result and its denary value, and state whether any information is lost.

[3]10100000 向右移动 2 位。给出结果及其十进制值,并说明是否有信息丢失。

Question 5 · 2 marks 第 5 题 · 2 分

[2]Give the denary value of the two’s complement number 11101000.

[2]给出二进制补码 11101000 所对应的十进制值。

Flashcards

记忆卡片

Active recall for this subtopic’s key terms.

针对本子主题关键术语的主动回忆练习。

Prototype render · content grounded in the Cambridge IGCSE 0478 syllabus and real 0478 examiner-report data for 1.1 · not yet wired to live routes