GCSE AQA Computer Science: Data Representation | GCSE AQA 计算机:数据表示 考点精讲

📚 GCSE AQA Computer Science: Data Representation | GCSE AQA 计算机:数据表示 考点精讲

Data representation lies at the heart of all computing systems. Every piece of information a computer handles – from text and images to audio – must be translated into binary digits that the hardware can process, store, and transmit. For AQA GCSE Computer Science, you are expected to understand how numbers, characters, images, and sound are encoded, how to perform binary arithmetic, why data compression matters, and the units used to measure file sizes. Mastering these concepts will not only boost your exam performance but also give you a genuine insight into the digital world around you.

数据表示是所有计算系统的核心。计算机处理的每一条信息——无论是文本、图像还是音频——都必须转换成硬件能够处理、存储和传输的二进制数字。在 AQA GCSE 计算机科学考试中,你需要理解数字、字符、图像和声音是如何编码的,如何进行二进制算术运算,数据压缩为何重要,以及衡量文件大小的单位。掌握这些概念不仅能提高你的考试成绩,也能让你真正洞察身边的数字世界。

1. Number Bases and Conversions | 数制与转换

Computers use base‑2 (binary) because their circuits can easily distinguish between two states: on and off. Humans, however, find long strings of 1s and 0s awkward, so we often work with base‑10 (denary) and base‑16 (hexadecimal). Being able to convert fluently between these three bases is a core exam skill.

计算机使用二进制(基数为 2),因为电路很容易区分两种状态:开和关。然而,人类觉得长串的 1 和 0 很别扭,所以我们常使用十进制和十六进制。能够在三种数制之间熟练转换是一项核心考试技能。

Binary to denary: Write the column values (128, 64, 32, 16, 8, 4, 2, 1) above each bit, add the values where a 1 appears. For example, 01101001₂ = 64 + 32 + 8 + 1 = 105.

二进制转十进制: 在每个比特上方写出位权(128、64、32、16、8、4、2、1),将出现 1 的位权相加。例如,01101001₂ = 64 + 32 + 8 + 1 = 105。

Denary to binary: Repeatedly divide by 2, recording the remainder each time; read the remainders upwards. Alternatively, use the “subtract the largest power of two” method.

十进制转二进制: 反复除以 2,记录每次的余数,然后将余数从下往上读。也可以使用“减最大 2 的幂”的方法。

Hexadecimal: Base‑16 uses digits 0‑9 and letters A‑F (A=10, B=11, …, F=15). Each hex digit represents exactly four bits (a nibble), making hex a compact way to write binary. To convert binary to hex, split the binary number into groups of four bits from the right, then replace each group with its hex equivalent. Denary to hex can be done by first converting to binary or by repeated division by 16.

十六进制: 基数为 16,使用数字 0‑9 和字母 A‑F(A=10,B=11,…,F=15)。每个十六进制位恰好代表四个比特(一个半字节),因此十六进制是二进制的紧凑表示。将二进制转换为十六进制时,从右往左将二进制数每四位分为一组,再将每组替换为对应的十六进制字符。十进制转十六进制可以先转为二进制,或者反复除以 16。


2. Binary Arithmetic and Overflow | 二进制算术与溢出

Addition in binary follows simple rules: 0+0=0, 0+1=1, 1+0=1, 1+1=0 (carry 1), 1+1+1 (from carry) = 1 (carry 1). When adding two 8‑bit numbers, the result can exceed 255, causing an overflow error. An overflow occurs when the result requires a 9th bit that cannot be stored in the 8‑bit register. The CPU uses an overflow flag to signal this condition, and programs must handle it to avoid incorrect results.

二进制加法遵循简单规则:0+0=0,0+1=1,1+0=1,1+1=0(进位 1),1+1+1(来自进位)=1(进位 1)。两个 8 位二进制数相加时,结果可能超过 255,导致溢出错误。当结果需要第 9 位而 8 位寄存器无法存储时,就发生了溢出。CPU 使用溢出标志来指示这一情况,程序必须处理溢出以免得到错误结果。

Exam tip: Always check if the sum of the column values exceeds the maximum for the given bit‑width. In an 8‑bit system, the largest unsigned integer is 255 (11111111₂). If your addition produces any carry out of the most significant bit, an overflow has occurred.

