📚 Data Representation for CIE GCSE Computer Science | CIE GCSE 计算机 数据表示 考点精讲
Understanding how data is stored and manipulated inside a computer is a core topic in CIE GCSE Computer Science. From binary numbers and hexadecimal colour codes to sound files and image compression, this revision guide walks you through every essential concept, complete with worked examples and clear comparisons. Use the bilingual explanations to reinforce your learning and build confidence for the exam.
理解数据如何在计算机内部存储和处理是 CIE GCSE 计算机科学的核心主题。从二进制数和十六进制颜色代码到声音文件和图像压缩,这份复习指南带你逐一掌握所有关键概念,并配有详细的计算示例和清晰的对比。通过中英双语讲解,帮助巩固知识,为考试建立信心。
1. Number Systems: Binary, Denary, and Hexadecimal | 数制:二进制、十进制与十六进制
Computers use the binary system (base 2) because they rely on transistors that can be either ON (1) or OFF (0). Denary (base 10) is the number system we use in everyday life, while hexadecimal (base 16) is a shorthand for binary that makes long bit patterns easier for humans to read and write.
计算机使用二进制系统(基数为2),因其依赖的晶体管只有开 (1) 和关 (0) 两种状态。十进制(基数为10)是我们日常使用的数制,而十六进制(基数为16)则是二进制的一种简写形式,使冗长的位模式更便于人类阅读和书写。
2. Converting Between Number Bases | 不同进制之间的转换
To convert binary to denary, add up the place values where a 1 appears. For example, 1101₂ = 8+4+0+1 = 13₁₀. To convert denary to binary, repeatedly divide by 2 and read the remainders backwards. When converting between binary and hexadecimal, group bits into nibbles (4 bits). For instance, 10111101₂ splits into 1011 (B) and 1101 (D), giving BD₁₆. From hexadecimal to binary, expand each hex digit into its 4‑bit equivalent.
将二进制转换为十进制时,把出现 1 的位权相加。例如 1101₂ = 8+4+0+1 = 13₁₀。将十进制转换为二进制时,不断除以 2 并将余数逆序读取。在二进制与十六进制之间转换时,需将位分组为半字节(4 位)。比如 10111101₂ 拆分为 1011 (B) 和 1101 (D),得到 BD₁₆。十六进制转二进制时,将每一位十六进制数展开为其对应的 4 位二进制数。
3. 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+carry=1 carry 1. When an addition produces a result that exceeds the available number of bits, an overflow error occurs. For example, adding two 8‑bit numbers that produce a 9‑bit result cannot be stored in 8 bits, causing the most significant bit to be lost and the answer to be incorrect. Programmers must be aware of overflow when choosing data types.
二进制加法遵循简单规则:0+0=0,0+1=1,1+0=1,1+1=0 进位1,1+1+进位=1 进位1。当加法产生的结果超出可用的位宽时,就会发生溢出错误。例如,两个 8 位数相加产生 9 位结果时,就无法用 8 位存储,最高有效位丢失,答案出错。程序员在选择数据类型时必须考虑溢出问题。
4. Negative Numbers: Sign‑Magnitude and Two’s Complement | 负数表示:原码与补码
Sign‑magnitude uses the leftmost bit to represent the sign (0 for positive, 1 for negative) and the remaining bits for the magnitude. However, this creates two representations for zero and complicates arithmetic. Two’s complement solves these issues. To find the two’s complement of a binary number, invert all bits and add 1. For example, to represent –6 in an 8‑bit register: +6 is 00000110, invert to 11111001, add 1 → 11111010. In two’s complement, subtraction is performed by adding the two’s complement of the subtrahend.
原码表示法使用最左边位表示符号(0 为正,1 为负),其余位表示数值。但这会产生两个零的表示(+0 和 -0),并使算术复杂化。补码解决了这些问题。求一个二进制数的补码:按位取反,然后加 1。例如,用 8 位寄存器表示 –6:+6 为 00000110,取反得 11111001,加 1 得 11111010。在补码系统中,减法可以通过加上减数的补码来实现。
5. Representation of Characters: ASCII and Unicode | 字符表示:ASCII 与 Unicode
Characters are stored as binary codes. ASCII uses 7 bits to represent 128 characters, including English letters, digits, punctuation, and control codes. Extended ASCII uses 8 bits for 256 characters, supporting additional symbols. Unicode supports a far wider range of characters from different languages and emojis. The most common Unicode encoding, UTF‑8, uses 1 to 4 bytes per character, ensuring compatibility with ASCII for the first 128 codes and allowing representation of virtually all writing systems.
字符以二进制代码的形式存储。ASCII 使用 7 位二进制表示 128 个字符,包括英文字母、数字、标点符号和控制码。扩展 ASCII 使用 8 位表示 256 个字符,支持更多符号。Unicode 支持范围广泛的字符,涵盖不同语言和表情符号。最常见的 Unicode 编码 UTF‑8 每个字符使用 1 到 4 个字节,前 128 个码位与 ASCII 兼容,并能表示几乎所有的书写系统。
6. Representation of Images: Bitmaps, Resolution, Colour Depth | 图像表示:位图、分辨率与色深
A bitmap image is a grid of pixels, each assigned a binary code to represent its colour. Resolution is the total number of pixels (e.g. width × height). Colour depth (bit depth) specifies how many bits are used per pixel. With a colour depth of n bits, 2ⁿ different colours can be represented. For example, 8‑bit colour depth allows 256 colours, while 24‑bit true colour allows over 16 million colours. Higher resolution and deeper colour give better quality but increase file size.
位图图像由像素网格组成,每个像素分配一个二进制码来表示其颜色。分辨率是像素总数(例如宽度×高度)。色深(位深度)指定每个像素使用多少位。若色深为 n 位,则可表示 2ⁿ 种不同颜色。例如 8 位色深可表示 256 种颜色,而 24 位真彩色可表示超过 1600 万种颜色。更高的分辨率和更深的颜色可提高画质,但会增加文件大小。
7. Representation of Sound: Sampling, Sample Rate, Bit Depth | 声音表示:采样、采样率与位深度
Sound is analogue. To store it digitally, the amplitude of the sound wave is measured at regular intervals – a process called sampling. Sample rate (measured in Hz) is the number of samples taken per second. Bit depth is the number of bits used to store each sample. A higher sample rate captures higher frequencies more accurately, while greater bit depth gives finer amplitude detail and less quantisation noise. The quality of a digital recording improves with both, but so does the file size.
声音是模拟信号。要以数字形式存储,需按固定时间间隔测量声波的振幅——这个过程称为采样。采样率(以 Hz 为单位)是每秒采集的样本数。位深度是存储每个样本所用的位数。更高的采样率能更准确地捕捉更高频率,更大的位深度则提供更精细的振幅细节并减少量化噪声。数字录音的质量随这两者的提高而提升,但文件大小也随之增大。
8. File Size Calculations | 文件大小计算
For a bitmap image, the file size (in bits) can be calculated as: width in pixels × height in pixels × colour depth in bits. For an uncompressed sound file, file size (in bits) = sample rate (Hz) × bit depth × duration (seconds) × number of channels. Exam questions often require converting the result into bytes, kilobytes, or megabytes. Always show your working clearly and check whether the answer is expected in bits or bytes.
Image size (bits) = W × H × D
Sound size (bits) = Sample Rate × Bit Depth × Duration × Channels
对于位图图像,文件大小(以位为单位)可以这样计算:宽度像素 × 高度像素 × 色深(位)。对于未压缩的声音文件,文件大小(位)= 采样率 (Hz) × 位深度 × 时长 (秒) × 声道数。试题常要求将结果转换为字节、千字节或兆字节。务必清晰地展示计算步骤,并注意题目要求的结果单位是位还是字节。
图像大小 (bits) = W × H × D
声音大小 (bits) = 采样率 × 位深度 × 时长 × 声道数
9. Data Compression: Lossy vs Lossless | 数据压缩:有损与无损
Lossless compression reduces file size without losing any original data, so the file can be reconstructed exactly. It works by finding patterns and replacing them with shorter codes (e.g. run‑length encoding, Huffman coding). It is suitable for text files, executable programs, and archival storage. Lossy compression permanently removes some data to achieve smaller file sizes, relying on limitations of human perception. It is used for JPEG images, MP3 audio, and streaming video. Lossy achieves much higher compression ratios but cannot restore the original quality.
无损压缩通过识别并替换数据中的模式来缩小文件大小,不会丢失任何原始数据,文件可以被完全还原。典型算法有游程编码和哈夫曼编码。适用于文本文件、可执行程序及归档存储。有损压缩则会永久性地移除部分数据,依靠人类感官的局限来达到更小的文件体积。常用于 JPEG 图像、MP3 音频和流媒体视频。有损压缩可以获得极高的压缩比,但无法还原原始质量。
10. Exam Tips and Common Pitfalls | 应试技巧与常见误区
CIE GCSE exams often test your ability to convert between bases, perform binary addition, detect overflow, and explain why two’s complement is preferred. Always read the question carefully: check whether negative numbers are expected, and whether the register size is specified. For compression questions, use the terms ‘lossless’ and ‘lossy’ precisely and give clear examples. When calculating file sizes, pay attention to unit conversions: 8 bits = 1 byte, 1024 bytes = 1 KB, 1024 KB = 1 MB. Write down every step to gain method marks even if the final arithmetic is slightly off.
CIE GCSE 考试经常考察进制之间的转换、二进制加法、溢出检测以及解释为何补码是更优表示法。一定要仔细审题:注意是否涉及负数、寄存器位数是否已给定。回答压缩相关问题时,准确使用“无损”和“有损”术语并给出明确示例。计算文件大小时,注意单位换算:8 位 = 1 字节,1024 字节 = 1 KB,1024 KB = 1 MB。写出每一步计算过程,即使最后数字稍有偏差也能获得步骤分。
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课程辅导,国外大学本科硕士研究生博士课程论文辅导