📚 GCSE CCEA Computer Science: Data Representation Key Points | CCEA GCSE计算机:数据表示考点精讲
Data representation forms the foundation of how computers store and process information. In the CCEA GCSE Computer Science specification, you must understand different number systems, character encoding, and the representation of images and sound. This article breaks down every key concept with clear English and Chinese explanations, ensuring you are fully prepared for your exam.
数据表示是计算机存储和处理信息的基础。在 CCEA GCSE 计算机科学大纲中,你必须掌握不同的数制、字符编码以及图像与声音的表示方式。本文将以清晰的中英双语解释逐一剖析每一个核心概念,助你充分备考。
1. Number Systems: Binary and Denary | 数制:二进制与十进制
Computers use the binary system (base 2) because their electronic circuits have only two stable states: on (1) and off (0). In contrast, the denary (decimal) system we use every day is base 10, with digits 0–9.
计算机使用二进制(Base 2),因为其电子电路只有两种稳定状态:开 (1) 和关 (0)。而我们日常使用的十进制(Denary)是 Base 10,包含数字 0–9。
To convert a binary number into denary, add the place values ( …, 128, 64, 32, 16, 8, 4, 2, 1 ) wherever a 1 appears. For example, binary 1101₂ = 8 + 4 + 0 + 1 = 13 in denary.
将二进制转换为十进制时,把出现 1 的位对应的权值相加(…… 128, 64, 32, 16, 8, 4, 2, 1)。例如,二进制 1101₂ = 8 + 4 + 0 + 1 = 十进制 13。
To convert denary to binary, repeatedly divide the denary number by 2 and record the remainders. Reading the remainders from bottom to top gives the binary equivalent. For instance, 13 in denary: 13 ÷ 2 = 6 remainder 1, 6 ÷ 2 = 3 remainder 0, 3 ÷ 2 = 1 remainder 1, 1 ÷ 2 = 0 remainder 1 → binary 1101.
将十进制转为二进制,则重复除以 2 并记录余数,从下往上读出余数即可得到二进制数。例如十进制 13:13 ÷ 2 = 6 余 1,6 ÷ 2 = 3 余 0,3 ÷ 2 = 1 余 1,1 ÷ 2 = 0 余 1 → 二进制 1101。
Always show the steps in exam questions: list the powers of two and put 1s or 0s accordingly.
考试答题时务必展示步骤:列出 2 的幂次对应的权值,并放入相应的 1 或 0。
2. Hexadecimal: Compact Binary Representation | 十六进制:二进制的紧凑表示
Hexadecimal (base 16) uses the digits 0–9 and the letters A–F to represent values 10–15. Programmers use hex to make long binary strings shorter and more readable. One hex digit represents exactly four binary digits (a nibble).
十六进制(Base 16)使用数字 0–9 和字母 A–F 来表示数值 10–15。程序员使用十六进制缩短长二进制串并提高可读性。一个十六进制数字正好代表四位二进制(一个半字节 nibble)。
To convert binary to hex, split the binary number into groups of four bits from the right, then convert each group. Example: 10101110₂ → 1010 1110 → A E → AE₁₆.
二进制转十六进制时,从右往左每四位一组进行分组,然后将每组转换。例如 10101110₂ → 1010 1110 → A E → AE₁₆。
To convert hex to denary, multiply each hex digit by its place value (16⁰, 16¹, 16² …). For AE₁₆: A×16 + E×1 = 10×16 + 14 = 174 in denary.
十六进制转十进制,将每位十六进制数字乘以其位权(16⁰, 16¹, 16² …)。如 AE₁₆:A×16 + E×1 = 10×16 + 14 = 十进制 174。
Common exam tasks include converting between binary, denary, and hex. Remember: 10 = A, 11 = B, 12 = C, 13 = D, 14 = E, 15 = F.
常见考试题型包括二进制、十进制、十六进制之间的转换。记住:10 = A, 11 = B, 12 = C, 13 = D, 14 = E, 15 = F。
3. Bits, Bytes and Units of Measurement | 位、字节与计量单位
The smallest unit of data in a computer is a bit (binary digit), which stores a single 0 or 1. A group of 8 bits is called a byte. A nibble is half a byte (4 bits).
计算机中最小的数据单位是位(bit,二进制位),只能存储 0 或 1。8 个位组成一个字节(byte)。半个字节(4 位)称为半字节(nibble)。
Larger units are formed by powers of two. 1 kilobyte (KB) = 1024 bytes, 1 megabyte (MB) = 1024 KB, 1 gigabyte (GB) = 1024 MB, 1 terabyte (TB) = 1024 GB. You may also see kibibyte (KiB) for 1024 bytes explicitly, but CCEA often uses KB to mean 1024 bytes in the context of data storage.
更大的单位基于 2 的幂次。1 千字节 (KB) = 1024 字节,1 兆字节 (MB) = 1024 KB,1 吉字节 (GB) = 1024 MB,1 太字节 (TB) = 1024 GB。你可能也会见到 kibibyte (KiB) 明确表示 1024 字节,但在数据存储上下文中 CCEA 常以 KB 表示 1024 字节。
When calculating file sizes, always express results in the most appropriate unit. For instance, an image file of 240 000 bytes can be written as 240 KB (divide by 1024).
计算文件大小时,结果应使用最合适的单位。例如,一幅 240 000 字节的图像可表示为 240 KB(除以 1024)。
4. Binary Arithmetic and Overflow | 二进制运算与溢出
Binary addition follows simple rules: 0+0=0, 0+1=1, 1+0=1, 1+1=0 carry 1, and 1+1+1=1 carry 1. Adding two 8-bit numbers can produce a carry into a 9th bit. If the result exceeds the allocated number of bits, an overflow error occurs.
二进制加法遵循简单规则:0+0=0、0+1=1、1+0=1、1+1=0 进 1、1+1+1=1 进 1。两个 8 位二进制数相加可能产生第 9 位的进位。若结果超出分配位数,则发生溢出错误。
Example: 10101010₂ + 01111111₂. Adding bit by bit from the right:
0+1=1, 1+1=0 carry 1, 0+1+1=0 carry 1, … The final carry goes beyond the 8th bit, causing overflow. Computers detect overflow and may flag an error.
例子:10101010₂ + 01111111₂。从右向左逐位相加:
0+1=1、1+1=0 进 1、0+1+1=0 进 1 …… 最终进位超出第 8 位,导致溢出。计算机会检测溢出并可能报错。
Overflow is particularly important when dealing with signed numbers (two’s complement), as it can change the sign incorrectly.
处理有符号数(二进制补码)时,溢出尤其重要,因为它会错误地改变符号位。
5. Negative Numbers: Two’s Complement | 负数:二进制补码
CCEA requires you to represent negative integers using two’s complement. For an n‑bit number, the leftmost bit is the sign bit (0 = positive, 1 = negative). The range of values for 8‑bit two’s complement is –128 to +127.
CCEA 要求你使用二进制补码(two’s complement)来表示负整数。对于 n 位二进制数,最左边位是符号位(0 为正,1 为负)。8 位补码的取值范围是 –128 到 +127。
To find the two’s complement of a positive number (i.e. to make it negative), invert all bits (one’s complement) and then add 1. For example, to represent –7 in 8‑bit: write +7 as 0000 0111, invert to 1111 1000, add 1 → 1111 1001.
求一个正数的补码(即变为负数),将所有位取反(反码),然后再加 1。例如用 8 位表示 –7:+7 写作 0000 0111,取反得 1111 1000,加 1 → 1111 1001。
To convert a negative two’s complement number back to denary: if the sign bit is 1, treat the number as negative. Find its positive equivalent by taking the two’s complement (flip bits, add 1) and then apply a minus sign. For 1111 1001, invert → 0000 0110, add 1 → 0000 0111 = 7, so the value is –7.
将负数的补码转回十进制:若符号位为 1,该数为负数。将其再进行补码运算(取反加 1)得到正值,再加负号。如 1111 1001,取反 → 0000 0110,加 1 → 0000 0111 = 7,因此原值为 –7。
Remember: in two’s complement, there is only one representation for zero (all bits 0).
记住:在补码中,零只有一种表示形式(所有位为 0)。
6. Character Encoding: ASCII and Unicode | 字符编码:ASCII 与 Unicode
Characters (letters, digits, symbols) are stored as binary numbers using agreed codes. ASCII (American Standard Code for Information Interchange) uses 7 bits to represent 128 characters, including control codes, uppercase and lowercase letters, digits, and common punctuation. Extended ASCII uses 8 bits for 256 characters, adding accented letters and symbols.
字符(字母、数字、符号)通过约定的编码存储为二进制数。ASCII(美国信息交换标准码)使用 7 位表示 128 个字符,包括控制码、大小写字母、数字和常用标点。扩展 ASCII 用 8 位表示 256 个字符,增加了带重音的字母和符号。
ASCII is limited to English-like alphabets. Unicode was developed to represent virtually all writing systems worldwide. The most common Unicode encoding, UTF‑8, is backward compatible with ASCII but can use up to 4 bytes per character to cover thousands of symbols and emojis.
ASCII 仅限于类英语字母系统。Unicode 被开发出来以表示全球几乎所有书写系统。最常用的 Unicode 编码 UTF‑8 与 ASCII 向下兼容,但每个字符最多可使用 4 字节,覆盖数千种符号和表情符号。
Exam tip: you do not need to memorise all ASCII codes, but you should know that ‘A’ = 65, ‘a’ = 97, ‘0’ = 48. Understand that Unicode requires more storage per character but enables global communication.
考试技巧:你不必记住所有 ASCII 编码,但应知道 ‘A’ = 65、’a’ = 97、’0′ = 48。理解 Unicode 每个字符占用更多存储空间,但能支持全球交流。
7. Representing Images | 图像表示
A bitmap image is made up of a grid of tiny dots called pixels (picture elements). Each pixel is assigned a binary value representing its colour. The resolution is the total number of pixels, usually expressed as width × height (e.g., 1920 × 1080). Higher resolution gives more detail but larger file size.
位图图像由称为像素的小点网格组成。每个像素分配一个代表其颜色的二进制值。分辨率是像素的总数,通常表示为宽 × 高(例如 1920 × 1080)。分辨率越高,细节越丰富,但文件也越大。
Colour depth (bit depth) is the number of bits used to represent the colour of each pixel. A 1‑bit image can only show two colours (black and white). An 8‑bit image can show 2⁸ = 256 colours. A 24‑bit colour depth (true colour) uses 8 bits for each of red, green, and blue, giving over 16 million colours.
颜色深度(位深度)是表示每个像素颜色所用的位数。1 位图像只能显示两种颜色(黑和白)。8 位图像可显示 2⁸ = 256 种颜色。24 位颜色深度(真彩色)为红、绿、蓝各分配 8 位,能产生超过 1600 万种颜色。
File size for an uncompressed bitmap image can be estimated as: width × height × colour depth (in bits). Then divide by 8 to get bytes, and by 1024 to get kilobytes. Example: a 200×300 picture with 16‑bit colour depth uses 200 × 300 × 16 = 960 000 bits = 120 000 bytes ≈ 117.2 KB.
未压缩位图图像的文件大小可估算为:宽 × 高 × 颜色深度(以位为单位)。然后除以 8 得字节数,再除以 1024 得千字节数。例如:一张 200×300 的 16 位色彩图像,文件大小为 200 × 300 × 16 = 960 000 位 = 120 000 字节 ≈ 117.2 KB。
Metadata (such as image dimensions, colour depth, and creation date) is also stored in the file and adds slightly to the size.
图像文件还存储元数据(比如图像尺寸、颜色深度和创建日期),这也会略微增加文件大小。
8. Representing Sound | 声音表示
Sound is analogue in nature. To store it digitally, the sound wave is sampled at regular intervals and converted into binary values (ADC). The sample rate is the number of samples taken per second, measured in hertz (Hz) or kilohertz (kHz). Common rates: 44.1 kHz (CD quality).
声音本质上是模拟的。为进行数字化存储,声波以固定间隔被采样并转换为二进制值(模数转换)。采样率是每秒采集的样本数,以赫兹 (Hz) 或千赫兹 (kHz) 为单位。常见采样率:44.1 kHz(CD 音质)。
The bit depth (sample resolution) is the number of bits used to record each sample. Higher bit depth allows more accurate representation of the sound wave’s amplitude, reducing quantisation noise. A 16‑bit depth yields 65 536 possible amplitude levels.
位深度(采样分辨率)是记录每个样本所用的位数。更高的位深度能更准确地表示声波振幅,减少量化噪声。16 位深度可获得 65 536 个可能的幅度等级。
File size for uncompressed mono sound: sample rate (Hz) × bit depth × duration (seconds). For stereo, multiply by 2 channels. Example: 10 seconds of mono sound at 44 100 Hz, 16 bit → 44 100 × 16 × 10 = 7 056 000 bits = 882 000 bytes ≈ 861 KB.
未压缩单声道声音的文件大小:采样率 (Hz) × 位深度 × 时长(秒)。立体声需乘以 2 个声道。例如:10 秒单声道 44 100 Hz、16 位声音 → 44 100 × 16 × 10 = 7 056 000 位 = 882 000 字节 ≈ 861 KB。
Higher sample rates and bit depths improve quality but increase file size dramatically. This is why compression is often used.
更高的采样率和位深度可提升品质,但会大幅增加文件大小,因而常需使用压缩。
9. Data Compression: Lossy vs Lossless | 数据压缩:有损与无损
Compression reduces the number of bits needed to represent data, enabling faster transmission and less storage. There are two main types: lossy and lossless.
压缩减少表示数据所需的位数,从而加快传输速度、节省存储空间。主要有两种类型:有损压缩和无损压缩。
Lossless compression reconstructs the original data perfectly. It works by finding and eliminating statistical redundancy. Examples: ZIP files for documents, PNG for images, and FLAC for audio. Run‑Length Encoding (RLE) is a simple lossless method that replaces repeated consecutive data with a count and the value. For example, ‘AAAAABBBCC’ could become ‘5A3B2C’. RLE works well on simple graphics with large blocks of identical colours.
无损压缩能完美重建原始数据。它通过寻找并消除统计冗余来实现。例如:文档的 ZIP 文件、图像的 PNG、音频的 FLAC。游程编码(RLE)是一种简单的无损方法,用计数值和重复数据本身替代连续重复数据。例如 ‘AAAAABBBCC’ 可变为 ‘5A3B2C’。RLE 对含有大面积相同颜色的简单图形效果很好。
Lossy compression permanently discards some data that the human eye or ear is less sensitive to. The original can never be restored perfectly, but the perceived quality remains acceptable. JPEG for photos, MP3 for audio, and MPEG for video are lossy. They achieve much higher compression ratios than lossless methods.
有损压缩会永久性丢弃人眼或人耳不太敏感的部分数据。原始数据无法完全恢复,但感官质量仍可接受。照片的 JPEG、音频的 MP3、视频的 MPEG 等都是有损压缩。它们比无损方法能达到高得多的压缩比。
Exam questions often ask you to justify when to choose lossy vs lossless. Use lossless for text and programs where every bit matters. Use lossy for photographs and music tracks where smaller file size is more important than perfect fidelity.
考试常会要求你说明何时选用有损或无损。对于文本和程序等每个位都重要的场合,使用无损压缩。对于照片和音乐曲目,如果缩小文件体积比完美保真更重要,则使用有损压缩。
10. Exam Tips and Common Pitfalls | 考试技巧与常见误区
Always double‑check whether the question asks for bits or bytes. A common mistake is to give a file size in bits when bytes are required. Remember 1 byte = 8 bits.
始终仔细审题,确认题目要求以位还是字节为单位。常见错误是将文件大小以位作答,而题目要求的是字节。记住 1 字节 = 8 位。
When performing binary addition or two’s complement subtraction, show all carry bits and stages. Even if the final answer is correct, missing steps can lose marks.
进行二进制加法或补码减法时,应展示所有进位位和步骤。即使最终答案正确,缺少步骤也可能丢分。
In two’s complement, the range for 8 bits is –128 to +127. Do not write –127 to +128, as +128 cannot be stored in 8‑bit two’s complement.
在补码中,8 位取值范围是 –128 到 +127。不要写成 –127 到 +128,因为 +128 无法用 8 位补码存储。
For image and sound calculations, write the formula first, substitute values, then calculate step by step. Pay attention to channel numbers (mono vs stereo).
计算图像和声音大小时,先写出公式,再代入数值,逐步计算。注意声道数(单声道与立体声)。
Understand that Unicode is a superset of ASCII. An advantage of Unicode is global character support; a disadvantage is larger storage per character compared to 7‑bit ASCII.
理解 Unicode 是 ASCII 的超集。Unicode 的优点是支持全球字符,缺点是与 7 位 ASCII 相比,每个字符占用更多存储空间。
Finally, when explaining compression, always link the technique to its effect on file size and quality. Use RLE as a specific lossless example in your answer if the question allows.
最后,解释压缩时,始终将技术与对文件大小和质量的影响联系起来。如题目允许,回答时可举 RLE 作为具体的无损压缩示例。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导