考试提示: 一定要检查各位权之和是否超出了指定位宽的最大值。在 8 位系统中,最大的无符号整数是 255(11111111₂)。如果加法在最高位产生进位,就发生了溢出。


3. Binary Shifts | 二进制移位

Shifting bits to the left or right is an efficient way to multiply or divide by powers of two. A logical shift left by n places multiplies the unsigned binary number by 2ⁿ. Any bits shifted out of the register are discarded, and the vacant right‑hand bits are filled with zeros. A logical shift right performs integer division by 2ⁿ; the vacant left‑hand bits become zeros. Arithmetic shifts (for signed numbers) preserve the sign bit during right shifts, but at GCSE the focus is on logical shifts for unsigned integers. Shifts are much faster than standard multiplication and division circuits, which is why compilers often turn ×2 operations into shift instructions.

将比特向左或向右移动,是一种高效地乘以或除以 2 的幂的方法。逻辑左移 n 位可将无符号二进制数乘以 2ⁿ。移出寄存器的位会被丢弃,右边空出的位用 0 填充。逻辑右移则进行除以 2ⁿ 的整数除法,左边空出的位填 0。算术移位(用于有符号数)在右移时会保留符号位,但 GCSE 阶段重点关注无符号整数的逻辑移位。移位比标准的乘除法电路快得多,所以编译器常把 ×2 运算转换为移位指令。

Careful: A left shift can also cause overflow if the most significant bits shifted out contain a 1. For instance, left‑shifting 10100000₂ by one place gives 01000000₂, which is not the expected double – the leading 1 has been lost.

注意: 如果移出的最高位含有 1,左移也可能导致溢出。例如,将 10100000₂ 左移一位得到 01000000₂,并不是预期的两倍——因为前导的 1 丢失了。


4. Units of Data | 数据单位

Digital storage is measured using standard prefixes. The smallest unit is a bit (b), followed by a nibble (4 bits), then a byte (B, 8 bits). Larger units are built on powers of 2, though the exam board accepts both historical binary multipliers and the newer IEC prefixes. You need to be comfortable with the following hierarchy:

数字存储使用标准前缀来衡量。最小单位是比特(bit),接着是半字节(4 比特),然后是字节(B,8 比特)。更大的单位基于 2 的幂次构建,尽管考试局同时接受传统的二进制倍数和较新的 IEC 前缀。你需要熟悉以下层级:

Unit Abbreviation Size in bytes
Kilobyte KB 10³ B (or 2¹⁰ B = 1024 B)
Megabyte MB 10⁶ B (or 2²⁰ B ≈ 1.05×10⁶)
Gigabyte GB 10⁹ B (or 2³⁰ B ≈ 1.07×10⁹)
Terabyte TB 10¹² B (or 2⁴⁰ B ≈ 1.10×10¹²)

When solving file‑size questions, convert all values to the same unit (usually bytes) before calculating. Remember that 1 byte = 8 bits, so to convert from bits to bytes you divide by 8, and from bytes to bits you multiply by 8.

解答文件大小计算题时,应先将所有数值转换为同一单位(通常是字节),然后再进行计算。记住 1 字节 = 8 比特,所以从比特转换为字节除以 8,从字节转换为比特乘以 8。


5. Character Encoding | 字符编码

To store text, computers assign a unique binary number to each character. The two most important character sets you need to know are ASCII and Unicode. ASCII uses 7 bits, providing codes for 128 characters (0–127), which cover English letters, digits, punctuation, and control characters. Extended ASCII uses 8 bits, offering an additional 128 codes for symbols and characters used in other Western languages.

为了存储文本,计算机为每个字符分配一个唯一的二进制编号。你需要了解的两种最重要的字符集是 ASCII 和 Unicode。ASCII 使用 7 比特,能表示 128 个字符(0–127),涵盖了英文字母、数字、标点符号以及控制字符。扩展 ASCII 使用 8 比特,额外提供了 128 个码位,用于其他西方语言的符号和字符。

