📚 IGCSE CCEA Computer Science: Data Representation Essentials | 数据表示 考点精讲
In IGCSE CCEA Computer Science, data representation is all about how computers store and manipulate different types of information using binary. This topic underpins everything from simple text to complex images and sound, so mastering it is vital for your exam success.
在 IGCSE CCEA 计算机科学中,数据表示是关于计算机如何使用二进制存储和处理各类信息的基础内容。从简单的文本到复杂的图像和声音,这一主题贯穿始终,掌握它对考试成功至关重要。
1. Understanding Data Representation | 理解数据表示
Computers are built from billions of tiny switches called transistors, which can only be ON (1) or OFF (0). This two-state system makes binary — base‑2 — the natural language of computers. All data, whether numbers, text, images or sound, must be converted into patterns of 1s and 0s before a computer can process it.
计算机由数十亿个微小的开关(晶体管)构成,这些开关只有开(1)或关(0)两种状态。这种双态系统使得二进制(基数为2)成为计算机的自然语言。所有数据,无论是数字、文本、图像还是声音,都必须先转换为由1和0组成的模式,计算机才能处理。
2. Binary and Denary Numbers | 二进制与十进制数字
The denary (decimal) system uses ten digits (0–9) and powers of 10 for place values. Binary uses only two digits (0 and 1) and powers of 2. For example, the binary number 10112 means (1×8)+(0×4)+(1×2)+(1×1) = 1110. In the exam you must be able to convert positive denary integers up to 255 into 8‑bit binary and vice versa.
十进制系统使用十个数字(0–9)并以10的幂作为位权。二进制只使用两个数字(0和1)并以2的幂作为位权。例如,二进制数10112表示 (1×8)+(0×4)+(1×2)+(1×1) = 1110。考试中你必须能将不超过255的正十进制整数转换为8位二进制,反之亦然。
128 64 32 16 8 4 2 1
Tip: Write out the 8‑bit place values and place a 1 or 0 under each to build or read the binary number.
技巧:写出8位位权,在每个位权下写1或0来构建或读取二进制数。
3. Hexadecimal Number System | 十六进制系统
Hexadecimal (base‑16) uses digits 0–9 and letters A (10) to F (15). It is widely used by programmers because one hex digit perfectly represents a nibble (4 bits), making long binary sequences compact and easier to read, e.g. 1101 01112 = D716.
十六进制(基数为16)使用数字0–9和字母A(10)到F(15)。它被程序員广泛使用,因为一个十六进制位恰好可以表示一个半字节(4位),使长二进制序列变得紧凑且易于阅读,例如1101 01112 = D716。
CCEA exam questions often ask you to convert between binary, denary and hex, and to explain why hex is used — for shorter representation and fewer reading errors.
CCEA 考试常要求你在二进制、十进制和十六进制之间转换,并解释为什么使用十六进制——为了更短的表示形式和更少的阅读错误。
4. Converting Between Systems | 系统之间的转换
Denary to binary: Repeatedly divide by 2, noting remainders. Read remainders backwards. Or subtract the largest power of 2.
十进制转二进制:不断除以2,记录余数,反向读取余数。或者减去最大的2的幂。
Binary to hex: Group binary into nibbles (4 bits) from the right, then convert each nibble to its hex value.
二进制转十六进制:从右向左将二进制数每4位分成一组(半字节),然后将每个半字节转换为对应的十六进制值。
Denary to hex: First convert to binary, then to hex; or divide by 16, recording remainders.
十进制转十六进制:先转换为二进制再转换为十六进制;或者除以16,记录余数。
Practice is essential — you should do these conversions without a calculator.
练习非常重要——你应该在不使用计算器的情况下完成这些转换。
5. Units of Data Storage | 数据存储单位
A single binary digit is a bit. 8 bits make a byte, which can hold one character. Larger units follow powers of 2:
一个二进制位称为一位(bit)。8位组成一个字节(byte),可以存储一个字符。更大的单位基于2的幂:
- Bit (b) — smallest unit | 位 (b) — 最小单位
- Nibble — 4 bits | 半字节 — 4位
- Byte (B) — 8 bits | 字节 (B) — 8位
- Kilobyte (KB) — 1024 bytes (210) | 千字节 (KB) — 1024字节
- Megabyte (MB) — 1024 KB (220 bytes) | 兆字节 (MB) — 1024 KB
- Gigabyte (GB) — 1024 MB | 吉字节 (GB) — 1024 MB
- Terabyte (TB) — 1024 GB | 太字节 (TB) — 1024 GB
Remember, CCEA expects you to know that storage sizes are based on powers of 2, not powers of 10.
请记住,CCEA 要求你知道存储大小基于2的幂,而不是10的幂。
6. Binary Addition and Overflow | 二进制加法与溢出
Binary addition follows similar rules to denary addition but only uses 0 and 1: 0+0=0, 0+1=1, 1+0=1, 1+1=0 carry 1, 1+1+carry 1 = 1 carry 1. You may be asked to add two 8‑bit binary numbers.
二进制加法遵循与十进制加法类似的规则,但只使用0和1:0+0=0、0+1=1、1+0=1、1+1=0进1、1+1+进位1=1进1。你可能会被要求将两个8位二进制数相加。
If the result exceeds 8 bits (e.g. 25510 + 1 = 1 0000 00002), the extra bit cannot be stored in an 8‑bit register — this is called overflow. Overflow can cause unexpected results and is a source of software bugs.
如果结果超过8位(例如25510 + 1 = 1 0000 00002),多余的位无法存储在8位寄存器中——这称为溢出。溢出可能导致意想不到的结果,是软件错误的一个来源。
7. Character Encoding: ASCII and Unicode | 字符编码:ASCII 与 Unicode
Characters are stored by assigning each a unique binary code. ASCII uses 7 bits per character (extended ASCII uses 8 bits), allowing 128 (or 256) different symbols, including English letters, digits and basic punctuation. It is compact but cannot represent languages like Chinese or Arabic.
字符通过为每个字符分配唯一的二进制代码来存储。ASCII 每个字符使用7位(扩展ASCII使用8位),可以表示128(或256)个不同符号,包括英文字母、数字和基本标点。它很紧凑但不能表示中文或阿拉伯语等语言。
Unicode uses up to 32 bits per character and can encode over 140,000 characters from all major world scripts and emojis. The most common Unicode encoding is UTF‑8, which is backwards‑compatible with ASCII. CCEA frequently asks you to compare ASCII and Unicode in terms of storage size and language support.
Unicode 每个字符最多可使用32位,可以编码超过140,000个字符,涵盖全球主要文字和表情符号。最常见的Unicode编码是UTF‑8,它与ASCII向后兼容。CCEA 经常要求你比较 ASCII 和 Unicode 在存储大小和语言支持方面的差异。
8. Representing Images | 图像表示
Images are stored as bitmaps — a grid of tiny dots called pixels. Each pixel is assigned a binary value that represents its colour. Two key factors determine image quality and file size:
图像以位图的形式存储——一个由称为像素的微小点组成的网格。每个像素被赋予一个表示其颜色的二进制值。决定图像质量和文件大小的两个关键因素是:
- Colour depth — the number of bits used for each pixel. 1‑bit = 2 colours, 8‑bit = 256 colours, 24‑bit = approx. 16.7 million colours (true colour). | 颜色深度 — 每个像素使用的位数。1位 = 2种颜色,8位 = 256种颜色,24位 ≈ 1670万种颜色(真彩色)。
- Resolution — the total number of pixels in the image, e.g. width × height in pixels. Higher resolution means more detail but larger file size. | 分辨率 — 图像中的像素总数,例如以像素为单位的宽×高。分辨率越高,细节越多,但文件越大。
Image file size (bits) = width (px) × height (px) × colour depth (bits)
You must be able to use this formula to calculate file sizes or the maximum number of colours possible.
你必须能够使用此公式计算文件大小或可能的最大颜色数量。
Metadata is extra data stored with the image (e.g. date, camera model, colour depth) and increases the file size slightly. | 元数据是与图像一起存储的额外数据(例如日期、相机型号、颜色深度),会略微增加文件大小。
9. Representing Sound | 声音表示
Sound is analogue, so it must be converted to digital by sampling. The smooth sound wave is measured at regular intervals and each measurement is converted into a binary number. The key factors are:
声音是模拟信号,因此必须通过采样转换为数字信号。声波在均匀的时间间隔上被测量,每个测量值被转换为二进制数。关键因素有:
- Sampling rate — number of samples taken per second, measured in Hertz (Hz). Standard CD quality is 44,100 Hz. Higher rate = better quality, larger file. | 采样率 — 每秒采集的样本数,以赫兹(Hz)度量。标准 CD 质量为 44,100 Hz。采样率越高,音质越好,文件越大。
- Bit depth — number of bits per sample. 16‑bit audio provides 65,536 possible amplitudes, giving a very accurate representation. | 位深度 — 每个样本的位数。16 位音频提供 65,536 个可能的振幅级别,实现非常精确的表示。
- Duration — length of the sound in seconds. | 时长 — 声音的长度(秒)。
- Channels — mono (1 channel) or stereo (2 channels). | 声道 — 单声道(1个声道)或立体声(2个声道)。
Sound file size (bits) = sampling rate (Hz) × bit depth × duration (s) × channels
Higher sampling rate and bit depth give better fidelity but dramatically increase file size.
更高的采样率和位深度提供更好的保真度,但会显著增大文件大小。
10. Data Compression | 数据压缩
Compression reduces file size to save storage space and speed up transmission over networks. There are two types:
压缩可减小文件大小,以节省存储空间并加快网络传输速度。有两种类型:
- Lossless compression — reduces file size without losing any original data. When the file is decompressed, it is identical to the original. It uses techniques like run‑length encoding (RLE) and Huffman coding. Suitable for text, program files, and documents where no data loss is acceptable. | 无损压缩 — 减小文件大小而不丢失任何原始数据。解压缩后,文件与原始文件完全相同。它使用行程编码(RLE)和霍夫曼编码等技术。适用于文本、程序文件及不容许数据丢失的文档。
- Lossy compression — permanently removes some data deemed less important to reduce file size. The decompressed file is not exactly the same as the original, but the difference may be imperceptible. Used for JPEG images and MP3 audio. | 有损压缩 — 永久性删除部分被认为不重要的数据以减小文件大小。解压后的文件与原文件不完全相同,但差异可能难以察觉。用于 JPEG 图像和 MP3 音频。
CCEA often asks you to choose a suitable compression method for a given scenario and justify your choice.
CCEA 经常要求你为给定场景选择合适的压缩方法并说明理由。
11. Key Formulas and Calculations | 关键公式与计算
Memorising these formulas and practising calculations is essential for the exam:
记忆以下公式并练习计算对考试至关重要:
Number of colours = 2colour depth | 颜色数量 = 2颜色深度
Image file size (bits) = width × height × colour depth | 图像文件大小(位) = 宽 × 高 × 颜色深度
Sound file size (bits) = sample rate × bit depth × duration × channels | 声音文件大小(位) = 采样率 × 位深度 × 时长 × 声道数
Always convert bits to bytes by dividing by 8, and then to KB, MB etc. if required. Show your working clearly in exam answers.
始终将位转换为字节(除以8),如有需要再转换为 KB、MB 等。在考试答案中清晰展示你的计算步骤。
12. Exam Tips and Common Mistakes | 考试技巧与常见错误
Always label your base: Write 1012 not just 101, or A716 etc. This shows the examiner you understand the number system. | 始终标注基数:写出 1012 而不仅仅是 101,或 A716 等。这向考官表明你理解进制。
Check your binary conversions: A quick check is adding the place values where 1s appear. | 检查你的二进制转换:一个快速检查方法是将出现1的位权相加。
Don’t confuse bits and bytes: Pay close attention to whether the question asks for file size in bits or bytes, and convert accordingly. | 不要混淆位与字节:仔细看清题目要求文件大小的单位是位还是字节,并相应进行换算。
Explain why, not just how: For hex or Unicode questions, be ready to give a reason for their use (e.g. hex makes reading easier, Unicode supports many languages). | 解释原因,而不仅是方法:对于十六进制或 Unicode 问题,准备好给出使用它们的理由(例如十六进制使阅读更容易,Unicode 支持众多语言)。
Practice under timed conditions: Conversions and file‑size calculations should become second nature. | 在计时条件下练习:进制转换和文件大小计算应成为本能反应。
Published by TutorHao | CCEA IGCSE Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导