📚 GCSE Edexcel Computer Science: Data Representation Revision | GCSE Edexcel 计算机:数据表示 考点精讲
Welcome to your focused revision guide on data representation for the GCSE Edexcel Computer Science (1CP2) specification. In this topic, you will explore how computers store and process numbers, text, images and sound using only ones and zeros. We will cover binary and hexadecimal number systems, character encoding, bitmap images, digital sound, file size calculations and compression techniques. Each section explains a key concept in clear English, immediately followed by a matching Chinese explanation to support bilingual learners. Let’s master data representation together.
欢迎来到 GCSE Edexcel 计算机科学 (1CP2) 数据表示专题复习指南。本主题将帮助你理解计算机如何仅仅通过 0 和 1 来存储和处理数字、文字、图像和声音。我们将涵盖二进制与十六进制数字系统、字符编码、位图图像、数字音频、文件大小计算以及数据压缩技术。每个部分先用清晰的英文解释核心概念,紧接着提供对应的中文讲解,方便双语学习者掌握。让我们一起攻克数据表示吧。
1. Why Binary? The Language of Computers | 为什么是二进制?计算机的语言
All data inside a computer is represented using binary digits (bits) — 0s and 1s. The central processing unit (CPU) contains billions of microscopic switches called transistors, which can be either OFF (0) or ON (1). This two‑state system is extremely reliable and easy to implement in electronic circuits, allowing complex operations to be built from simple logic gates.
计算机内部的所有数据都使用二进制数字(比特)——0 和 1 来表示。中央处理器 (CPU) 包含数十亿个称为晶体管的微型开关,它们只有关 (0) 或开 (1) 两种状态。这种双稳态系统在电子电路中非常可靠且易于实现,使得我们可以用简单的逻辑门构建出复杂的运算。
A single bit can represent two values. Grouping bits gives us more possibilities: 8 bits form a byte, which can represent 2⁸ = 256 different values (0 to 255). Higher units like kilobyte (KB), megabyte (MB) and gigabyte (GB) are used to measure storage. Because computers work in binary, all data — from text messages to music files — must be encoded as sequences of bits.
一个比特可以表示两个值。将比特组合起来可以表示更多信息:8 个比特构成一个字节,能够表示 2⁸ = 256 个不同的值 (0 到 255)。更大的单位如千字节 (KB)、兆字节 (MB) 和吉字节 (GB) 用来衡量存储容量。由于计算机只认识二进制,所有数据——从文字信息到音乐文件——都必须编码为比特序列。
2. Converting Denary (Decimal) to Binary | 十进制转二进制
To convert a denary number (base 10) into binary (base 2), you repeatedly divide the number by 2, recording the remainder each time. Read the remainders from bottom to top to get the binary equivalent. For example, convert 77 to binary: 77 ÷ 2 = 38 remainder 1; 38 ÷ 2 = 19 remainder 0; 19 ÷ 2 = 9 remainder 1; 9 ÷ 2 = 4 remainder 1; 4 ÷ 2 = 2 remainder 0; 2 ÷ 2 = 1 remainder 0; 1 ÷ 2 = 0 remainder 1. Reading from last remainder to first gives 1001101, so 77 in binary is 0100 1101 when padded to 8 bits.
将十进制数(基数为10)转换为二进制(基数为2)的方法是:反复将数字除以 2,每次记录余数。从下往上读取余数即可得到二进制结果。例如,将 77 转换为二进制:77 ÷ 2 = 38 余 1;38 ÷ 2 = 19 余 0;19 ÷ 2 = 9 余 1;9 ÷ 2 = 4 余 1;4 ÷ 2 = 2 余 0;2 ÷ 2 = 1 余 0;1 ÷ 2 = 0 余 1。从最后的余数开始向上读得到 1001101,补齐为 8 位后就是 0100 1101。
An alternative method uses a place‑value table. Write the powers of 2 from 128 (2⁷) down to 1 (2⁰) for an 8‑bit number. Start at the left: if the denary number is greater than or equal to the column value, place a 1 and subtract the value; otherwise place a 0. For 77: 128 too big (0); 64 ≤ 77 → 1, subtract 64 → 13; 32 too big (0); 16 ≤ 13? No (0); 8 ≤ 13 → 1, subtract 8 → 5; 4 ≤ 5 → 1, subtract 4 → 1; 2 ≤ 1? No (0); 1 ≤ 1 → 1, subtract 1 → 0. Result: 0100 1101.
另一种方法是使用权值表格。对于 8 位二进制数,写出从 128 (2⁷) 到 1 (2⁰) 的 2 的幂。从左开始:如果十进制数大于等于当前列的权值,在这一列写 1 并减去该值;否则写 0。以 77 为例:128 太大 (0);64 ≤ 77 → 1,相减得 13;32 太大 (0);16 ≤ 13?否 (0);8 ≤ 13 → 1,相减得 5;4 ≤ 5 → 1,相减得 1;2 ≤ 1?否 (0);1 ≤ 1 → 1,相减得 0。结果是 0100 1101。
3. Converting Binary to Denary | 二进制转十进制
To convert an 8‑bit binary number back to denary, simply add together the column values wherever a 1 appears. For the binary number 1011 0100, the place values are 128, 64, 32, 16, 8, 4, 2, 1. Add: 128 (1) + 0 + 32 (1) + 16 (1) + 0 + 4 (1) + 0 + 0 = 128 + 32 + 16 + 4 = 180.
要将一个 8 位二进制数转换回十进制,只需把出现 1 的列的权值相加。对于二进制数 1011 0100,位权值分别为 128, 64, 32, 16, 8, 4, 2, 1。相加:128 (1) + 0 + 32 (1) + 16 (1) + 0 + 4 (1) + 0 + 0 = 128 + 32 + 16 + 4 = 180。
You can also write the binary digits beneath the place‑value headings and sum the enabled values. This method is quick and easy to check, especially useful in exam questions where you must show working clearly. Always remember that the rightmost bit is the least significant bit (LSB), and the leftmost bit is the most significant bit (MSB).
你也可以把二进制数字写在权值标题的下方,然后将对应为 1 的权值相加。这个方法既快捷又便于检查,在考试中尤其有助于清晰地展示计算过程。一定要记住,最右边的位是最低有效位 (LSB),最左边的位是最高有效位 (MSB)。
4. Hexadecimal: A Shortcut for Binary | 十六进制:二进制的快捷方式
Hexadecimal (base 16) is widely used in computing because it provides a more human‑friendly way to represent binary data. One hex digit corresponds to exactly four bits (a nibble), so an 8‑bit byte can be written as two hex digits. This reduces errors when reading or writing long binary strings, such as memory addresses or colour codes.
十六进制(基数为16)在计算机领域被广泛使用,因为它提供了一种对人类更友好的二进制数据表示方式。一个十六进制数字恰好对应四个比特(一个半字节),因此一个 8 位字节可以写成两个十六进制数字。这在读写长二进制字符串时(例如内存地址或颜色代码)可以减少错误。
Hex uses the digits 0‑9 and the letters A‑F, where A=10, B=11, C=12, D=13, E=14, F=15. To convert binary to hex, split the binary number into groups of four bits (from the right), then convert each group. For example, 1011 0100 splits into 1011 (B) and 0100 (4), giving B4 in hex. To convert hex to denary, multiply each hex digit by its place value (powers of 16): B4 = (11 × 16¹) + (4 × 16⁰) = 176 + 4 = 180.
十六进制使用数字 0‑9 和字母 A‑F,其中 A=10, B=11, C=12, D=13, E=14, F=15。要将二进制转换为十六进制,从右向左每四位一组拆分,然后分别转换每组。例如,1011 0100 分为 1011 (B) 和 0100 (4),得到十六进制 B4。要将十六进制转换为十进制,将每一位十六进制数字乘以其位权值(16 的幂):B4 = (11 × 16¹) + (4 × 16⁰) = 176 + 4 = 180。
5. Binary Shifts: Fast Multiplication and Division | 二进制移位:快速乘法与除法
A binary shift moves every bit in a binary number a certain number of places to the left or right. A left shift of n places multiplies the number by 2ⁿ. For example, 0000 1100 (12) left‑shifted by 2 places becomes 0011 0000, which is 48 in denary (12 × 4). Zeros fill the vacated positions on the right.
二进制移位是把二进制数中的所有位向左或向右移动指定的位数。向左移动 n 位相当于将这个数乘以 2ⁿ。例如,0000 1100 (12) 左移 2 位变成 0011 0000,十进制值为 48 (12 × 4)。右侧空出的位置用 0 填充。
A right shift of n places divides the number by 2ⁿ, with any remainder being discarded (floor division). For instance, 0010 1000 (40) right‑shifted by 3 places gives 0000 0101, which is 5 (40 ÷ 8 = 5). Beware of overflow: if a left shift pushes a 1 beyond the leftmost bit, an overflow error occurs because the result cannot be held in the available number of bits.
向右移动 n 位相当于将这个数除以 2ⁿ,余数会被丢弃(向下取整)。例如,0010 1000 (40) 右移 3 位得到 0000 0101,即 5 (40 ÷ 8 = 5)。注意溢出:如果左移时将 1 推出最左边的位,就会发生溢出错误,因为结果超出了可用位数能表示的范围。
Binary shifts are used by the CPU as a very fast way to perform multiplication or division by powers of two, without using the arithmetic logic unit’s more complex multiplication circuitry.
CPU 使用二进制移位作为执行 2 的幂次乘除法的极快方式,无需动用算术逻辑单元中更复杂的乘法电路。
6. Character Encoding: ASCII and Unicode | 字符编码:ASCII 与 Unicode
Text characters are stored as binary codes. The American Standard Code for Information Interchange (ASCII) uses 7 bits, giving 128 characters, which include the English alphabet, digits 0‑9, punctuation marks and control codes. For example, ‘A’ is 65 (binary 100 0001), ‘a’ is 97 (110 0001), and ‘0’ is 48 (011 0000). ASCII is simple and compact, but it cannot represent characters from other languages.
文字字符以二进制编码的形式存储。美国标准信息交换码 (ASCII) 使用 7 个比特,提供 128 个字符,包括英文字母、数字 0‑9、标点符号以及控制码。例如,’A’ 为 65 (二进制 100 0001),’a’ 为 97 (110 0001),’0′ 为 48 (011 0000)。ASCII 简单紧凑,但无法表达其他语言的字符。
Unicode was developed to solve this limitation. The most common encoding is UTF‑8, which uses between 1 and 4 bytes per character. The first 128 characters of Unicode match ASCII exactly, ensuring backward compatibility. Unicode can represent over 140,000 characters, covering virtually all writing systems in the world, plus emoji and symbols. Its main advantage is universal multilingual support; a potential disadvantage is that it may use more storage space than ASCII for non‑English text.
为了突破这一限制,人们开发了 Unicode。最常用的编码是 UTF‑8,每个字符占用 1 到 4 个字节。Unicode 的前 128 个字符与 ASCII 完全相同,保证了向下兼容。Unicode 能够表示超过 14 万个字符,几乎涵盖了世界上所有的书写系统,还包括表情符号和特殊符号。它的主要优势是通用的多语言支持;潜在缺点是对于非英语文本,可能比 ASCII 占用更多的存储空间。
| Character | Denary | 7‑bit Binary | Hex |
|---|---|---|---|
| A | 65 | 100 0001 | 41 |
| a | 97 | 110 0001 | 61 |
| 0 | 48 | 011 0000 | 30 |
| Space | 32 | 010 0000 | 20 |
7. Representing Bitmap Images | 位图图像的表示
A bitmap image is made up of a grid of tiny squares called pixels (picture elements). Each pixel is assigned a binary value that represents its colour. In a simple black‑and‑white image, each pixel needs only 1 bit (0 for white, 1 for black). For more colours, we increase the colour depth — the number of bits used per pixel.
位图图像由称为像素(图像元素)的微小方格组成的网格构成。每个像素被赋予一个表示其颜色的二进制值。在简单的黑白图像中,每个像素只需 1 个比特(0 代表白,1 代表黑)。要表现更多颜色,就需要增大色深——即每个像素使用的比特数。
Colour depth determines how many distinct colours can be represented. A colour depth of n bits gives 2ⁿ colours. Common examples: 8‑bit colour depth allows 256 colours (often used in GIFs), while 24‑bit colour depth (8 bits each for red, green and blue) gives over 16 million colours, known as true colour. The resolution of an image is the total number of pixels, expressed as width × height (e.g., 1920 × 1080).
色深决定了可以表示的不同颜色的数量。n 位的色深能够提供 2ⁿ 种颜色。常见的例子:8 位色深允许 256 种颜色(常用于 GIF 图),而 24 位色深(红、绿、蓝各 8 位)能呈现超过 1600 万种颜色,称为真彩色。图像的分辨率是像素的总数,表示为宽 × 高(例如 1920 × 1080)。
The file size of an uncompressed bitmap can be calculated using a simple formula. If the image’s resolution and colour depth are known, the size in bits is: width × height × colour depth. To convert to bytes, divide by 8; for kilobytes, divide by 8000 or 8192 depending on whether you use SI units or binary units (exam specification uses SI units, i.e., 1 kB = 1000 bytes, but check your exam board’s preference — Edexcel typically accepts 1 kB = 1000 bytes).
未压缩位图的文件大小可以用一个简单的公式计算。如果已知图像的分辨率和色深,大小(比特数)= 宽 × 高 × 色深。要转换为字节,除以 8;要转换为千字节,除以 8000 或 8192 取决于使用 SI 单位还是二进制单位(考试规范中使用 SI 单位,即 1 kB = 1000 字节,但请以考试局的说明为准——Edexcel 通常接受 1 kB = 1000 字节)。
Image file size (bits) = Width × Height × Colour Depth
图像文件大小(比特) = 宽度 × 高度 × 色深
8. Representing Sound | 声音的表示
Sound is an analogue signal — a continuous wave. To store sound digitally, the computer must convert it into binary numbers through a process called sampling. At regular time intervals, an analogue‑to‑digital converter (ADC) measures the amplitude (height) of the sound wave and records it as a binary value. Re‑creating the sound from digital data uses a digital‑to‑analogue converter (DAC).
声音是一种模拟信号——连续的波形。为了以数字方式存储声音,计算机必须通过一个称为采样的过程将其转换为二进制数。模数转换器 (ADC) 每隔固定时间间隔测量一次声波的幅度(高度),并将其记录为一个二进制值。从数字数据重新生成声音则使用数模转换器 (DAC)。
Two factors determine the quality and file size of digitised sound: the sample rate and the bit depth. Sample rate is the number of samples taken per second, measured in hertz (Hz). A higher sample rate captures higher frequencies more accurately. Bit depth is the number of bits used to store each sample; a greater bit depth allows a finer distinction between loud and quiet parts of the wave.
决定数字化声音质量和文件大小的两个因素是:采样率和位深度。采样率是每秒采集的样本数,以赫兹 (Hz) 为单位。更高的采样率能够更准确地捕捉高频声音。位深度是用来存储每个样本的比特数;更大的位深度可以更精细地区分声波中的响度变化。
File size for uncompressed audio can be calculated as follows: duration in seconds × sample rate in Hz × bit depth × number of channels (1 for mono, 2 for stereo). For example, a 30‑second stereo recording at 44.1 kHz sample rate and 16‑bit depth produces a file of 30 × 44100 × 16 × 2 = 42,336,000 bits, which is about 5.3 MB (using 1 MB = 1,000,000 bytes).
未压缩音频的文件大小可以这样计算:时长(秒)× 采样率 (Hz) × 位深度 × 声道数(单声道为1,立体声为2)。例如,一段 30 秒、采样率 44.1 kHz、16 位深度的立体声录音产生的文件容量为 30 × 44100 × 16 × 2 = 42,336,000 比特,大约 5.3 MB(使用 1 MB = 1,000,000 字节)。
Sound file size (bits) = Duration (s) × Sample Rate (Hz) × Bit Depth × Channels
声音文件大小(比特) = 时长(秒) × 采样率(赫兹) × 位深度 × 声道数
9. Lossy Compression | 有损压缩
Data compression reduces the number of bits needed to store or transmit data. Lossy compression works by permanently removing some of the original data, often the parts that are least noticeable to human senses. This results in a smaller file size but also a reduction in quality that cannot be fully restored. Lossy compression is typically used for images, audio and video where perfect reproduction is not essential.
数据压缩能够减少存储或传输数据所需的比特数。有损压缩通过永久性地移除一部分原始数据(通常是对人类感官最不明显的部分)来工作。这样做出来的文件更小,但质量也有所下降,且无法完全恢复。有损压缩通常用于图像、音频和视频等不求完美还原的场合。
Common lossy formats include JPEG for images and MP3 for audio. In JPEG, the algorithm discards fine colour detail that the human eye is less sensitive to. MP3 removes frequencies that are outside the typical range of human hearing, or masks quieter sounds that occur at the same time as louder ones. The main advantage is drastically reduced file sizes, making streaming and downloading faster; the disadvantage is that repeated editing and saving can accumulate quality loss.
常见的有损格式包括用于图像的 JPEG 和用于音频的 MP3。JPEG 算法会丢弃人眼不太敏感的细微色彩细节。MP3 则移除超出人类通常听觉范围的频率,或者掩蔽与较大声音同时出现的较轻声音。其主要优势是文件体积大幅缩小,使得流媒体传输和下载更快;缺点则是反复编辑保存会导致质量不断下降。
10. Lossless Compression and Run‑Length Encoding | 无损压缩与游程编码
Lossless compression reduces file size without losing any information, so the original data can be perfectly reconstructed from the compressed file. It is essential for text files, executable programs and some image formats (e.g., PNG). The compression ratio is generally lower than with lossy methods, but fidelity is preserved.
无损压缩可以在不丢失任何信息的情况下减小文件体积,因此原始数据可以从压缩文件中完全重建。这对于文本文件、可执行程序以及某些图像格式(例如 PNG)至关重要。其压缩比通常低于有损方法,但保真度得到保证。
A simple lossless technique is run‑length encoding (RLE), which replaces sequences of repeated identical values with a count and the value itself. For example, the data string A A A A B B C C C C C could be encoded as 4A 2B 5C. RLE works best on data with many consecutive repeats, such as simple icons or black‑and‑white images. Dictionary‑based coding (used in ZIP files) is another powerful lossless method that replaces common patterns with shorter codes.
一种简单的无损技术是游程编码 (RLE),它将一连串重复的相同值替换为一个计数值和该值本身。例如,数据串 A A A A B B C C C C C 可以编码为 4A 2B 5C。RLE 最适合具有大量连续重复的数据,如简单图标或黑白图像。基于字典的编码(用于 ZIP 文件)是另一种强大的无损方法,它用更短的代码替换常见的模式。
| 原始数据 Original | RLE 编码 Compressed |
|---|---|
| B B B B B B B B | 8B |
| 0 0 1 1 1 1 0 0 0 | 2 0 4 1 3 0 |
| A A A B C C C C D | 3A 1B 4C 1D |
11. Exam Tips and Common Pitfalls | 应试技巧与常见陷阱
When tackling exam questions on data representation, always show your working — especially for conversions and file size calculations. Use clearly labelled steps and state units at each stage. For binary and hex conversions, double‑check by converting back in the opposite direction. Remember that Edexcel expects you to handle up to 8‑bit binary and two‑digit hexadecimal numbers.
在解答数据表示的考试题时,一定要展示计算过程——尤其是转换和文件大小计算。每一步都要标注清楚,并在相应位置注明单位。对于二进制与十六进制转换,可以通过反向转换来验算。记住,Edexcel 要求你掌握最多 8 位二进制和两位十六进制数的处理。
Be precise with compression explanations: lossy means some data is permanently removed; lossless means all original data can be recovered. Do not confuse sampling rate with bit depth — sample rate is the frequency of measurement, while bit depth is the precision of each measurement. In file size calculations, pay careful attention to whether the question uses SI units (1000 bytes in a kilobyte) or binary units (1024 bytes). Read the question carefully; Edexcel typically follows SI units but may specify otherwise.
对压缩的解释要准确:有损意味着部分数据被永久删除;无损意味着所有原始数据都可以恢复。不要混淆采样率和位深度——采样率是测量的频率,而位深度是每次测量的精度。在文件大小计算中,要仔细留意题目使用的是 SI 单位(1 千字节 = 1000 字节)还是二进制单位(1024 字节)。仔细审题;Edexcel 通常遵循 SI 单位,但有可能另作说明。
Finally, practise as many past paper questions as you can. Data representation questions often come with structured tables and multi‑mark calculations, so time management and neat working will help you secure full marks.
最后,尽可能多地练习历年真题。数据表示题目通常带有表格结构和多分值的计算题,合理安排时间并保持卷面整洁有助于你拿到满分。
Published by TutorHao | GCSE Edexcel 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