Unicode was created to overcome the limitation of ASCII – it can represent characters from virtually all the world’s writing systems. Unicode uses up to 32 bits per character (though common encodings like UTF‑8 are variable‑width). The standard ASCII set corresponds to the first 128 Unicode code points, ensuring backward compatibility. While Unicode allows truly global communication, it takes up more storage space per character than plain ASCII, which is a trade‑off that developers must consider.

Unicode 的诞生是为了克服 ASCII 的局限性——它几乎可以表示世界上所有的文字系统。Unicode 每个字符最多可使用 32 比特(不过 UTF‑8 等常用编码是变长编码)。标准 ASCII 字符集对应 Unicode 的前 128 个码点,保证了向后兼容。虽然 Unicode 实现了真正的全球通信,但每个字符占用的存储空间比纯 ASCII 更大,这是开发者必须权衡的取舍。


6. Representing Images | 图像的表示

A bitmap image is composed of a grid of picture elements, or pixels. Each pixel’s colour is stored as a binary number. The number of bits used for each pixel is the colour depth (or bit depth). A 1‑bit image can show only two colours (black and white); an 8‑bit image can display 256 colours; a 24‑bit (true colour) image can represent about 16.7 million colours.

位图由一格格称为“像素”的画面元素组成。每个像素的颜色以二进制数存储。每个像素所用的比特数称为颜色深度(或位深)。1 位图像只能显示两种颜色(黑白);8 位图像可显示 256 种颜色;24 位(真色彩)图像可以表示约 1670 万种颜色。

Resolution is the number of pixels in the image, often given as width × height (e.g. 1920 × 1080). Higher resolution means more detail but larger file size.

分辨率 是图像中的像素数量,通常以 宽 × 高 表示(如 1920 × 1080)。分辨率越高,细节越丰富,但文件大小也越大。

Calculating image file size:

File size (bits) = width × height × colour depth

Then convert bits to bytes (divide by 8) and further to KB, MB, etc. as needed. Always show your working when answering exam questions.

图像文件大小计算:

文件大小(比特)= 宽度 × 高度 × 颜色深度

然后将比特转换为字节(除以 8),再根据需要转换为 KB、MB 等。回答考试题目时一定要展示计算过程。

Metadata such as the date, camera settings, and file format header also adds to the overall file size, but the pixel data dominates the calculation.

日期、相机设置、文件格式头等元数据也会增加文件总大小,但像素数据占主导地位。


7. Representing Sound | 声音的表示

Sound is analogue – it exists as a continuous wave. To store it digitally, an analogue‑to‑digital converter (ADC) takes regular samples of the wave’s amplitude. The sample rate (measured in Hz) is how many samples are taken per second. The sample resolution (or bit depth) is the number of bits used to store each sample. Higher sample rates and resolutions produce more faithful reproductions but also larger files.

声音是模拟信号——它以连续波的形式存在。为了以数字方式存储,模数转换器(ADC)定期对声波的振幅进行采样。采样率(以 Hz 为单位)表示每秒采集的样本数。采样分辨率(或位深)是每个样本存储所用的比特数。采样率和分辨率越高,声音还原越逼真,但文件也越大。

Calculating sound file size:

File size (bits) = sample rate × sample resolution × duration (seconds)

For stereo files, multiply the result by the number of channels (usually 2). As with images, convert bits to bytes and to larger units as the question demands.

声音文件大小计算:

文件大小(比特)= 采样率 × 采样分辨率 × 时长(秒)

对于立体声文件,需将结果乘以声道数(通常为 2)。与图像一样,要根据题目要求将比特转换为字节,再转换为更大的单位。

Bit rate (kbps or bps) is simply the product of sample rate and sample resolution (and number of channels). It tells you how much audio data is processed per second, and it is frequently used when comparing audio quality or streaming requirements.

比特率(kbps 或 bps)就是采样率、采样分辨率(以及声道数)的乘积。它说明每秒处理多少音频数据,常用于比较音频质量或流媒体传输需求。


8. Data Compression | 数据压缩

Compression reduces the number of bits needed to represent data, making files smaller for storage and faster to transmit over networks. The two main families are lossy and lossless compression.

压缩可以减少表示数据所需的比特数,使文件更小,便于存储并加快网络传输速度。两大类压缩方法分别是有损压缩和无损压缩。

