📚 A-Level AQA Computer Science: Data Representation Exam-Focused Revision | A-Level AQA 计算机:数据表示 考点精讲
Data representation underpins every topic in the AQA A-Level Computer Science course. It explains how numbers, text, images and sound are encoded in binary, laying the foundation for understanding processors, memory, networks and algorithms. This revision guide focuses on the key concepts and question types you will meet in Papers 1 and 2: number bases, binary arithmetic, negative number encodings, character sets, bitmap and sound calculations, error detection methods, and compression techniques. Each section pairs clear explanations with worked examples to help you secure top marks.
数据表示是 AQA A-Level 计算机科学课程的基础。它解释了数字、文本、图像和声音如何以二进制编码,为理解处理器、内存、网络和算法奠定基础。本复习指南聚焦于你在卷一和卷二中将遇到的核心理念和题型:数制、二进制运算、负数编码、字符集、位图与声音计算、错误检测方法以及压缩技术。每个小节都配以清晰的解释和例题,帮助你稳拿高分。
1. Number Systems and Conversions | 数字系统与进制转换
Computers process data using binary (base‑2), but humans often work with denary (base‑10) and hexadecimal (base‑16). The ability to convert fluently between these bases is essential for answering questions on memory addressing, machine code, and colour representation. Hexadecimal is used because it is a compact way of representing long binary strings: one hex digit corresponds to exactly four bits (a nibble).
计算机使用二进制(基数为 2)处理数据,但人类通常使用十进制(基数为 10)和十六进制(基数为 16)。熟练地在这几种进制之间进行转换,对于回答有关内存地址、机器码和颜色表示的问题至关重要。使用十六进制是因为它能紧凑地表示长二进制串:一个十六进制数字恰好对应四个二进制位(半个字节)。
Conversion methods you must know:
你必须掌握的转换方法:
-
Binary to denary: sum each bit multiplied by its place value (e.g. 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 11 for 1011₂).
二进制转十进制:将每一位乘以其位权值再求和(例如 1011₂:1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 11)。
-
Denary to binary: repeatedly divide the number by 2, recording remainders, then read the remainders backwards.
十进制转二进制:反复将数值除以 2,记录余数,然后从下往上读取余数序列。
-
Hex to binary: replace each hex digit with its 4‑bit binary equivalent (e.g. A₁₆ = 1010₂, F₁₆ = 1111₂).
十六进制转二进制:将每个十六进制数字替换为对应的 4 位二进制(例如 A₁₆ = 1010₂,F₁₆ = 1111₂)。
-
Hex to denary: multiply each digit by its 16⁰, 16¹, 16²… place value and sum (e.g. 2A₁₆ = 2×16¹ + 10×16⁰ = 42).
十六进制转十进制:将每一位数字乘以相应的 16⁰、16¹、16² … 位权值并求和(例如 2A₁₆ = 2×16¹ + 10×16⁰ = 42)。
A common exam task is to convert between hex and denary directly via binary. Remember that the largest 8‑bit numbers are FF₁₆ = 255₁₀.
常见的考试题型是借助二进制直接在十六进制和十进制之间转换。记住,最大的 8 位二进制值对应的十六进制为 FF₁₆,十进制为 255₁₀。
| Hexadecimal | Binary | Denary |
|---|---|---|
| 0 | 0000 | 0 |
| 9 | 1001 | 9 |
| A | 1010 | 10 |
| F | 1111 | 15 |
AQA exam questions often present a mixture of these conversions inside larger problems about colour depth or memory addressing.
AQA 考题经常把这些转换融入关于颜色深度或内存寻址的综合性问题中。
2. Units of Information | 信息单位
Digital systems measure information using a hierarchy of units. The fundamental unit is the bit (b), followed by the byte (B) which is usually 8 bits. For larger quantities, you must distinguish between binary prefixes (IEC) and decimal prefixes (SI). Binary prefixes are based on powers of 2 and are the correct way to measure RAM and storage as quoted by operating systems; decimal prefixes use powers of 10 and are adopted by hard‑disk manufacturers.
数字系统使用一系列单位来度量信息。最基本的单位是比特(bit,b),紧接着是字节(byte,B),通常为 8 位。对于更大的数量,你必须区分二进制词头(IEC 标准)和十进制词头(SI 标准)。二进制词头基于 2 的幂,是操作系统引用 RAM 和存储空间时应使用的正确方式;十进制词头使用 10 的幂,硬盘制造商常采用这种方式。
| Prefix (IEC) | Factor | Prefix (SI) | Factor |
|---|---|---|---|
| kibi (Ki) | 2¹⁰ = 1024 | kilo (k) | 10³ = 1000 |
| mebi (Mi) | 2²⁰ = 1 048 576 | mega (M) | 10⁶ = 1 000 000 |
| gibi (Gi) | 2³⁰ | giga (G) | 10⁹ |
When calculating file sizes or storage requirements, always check whether the question uses binary or decimal prefixes. A typical question might ask: “A 4 GiB memory stick stores a file of 2000 MiB; how many bytes remain free?” The answer must be computed in binary units and then possibly converted to bytes or gibibytes.
计算文件大小或存储需求时,一定要先确认题目使用的是二进制词头还是十进制词头。一道典型的考题可能会问:“一根 4 GiB 的记忆棒存放了一个 2000 MiB 的文件,还剩余多少字节?” 答案必须用二进制单位计算,然后再转换为字节或吉比字节。
3. Binary Addition and Shifts | 二进制加法与移位
Binary addition follows the same principles as denary addition: 0+0=0, 0+1=1, 1+1=0 carry 1, 1+1+carry=1 carry 1. Overflow occurs when the result of an addition exceeds the number of bits allocated. For example, adding 1100₂ (12) and 0111₂ (7) in 4 bits yields 0011₂ with a carry‑out, giving the incorrect result 3 because the true sum 19 cannot be represented in 4 bits. Processors set an overflow flag to signal this condition.
二进制加法遵循与十进制加法相同的原则:0+0=0,0+1=1,1+1=0 进位 1,1+1+进位=1 进位 1。当加法结果超出分配的位数时,就会发生溢出。例如,在 4 位下将 1100₂(12)和 0111₂(7)相加,得到 0011₂ 并产生一个进位输出,给出错误的结果 3,因为真实的和 19 无法用 4 位表示。处理器会设置溢出标志来指示此状态。
Logical and arithmetic shifts manipulate binary patterns efficiently. A left logical shift moves every bit one place to the left, filling the least significant bit with 0; this has the effect of multiplying the unsigned value by 2. A right logical shift divides an unsigned value by 2, filling the most significant bit with 0. Arithmetic shifts preserve the sign bit for signed numbers: a right arithmetic shift replicates the sign bit, which correctly divides a two’s complement number by 2 (rounding towards −∞).
逻辑移位和算术移位能高效地操控二进制模式。左逻辑移位将每一位向左移动一位,最低位补 0;其效果是让无符号值乘以 2。右逻辑移位将无符号值除以 2,最高位补 0。算术移位则保留有符号数的符号位:右算术移位会复制符号位,从而正确地将二进制补码数除以 2(向 −∞ 方向舍入)。
Example: 8‑bit pattern 1110 0100 (−28 in two’s complement). An arithmetic right shift by one produces 1111 0010, which is −14 — exactly halved.
示例:8 位模式 1110 0100(二进制补码为 −28)。向右算术移一位后得到 1111 0010,即 −14 —— 正好是原来的一半。
4. Representing Negative Numbers | 负数表示
AQA requires you to know two methods for representing signed integers: sign‑magnitude and two’s complement.
AQA 要求你掌握两种有符号整数的表示方法:符号‑绝对值法和二进制补码法。
Sign‑magnitude uses the most significant bit (MSB) as a sign bit (0 for positive, 1 for negative) and the remaining bits for the magnitude. For an 8‑bit register, +5 is 0000 0101, while −5 is 1000 0101. This representation is simple but causes two zeros (+0 and −0) and complicates arithmetic circuitry.
符号‑绝对值法将最高有效位 (MSB) 用作符号位(0 表示正,1 表示负),其余位表示数值大小。对于 8 位寄存器,+5 为 0000 0101,而 −5 为 1000 0101。这种表示法虽然简单,却会出现两个零(+0 和 −0),并使算术电路变得复杂。
Two’s complement overcomes these problems and is universally used in modern computers. The MSB is still a sign bit, but it also carries a negative place value of −2ⁿ⁻¹ for an n‑bit number. The range of an n‑bit two’s complement integer is −2ⁿ⁻¹ to 2ⁿ⁻¹−1. To negate a number:
二进制补码法克服了上述缺点,并已普遍用于现代计算机。MSB 仍然是符号位,但它同时携带一个负的位权值 −2ⁿ⁻¹(对于 n 位数)。n 位二进制补码整数的范围为 −2ⁿ⁻¹ 到 2ⁿ⁻¹−1。对一个数求负的步骤如下:
-
Invert all bits (one’s complement).
反转所有位(二进制反码)。
-
Add 1 to the least significant bit.
在最低位加 1。
Example in 8 bits: to find −13₁₀: +13 = 0000 1101 → invert → 1111 0010 → add 1 → 1111 0011. Checking: 1111 0011₂ = −128 + 64 + 32 + 16 + 2 + 1 = −13.
以 8 位为例:求 −13₁₀:+13 = 0000 1101 → 反转 → 1111 0010 → 加 1 → 1111 0011。验证:1111 0011₂ = −128 + 64 + 32 + 16 + 2 + 1 = −13。
Two’s complement simplifies subtraction to addition of the two’s complement of the subtrahend. Overflow detection for signed addition examines the carry into and out of the MSB: if they differ, overflow has occurred, indicating the result is outside the representable range.
二进制补码将减法简化为对被减数补码的加法。有符号加法的溢出检测会检查进入和离开 MSB 的进位:如果二者不一致,则发生了溢出,表明结果超出了可表示的范围。
5. Fixed and Floating Point | 定点与浮点表示
Numbers with fractional parts require a different representation. Fixed point allocates a set number of bits to the integer part and the fractional part, implicitly placing the binary point at a fixed position. For example, in an 8‑bit format with 5 bits for the integer and 3 bits for the fraction, 01101.100₂ represents 8 + 4 + 1 + 0.5 = 13.5. Fixed point offers limited range and precision, making it unsuitable for very large or very small numbers.
带有小数部分的数字需要不同的表示方式。定点表示法为整数部分和小数部分分别分配固定的位数,隐式地将二进制小数点固定在一个位置上。例如,在一个整数部分 5 位、小数部分 3 位的 8 位格式中,01101.100₂ 表示 8 + 4 + 1 + 0.5 = 13.5。定点表示的范围和精度有限,不适合非常大或非常小的数字。
Floating point representation dramatically extends range by storing numbers in a form akin to scientific notation: ± mantissa × 2^exponent. AQA expects you to understand binary floating point with a given allocation of bits for the mantissa (signed, two’s complement) and the exponent. When converting a binary floating‑point number to denary:
浮点表示通过以类似于科学记数法的形式存储数字:± 尾数 × 2^指数,极大地扩展了范围。AQA 要求你理解给定尾数(有符号,二进制补码)和指数位数分配下的二进制浮点表示。将二进制浮点数转换为十进制时:
-
Separate the mantissa and exponent bits. Apply two’s complement to both if they are signed. 分离尾数和指数位。如果二者均为有符号数,则分别应用二进制补码。
-
Move the binary point in the mantissa by the number of places given by the exponent (right for positive exponent, left for negative). 根据指数给出的位数移动尾数中的二进制小数点(正指数向右移,负指数向左移)。
-
Convert the resulting fixed‑point binary into denary. 将得到的定点二进制数转换为十进制。
Normalisation ensures a unique representation by adjusting the mantissa and exponent so that the mantissa’s MSB differs from the bit to its right. This maximises precision and is often tested in context‑based questions.
规范化通过调整尾数和指数,使得尾数的 MSB 与其右侧位不同,从而确保表示的唯一性。这能将精度最大化,常在情境题中考察。
6. Character Encoding | 字符编码
Characters are stored as binary codes. ASCII (American Standard Code for Information Interchange) originally used 7 bits, encoding 128 characters including control codes, digits, uppercase and lowercase letters. Extended ASCII uses 8 bits for 256 characters, providing coverage for additional symbols and accented characters used in Western European languages.
字符以二进制代码存储。ASCII(美国信息交换标准代码)最初使用 7 位,编码了 128 个字符,包括控制码、数字、大小写字母。扩展 ASCII 则使用 8 位,编码 256 个字符,覆盖了西欧语言中额外的符号和带重音的字符。
Unicode was developed to encompass all the world’s writing systems, with encodings such as UTF‑8, UTF‑16 and UTF‑32. UTF‑8 is backward‑compatible with ASCII: the first 128 characters are identical, but it uses multiple bytes for characters from other scripts. While Unicode enables global text exchange, it may require more storage than ASCII for non‑English text.
Unicode 为囊括世界上所有的书写系统而开发,其编码方案有 UTF‑8、UTF‑16 和 UTF‑32 等。UTF‑8 向后兼容 ASCII:前 128 个字符完全一致,但对于其他文字的字符则使用多字节表示。虽然 Unicode 能够实现全球文本交流,但对于非英语文本,它可能需要比 ASCII 更大的存储空间。
Exam questions often present a text string and ask for the binary representation using 7‑bit ASCII, or discuss the advantages of Unicode over ASCII in the context of internationalisation.
考试题目经常给出一段文本字符串,要求使用 7 位 ASCII 给出其二进制表示,或者在国际化背景下讨论 Unicode 相较于 ASCII 的优势。
7. Bitmap Images | 位图图像
A bitmap image is built from a grid of picture elements (pixels). Each pixel’s colour is stored as a binary code; the number of bits per pixel is the colour depth (bpp). A colour depth of 1 bit gives 2 colours (monochrome); 8 bits give 256 colours; 24 bits (8 per red, green, blue channel) give over 16 million colours, often called true colour.
位图图像由一个个图像元素(像素)组成的网格构成。每个像素的颜色被存储为一个二进制代码;每个像素的位数即为颜色深度 (bpp)。颜色深度为 1 位时只有 2 种颜色(单色);8 位可有 256 种颜色;24 位(红、绿、蓝通道各 8 位)可产生超过 1600 万种颜色,常称为真彩色。
The resolution of an image is its pixel dimensions (width × height). The file size of an uncompressed bitmap can be calculated as:
图像的分辨率指其像素尺寸(宽 × 高)。未压缩位图的文件大小可按以下公式计算:
File size (bits) = width (pixels) × height (pixels) × colour depth (bits)
文件大小(位)= 宽(像素)× 高(像素)× 颜色深度(位)
For example, a 300 × 200 image with 16‑bit colour: 300 × 200 × 16 = 960 000 bits. Convert to bytes: 960 000 ÷ 8 = 120 000 B, or roughly 117.2 KiB (dividing by 1024).
例如,一张 300 × 200 像素、16 位颜色的图像:300 × 200 × 16 = 960 000 位。转换为字节:960 000 ÷ 8 = 120 000 B,约合 117.2 KiB(除以 1024)。
Always pay attention to units in the question — some ask for the answer in bytes, kibibytes or mebibytes. Remember that metadata (headers) can add extra bytes, but AQA usually specifies that metadata should be ignored unless stated otherwise.
务必留意题目中的单位 —— 有些要求以字节、千比字节或兆比字节作答。请记住,元数据(文件头)会增加额外的字节,但 AQA 通常会明确说明除非另有说明,否则忽略元数据。
8. Vector Graphics | 矢量图形
Unlike bitmaps, vector graphics store images as mathematical descriptions of shapes — lines, circles, polygons and curves — along with their properties such as position, fill colour and stroke width. A circle, for instance, is stored as centre coordinates, radius, fill colour and line style. Because the image is rendered from these instructions, vector graphics can be scaled to any size without loss of quality or an increase in file size.
与位图不同,矢量图形将图像存储为对形状(线段、圆、多边形和曲线)的数学描述,连同其属性如位置、填充颜色和描边宽度。例如,一个圆被存储为中心坐标、半径、填充颜色和线条样式。由于图像是根据这些指令渲染而成的,矢量图形可以任意缩放而不会损失质量或增加文件大小。
Vector graphics are ideal for logos, fonts and diagrams but cannot represent photographic images realistically. AQA may ask you to compare bitmap and vector storage for a given scenario, discussing file size, scalability and suitability.
矢量图形非常适合徽标、字体和图解,但无法真实地表现照片图像。AQA 可能会要求你针对给定场景比较位图和矢量存储,讨论文件大小、可缩放性和适用性。
9. Sound Representation | 声音表示
Sound is an analogue waveform. To store it digitally, a computer measures the amplitude of the wave at regular intervals — a process called sampling. Two parameters control the quality:
声音是一种模拟波形。为了以数字形式存储,计算机按固定时间间隔测量波形的振幅 —— 这一过程称为采样。两个参数控制着质量:
-
Sample rate: the number of samples taken per second, measured in hertz (Hz) or kilohertz (kHz). The Nyquist theorem states that the sample rate must be at least twice the highest frequency in the signal to avoid aliasing. CD‑quality audio uses 44.1 kHz.
采样率:每秒采集的样本数,单位为赫兹 (Hz) 或千赫兹 (kHz)。奈奎斯特定理指出,采样率必须至少是信号最高频率的两倍才能避免混叠。CD 品质音频使用的采样率为 44.1 kHz。
-
Bit depth (sampling resolution): the number of bits used to store each sample. Common values are 16‑bit (CD) and 24‑bit (studio).
位深度(采样分辨率):存储每个样本所用的位数。常见值有 16 位(CD)和 24 位(录音室)。
The file size of a mono uncompressed audio file is:
单声道未压缩音频文件的文件大小为:
File size (bits) = sample rate (Hz) × bit depth × duration (seconds)
文件大小(位)= 采样率(Hz)× 位深度 × 时长(秒)
For stereo, multiply by 2. A 10‑second stereo clip sampled at 48 kHz with 24‑bit depth: 48 000 × 24 × 10 × 2 = 23 040 000 bits = 2 880 000 B ≈ 2.75 MiB.
对于立体声,需乘以 2。一段 10 秒、48 kHz 采样率、24 位深度的立体声片段:48 000 × 24 × 10 × 2 = 23 040 000 位 = 2 880 000 B ≈ 2.75 MiB。
Increasing sample rate or bit depth improves quality but increases file size linearly. MP3 and AAC compression exploits psychoacoustic models to remove sounds the human ear cannot perceive, dramatically reducing size with minimal perceived quality loss.
提高采样率或位深度可以改善质量,但会线性增加文件大小。MP3 和 AAC 压缩利用心理声学模型移除人耳无法感知的声音,在几乎不损失听感质量的前提下大幅减小文件体积。
10. Error Detection | 错误检测
When data is transmitted or stored, it can become corrupted. Two simple methods are widely used in computing and are examined by AQA: parity bits and checksums.
数据在传输或存储过程中可能会损坏。两种简单的方法在计算领域被广泛使用,也是 AQA 的考点:奇偶校验位和校验和。
Parity adds a single bit to a binary string to make the total number of 1s either even (even parity) or odd (odd parity). The sender calculates and appends the parity bit; the receiver
Published by TutorHao | A-Level Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导