📚 8C Unit 4: Data Representation – Binary, Denary and Hexadecimal | 8C 第4单元:数据表示——二进制、十进制与十六进制
This unit introduces how all data inside a computer is represented using binary, denary and hexadecimal number systems. You will learn to convert between these bases, perform binary addition and understand how text, images and sound are encoded as binary patterns.
本单元介绍计算机内部如何使用二进制、十进制和十六进制数制表示所有数据。你将学习这些进制之间的转换、执行二进制加法,以及理解文本、图像和声音是如何被编码为二进制模式的。
1. Why Computers Use Binary | 为什么计算机使用二进制
Computers are built from millions of tiny switches called transistors. Each transistor can be in one of two states: on or off. These two states are represented naturally by the binary digits 1 and 0.
计算机由数百万个称为晶体管的微小开关组成。每个晶体管可以处于两种状态之一:开或关。这两种状态自然地用二进制数字 1 和 0 表示。
Because binary uses only two symbols, it is highly reliable in electronic circuits. Voltage fluctuations are less likely to cause errors when a circuit only has to distinguish between a high voltage and a low voltage.
由于二进制只使用两个符号,它在电子电路中非常可靠。当电路只需区分高电压和低电压时,电压波动不太可能导致错误。
A single binary digit is called a bit. A group of 8 bits is a byte, which is the standard unit for measuring computer storage.
一个二进制位称为比特。8 个比特组成一个字节,字节是衡量计算机存储的标准单位。
2. Place Value in Denary and Binary | 十进制与二进制的位值
alue that is a power of 10. For example, the number 372 means 3 × 10² + 7 × 10¹ + 2 × 10⁰.
在十进制系统中,每一列都有以 10 的幂为单位的位值。例如,数字 372 表示 3 × 10² + 7 × 10¹ + 2 × 10⁰。
Binary uses base 2, so column place values are powers of 2. For an 8-bit number, the place values from left to right are 128, 64, 32, 16, 8, 4, 2 and 1.
二进制使用以 2 为底,因此列的位值是 2 的幂。对于 8 位数字,位值从左到右依次为 128、64、32、16、8、4、2 和 1。
| Place value | 位值 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
| Binary digit | 二进制数字 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 |
The table above shows the binary number 11010011₂. To find its denary value, add the place values where the binary digit is 1.
上表显示了二进制数 11010011₂。要找出它的十进制值,只需将二进制数字为 1 的位值相加。
3. Converting Binary to Denary | 二进制转十进制
To convert a binary number to denary, write the binary digits under the correct place values. Then add every place value that has a 1 underneath it.
要将二进制数转换为十进制,请将二进制数字写在正确的位值下方。然后将下方为 1 的每个位值相加。
are 8, 4, 2 and 1. The digits are 1, 0, 1 and 1, so the calculation is 8 + 0 + 2 + 1 = 11.
例如,将 1011₂ 转换为十进制。位值是 8、4、2 和 1。数字分别是 1、0、1 和 1,因此计算为 8 + 0 + 2 + 1 = 11。
1011₂ = (1 × 2³) + (0 × 2²) + (1 × 2¹) + (1 × 2⁰) = 8 + 0 + 2 + 1 = 11₁₀
Always check that the result is sensible. An 8-bit binary number can only represent denary values from 0 to 255.
始终检查结果是否合理。8 位二进制数只能表示 0 到 255 之间的十进制值。
4. Converting Denary to Binary | 十进制转二进制
One method is to divide the denary number repeatedly by 2 and record the remainders. The remainders read from bottom to top give the binary equivalent.
一种方法是将十进制数反复除以 2 并记录余数。余数从下往上读取,就得到对应的二进制数。
3 remainder 1; 3 ÷ 2 = 1 remainder 1; 1 ÷ 2 = 0 remainder 1. Reading upwards gives 11101₂.
例如,将 29₁₀ 转换为二进制。29 ÷ 2 = 14 余 1;14 ÷ 2 = 7 余 0;7 ÷ 2 = 3 余 1;3 ÷ 2 = 1 余 1;1 ÷ 2 = 0 余 1。从下往上读取得到 11101₂。
A quicker method is to subtract the largest possible power of 2, place a 1 in that column, and repeat with the remainder. Add leading zeros to make a full 8-bit number when required.
更快的方法是减去可能的最大 2 的幂,在该位放 1,然后对余数重复操作。需要时添加前导零以形成完整的 8 位数字。
29₁₀ = 16 + 8 + 4 + 1 = 00011101₂
5. Binary Addition and Overflow | 二进制加法与溢出
1 = 1, 1 + 0 = 1, and 1 + 1 = 0 carry 1. When three 1s are added, the result is 1 carry 1.
二进制加法遵循四个简单规则:0 + 0 = 0,0 + 1 = 1,1 + 0 = 1,1 + 1 = 0 进位 1。当三个 1 相加时,结果是 1 进位 1。
y 1, 1 + 0 + 1 = 0 carry 1, 0 + 1 + 1 = 0 carry 1, and 0 + 0 + 1 = 1. The answer is 1000₂.
例如,将 0011₂ 和 0101₂ 相加。从右边开始,1 + 1 = 0 进位 1,1 + 0 + 1 = 0 进位 1,0 + 1 + 1 = 0 进位 1,0 + 0 + 1 = 1。答案是 1000₂。
Overflow occurs when the sum of two 8-bit numbers needs more than 8 bits. For example, 11111111₂ + 00000001₂ produces a carry out of the most significant bit, so the result cannot be stored in one byte.
当两个 8 位数字之和需要超过 8 位时,就会发生溢出。例如,11111111₂ + 00000001₂ 会在最高位产生进位,因此结果无法存储在一个字节中。
6. Introducing Hexadecimal | 十六进制简介
ts 0 to 9 and the letters A to F, where A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15.
十六进制是以 16 为底。它使用数字 0 到 9 以及字母 A 到 F,其中 A = 10,B = 11,C = 12,D = 13,E = 14,F = 15。
Hexadecimal is useful because one hex digit represents exactly four binary digits. This makes long binary sequences such as 101011001110₂ much shorter and easier to read as ACE₁₆.
十六进制很有用,因为一个十六进制数字恰好代表四个二进制数字。这使得诸如 101011001110₂ 这样的长二进制序列缩短为 ACE₁₆,更便于阅读。
| Denary | 十进制 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| Hex | 十六进制 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
7. Conversions with Hexadecimal | 与十六进制互转
To convert binary to hexadecimal, split the binary number into groups of four bits from the right. Convert each group into its matching hex digit.
要将二进制转换为十六进制,请从右侧开始将二进制数每四位分成一组。将每组转换为其对应的十六进制数字。
101₂ to hex. Split into 1010 and 1101. 1010₂ = A₁₆ and 1101₂ = D₁₆, so the answer is AD₁₆.
例如,将 10101101₂ 转换为十六进制。拆分为 1010 和 1101。1010₂ = A₁₆,1101₂ = D₁₆,因此答案是 AD₁₆。
To convert hex to denary, first convert each hex digit to 4-bit binary, then convert that binary value to denary. Or multiply each hex digit by its place value: the right column is 16⁰ and the next is 16¹.
要将十六进制转换为十进制,可以先将每个十六进制数字转换为 4 位二进制,再将该二进制值转换为十进制。或者将每个十六进制数字乘以其位值:右列是 16⁰,下一列是 16¹。
AD₁₆ = (10 × 16¹) + (13 × 16⁰) = 160 + 13 = 173₁₀
8. Representing Text | 文本表示
Characters such as letters, digits and punctuation are stored as binary codes. The most common character set is ASCII, which originally used 7 bits to represent 128 characters.
字母、数字和标点等字符以二进制代码形式存储。最常用的字符集是 ASCII,它最初使用 7 位表示 128 个字符。
For example, uppercase A is 65₁₀, which is 1000001₂. Lowercase a is 97₁₀, which is 1100001₂. The space character is 32₁₀.
例如,大写 A 是 65₁₀,即 1000001₂。小写 a 是 97₁₀,即 1100001₂。空格字符是 32₁₀。
Extended ASCII uses 8 bits and can represent 256 characters. Unicode is a much larger character set that includes symbols from many world languages and emoji. It can be encoded using variable-length schemes such as UTF-8.
扩展 ASCII 使用 8 位,可以表示 256 个字符。Unicode 是一个更大的字符集,包含许多世界语言和表情符号。它可以使用 UTF-8 等可变长度方案进行编码。
9. Representing Images and Sound | 图像与声音表示
A bitmap image is made of small dots called pixels. Each pixel has a colour, and the colour is stored as a binary number. The number of bits used for each pixel is called colour depth.
位图图像由称为像素的小点组成。每个像素都有一种颜色,该颜色以二进制数存储。用于每个像素的位数称为颜色深度。
A higher colour depth allows more colours. For example, 8-bit colour supports 256 colours, while 24-bit colour supports about 16.7 million colours. Image resolution is the total number of pixels in the image.
更高的颜色深度允许更多颜色。例如,8 位颜色支持 256 种颜色,而 24 位颜色支持约 1670 万种颜色。图像分辨率是图像中像素的总数。
Sound is recorded by measuring the amplitude of the sound wave at regular intervals. These measurements are called samples
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图