Lossy compression permanently removes some detail that is considered less noticeable. Common examples include JPEG for photographs, MP3 for audio, and MPEG for video. Lossy methods achieve dramatic size reductions, but the original data cannot be perfectly recovered. They are ideal for multimedia where a small loss in quality is acceptable.

有损压缩 会永久性地移除了被认为不太明显的细节。常见的例子包括照片用的 JPEG、音频用的 MP3、视频用的 MPEG。有损方法能大幅缩小文件体积,但原始数据无法完美复原。它们非常适合多媒体应用,因为轻微的质量损失是可以接受的。

Lossless compression preserves every bit of original data. It exploits patterns and repeated sequences to encode information more efficiently. Examples include PNG for images, FLAC for audio, and ZIP for general files. Lossless compression is essential for text documents, software, and any situation where data integrity is paramount. Run‑length encoding (RLE) is a simple lossless technique often examined at GCSE: a sequence of repeated pixels like “BBBBBB” would be stored as “6B”, saving space when large blocks of identical colour appear.

无损压缩 会保留原始数据的每一个比特。它利用模式和重复序列来更高效地编码信息。例子包括图像的 PNG、音频的 FLAC 以及通用文件的 ZIP。对于文本文档、软件以及任何数据完整性至关重要的场景,无损压缩必不可少。行程编码(RLE)是 GCSE 常考的一种简单无损技术:一连串重复的像素,如“BBBBBB”,将被存储为“6B”,当出现大块相同颜色时能够节省空间。


9. Common Mistakes and Exam Tips | 常见错误与应试技巧

Many marks are lost through simple slip‑ups that can be avoided with careful practice. First, always double‑check your unit conversions: when a question gives a size in bits and asks for an answer in MB, remember to divide by 8 and then by the appropriate power of 10 (or 2). Second, in binary addition, work methodically from right to left and mark carries clearly; forgetting to carry the 1 is the single most frequent error. Third, when describing character encoding, don’t confuse the terms “character set” and “character code” – the former refers to the entire collection, the latter to a specific assignment. Fourth, in image‑size calculations, ensure you multiply width × height × colour depth before any unit conversions; if the colour depth is given in bits per pixel, the product is in bits.

许多失分可以通过细心练习来避免。首先,务必仔细检查单位换算:如果题目以比特为单位提供大小,并要求以 MB 为单位回答,记得先除以 8,再除以相应的 10(或 2)的幂。其次,二进制加法要从右到左有条理地进行,并清楚标记进位;忘记进位 1 是最常见的错误。第三,在描述字符编码时,不要混淆“字符集”和“字符码”这两个术语——前者指整个集合,后者指某个具体的赋值。第四,在图像大小计算中,确保在任何单位换算之前先进行 宽度 × 高度 × 颜色深度 的计算;如果颜色深度以 每像素比特数 给出,那么乘积的单位就是比特。

Also, when explaining overflow, link it explicitly to the fixed bit‑width of the register – marks are allocated for recognising that the result no longer fits in the available number of bits. For compression, be prepared to give advantages and disadvantages of each type, and always support your answer with a real‑world example (e.g., “JPEG uses lossy compression to reduce file size for web uploads, but a PNG logo would use lossless to keep edges sharp”). Finally, use the formula triangles or write out full equations to keep your working clear; partial credit is often awarded for a correct method even if the final answer is wrong.

此外,在解释溢出时,要明确联系寄存器的固定位宽——评分点在于认识到结果不再适合可用的比特数。对于压缩,要准备好说出每种类型的优缺点,并始终用一个现实世界的例子来佐证你的答案(例如,“JPEG 使用有损压缩来缩减文件以利网页上传,而 PNG 标志则使用无损压缩以保持边缘清晰”)。最后,运用公式三角形或写出完整的方程式,使计算步骤清晰可见;即使最终答案错误,方法正确通常也能获得部分分数。

Published by TutorHao | GCSE Computer Science Revision Series | aleveler.com

更多咨询请联系16621398022(同微信)

Comments

屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from aleveler.com

Subscribe now to keep reading and get access to the full archive.

Continue reading