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

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

Data representation forms the backbone of how computers store and process information. In the WJEC GCSE Computer Science specification, you are required to understand how numbers, text, images, and sound are encoded into binary, how to perform simple calculations with binary and hexadecimal, and how data compression and error detection work. This guide covers every essential concept you need, with clear explanations and paired English–Chinese notes to strengthen your understanding.

数据表示是计算机存储和处理信息的基础。在 WJEC GCSE 计算机科学大纲中,你需要理解数字、文字、图片和声音如何编码为二进制,如何进行二进制和十六进制的简单运算,以及数据压缩和错误检测的原理。本文涵盖所有核心考点,用清晰的中英对照讲解帮助你牢牢掌握。

1. Bits, Bytes and Data Units | 位、字节与数据单位

All digital data is represented using binary digits – bits. A single bit can be 0 or 1. A group of 4 bits is called a nibble (half a byte). A group of 8 bits makes one byte, which is the smallest addressable unit of memory in most computers. Larger units are based on powers of 2: a kilobyte (KB) is 2¹⁰ = 1024 bytes, a megabyte (MB) is 2²⁰ bytes, a gigabyte (GB) is 2³⁰ bytes, and a terabyte (TB) is 2⁴⁰ bytes. You need to know these units and the correct symbols: bit (b), byte (B), nibble, KB, MB, GB, TB.

所有数字数据都用二进制数字——位(bit)来表示。一个位可以是 0 或 1。4 个位组成一个半字节(nibble)。8 个位组成一个字节(byte),这是大多数计算机中可寻址的最小内存单元。更大的单位基于 2 的幂:1 千字节(KB)= 2¹⁰ = 1024 字节,1 兆字节(MB)= 2²⁰ 字节,1 吉字节(GB)= 2³⁰ 字节,1 太字节(TB)= 2⁴⁰ 字节。你需要记住这些单位及正确符号:bit (b), byte (B), nibble, KB, MB, GB, TB。


2. Binary and Denary Conversion | 二进制与十进制转换

Denary (decimal) is base-10, using digits 0–9. Binary is base-2, using only 0 and 1. To convert a binary number to denary, write the column headings for powers of 2 starting from the right (1, 2, 4, 8, 16, …). Add the headings where a 1 appears. For example, the binary number 01001101 is 0×128 + 1×64 + 0×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1 = 64+8+4+1 = 77. To convert denary to binary, repeatedly divide by 2 and read the remainders in reverse order, or use the binary place-value table.

十进制是基数为 10 的计数系统,使用数字 0–9。二进制是基数为 2,只用 0 和 1。要将二进制转换为十进制,从右向左写出 2 的幂作为列标题(1, 2, 4, 8, 16 …),将出现 1 的对应值相加。例如二进制数 01001101 的计算:0×128 + 1×64 + 0×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1 = 64+8+4+1 = 77。十进制转二进制可以反复除以 2 并倒序取余数,或使用二进制位值表。

You should be able to handle any up to 8-bit binary conversions, as well as 16-bit if specified. Remember that the highest value with n bits is 2ⁿ − 1. So an 8-bit number can represent denary values from 0 to 255.

你需要掌握最多 8 位二进制的转换,如果指定也可能涉及 16 位。记住 n 位能表示的最大值是 2ⁿ − 1,因此 8 位二进制可表示 0 到 255 的十进制值。


3. Hexadecimal Notation | 十六进制表示法

Hexadecimal (hex) is base-16, using digits 0–9 and letters A–F to represent values 10–15. Hex is used because it is more compact than binary and maps neatly to nibbles: one hex digit corresponds to exactly 4 bits. To convert binary to hex, split the binary number into groups of 4 bits (starting from the right), then convert each group. Example: 01001101₂ → 0100 1101 → 4 D → 4D₁₆. To convert denary to hex, you can first convert to binary then to hex, or repeatedly divide by 16 and use remainders.

十六进制是基数为 16,使用数字 0–9 和字母 A–F 表示 10 到 15。由于十六进制比二进制更紧凑,且与半字节(4 位)完美对齐,因此在计算机中广泛应用。二进制转十六进制时,从右开始每 4 位分成一组,然后每组转换成对应十六进制数字。例如 01001101₂ → 0100 1101 → 4 D → 4D₁₆。十进制转十六进制可以先转二进制再转十六进制,或反复除以 16 取余数。

It is common to see hex numbers prefixed with # or 0x, but in the exam questions are often straightforward. You must know the conversions among denary, binary, and hex for numbers up to at least 8 bits.

十六进制常见前缀 # 或 0x,但考试中通常直接给出数字。你必须熟练掌握至少 8 位以内十进制、二进制和十六进制之间的转换。


4. Binary Arithmetic and Shifts | 二进制运算与移位

Binary addition follows the same rules as denary addition, but with only 0 and 1. The four basic rules are: 0+0=0, 0+1=1, 1+0=1, 1+1=0 carry 1; 1+1+1=1 carry 1. When adding two 8‑bit numbers, if the result exceeds 8 bits (a carry out of the most significant bit), this is called overflow. Overflow indicates that the sum cannot be represented with 8 bits alone, which can cause errors in programs if not handled.

二进制加法规则与十进制加法类似,但仅使用 0 和 1。基本规则:0+0=0,0+1=1,1+0=1,1+1=0 进位 1;1+1+1=1 进位 1。在两个 8 位二进制数相加时,如果结果超过 8 位(最高位产生进位),称为溢出。溢出意味着和不能用 8 位表示,若不加处理会导致程序错误。

Binary shifts multiply or divide a binary number by powers of 2. A left shift by n places multiplies the number by 2ⁿ. For example, 00001100 (12) shifted left by 1 gives 00011000 (24). A right shift divides by 2ⁿ, discarding any remainder (integer division). Logical shifts (used for unsigned numbers) fill vacated bits with 0. You need to be able to perform shifts and interpret results.

二进制移位可对二进制数乘以或除以 2 的幂。左移 n 位相当于乘以 2ⁿ。例如 00001100 (12) 左移 1 位得到 00011000 (24)。右移相当于除以 2ⁿ,丢弃余数(整除)。逻辑移位(用于无符号数)在空出位填 0。你需要能够进行移位并解释结果。


5. Character Encoding – ASCII and Unicode | 字符编码 – ASCII 与 Unicode

Characters are stored as binary numbers using encoding systems. ASCII (American Standard Code for Information Interchange) uses 7 bits, giving 128 unique codes for English letters, digits, punctuation, and control characters. Extended ASCII uses 8 bits (256 codes) to include extra symbols and characters from European languages.

字符通过编码系统存储为二进制数。ASCII(美国信息交换标准代码)使用 7 位,提供 128 个唯一代码,涵盖英文字母、数字、标点和控制字符。扩展 ASCII 使用 8 位(256 个代码),可包含更多符号和欧洲语言字符。

Unicode was developed to solve the limitation of ASCII and support global scripts. Unicode can represent over 140,000 characters, including Chinese, Arabic, and emoji. Common Unicode encodings are UTF‑8 (variable length, 1–4 bytes) and UTF‑16. The key point for the exam: ASCII is smaller/faster but limited to English; Unicode is universal but takes more storage. You may be asked to compare them or calculate storage for text using a given encoding.

Unicode 为解决 ASCII 的局限而开发,能支持全球文字。Unicode 可表示超过 14 万个字符,包括中文、阿拉伯文和表情符号。常见 Unicode 编码有 UTF‑8(变长 1–4 字节)和 UTF‑16。考试重点:ASCII 体积小/速度快但局限于英语;Unicode 通用但占用更多存储。你可能会被要求比较二者或根据给定编码计算文本存储量。


6. Image Representation – Pixels and Colour Depth | 图像表示 – 像素与色彩深度

A digital image is made of tiny squares called pixels (picture elements). Each pixel is stored as a binary code representing its colour. The colour depth is the number of bits used for each pixel. For example, a 1‑bit colour depth gives 2 colours (black and white), 8‑bit colour depth gives 256 colours, and 24‑bit colour depth (true colour) can represent about 16.7 million colours (8 bits per red, green, and blue channel).

数字图像由称为像素的小方块组成。每个像素存储为一个表示颜色的二进制代码。色彩深度指每个像素使用的位数。例如 1 位色彩深度只有 2 种颜色(黑白),8 位可表示 256 种颜色,24 位真彩色可表示约 1670 万种颜色(红、绿、蓝通道各 8 位)。

Image resolution is the total number of pixels, often given as width × height (e.g. 1920×1080). Increasing resolution or colour depth improves quality but increases file size. Bitmap images store every pixel individually, so they can be large. Metadata (e.g. width, height, colour depth) is also stored alongside the pixel data.

图像分辨率是总像素数,常表示为宽×高(例如 1920×1080)。提高分辨率或色彩深度会提高图像质量,但也会增大文件大小。位图图像逐个存储每个像素,因此体积可以很大。除了像素数据,图像文件还会存储元数据(如宽度、高度、色彩深度)。


7. Sound Representation – Sampling | 声音表示 – 采样

Sound is analogue (continuously varying). To store sound digitally, the amplitude of the sound wave is measured at regular intervals – this is sampling. Two key factors affect quality and file size: sample rate (number of samples taken per second, measured in Hz or kHz) and bit depth (number of bits used to store each sample). A typical CD-quality recording uses a sample rate of 44.1 kHz and a bit depth of 16 bits.

声音是模拟信号(连续变化)。为了以数字形式存储声音,需要以固定间隔测量声波的振幅——这就是采样。影响声音质量和文件大小的两个关键因素是:采样率(每秒采样次数,单位 Hz 或 kHz)和位深度(每个采样使用的位数)。典型的 CD 音质使用 44.1 kHz 的采样率和 16 位的位深度。

Higher sample rate captures higher frequencies more accurately (Nyquist theorem states the sample rate must be at least twice the highest frequency you want to reproduce). Higher bit depth provides more dynamic range and less quantisation noise. You must be able to compare sound quality and file size against these parameters.

更高的采样率能更准确地捕捉高频声音(奈奎斯特定理指出,采样率至少要是最高再现频率的两倍)。更高的位深度提供更大的动态范围和更低的量化噪声。你需要能够根据这些参数比较声音质量和文件大小。


8. Calculating File Sizes | 计算文件大小

The exam expects you to calculate file sizes for images and sound using straightforward formulas:

考试要求你使用简单公式计算图像和声音文件的大小:

  • Image file size (bits) = width in pixels × height in pixels × colour depth in bits

    图像文件大小(位)= 像素宽度 × 像素高度 × 色彩深度(位)

  • Sound file size (bits) = sample rate in Hz × duration in seconds × bit depth in bits × number of channels (1 for mono, 2 for stereo)

    声音文件大小(位)= 采样率(Hz)× 持续秒数 × 位深度(位)× 声道数(单声道 1,立体声 2)

Often you will be required to convert between bits, bytes, kilobytes, etc. Remember to divide by 8 to get bytes, then by 1024 to get KB, and so on. Work step by step, and always check the units required in the answer.

通常你需要进行位、字节、千字节等单位的转换。记住除以 8 得到字节,再除以 1024 得到千字节,以此类推。解题时逐步计算,并始终注意答案要求的单位。

Example: A 30-second stereo sound clip with sample rate 44.1 kHz and 16-bit bit depth has size = 44100 × 30 × 16 × 2 = 42,336,000 bits. Convert to MB: 42,336,000 / 8 = 5,292,000 B; 5,292,000 / 1024 ≈ 5167.97 KB; 5167.97 / 1024 ≈ 5.05 MB.

示例:一段 30 秒立体声片段,采样率 44.1 kHz,位深度 16 位,文件大小 = 44100 × 30 × 16 × 2 = 42,336,000 位。转换为 MB:42,336,000 / 8 = 5,292,000 B;5,292,000 / 1024 ≈ 5167.97 KB;再除以 1024 ≈ 5.05 MB。


9. Lossless vs Lossy Compression | 无损压缩与有损压缩

Compression reduces the number of bits needed to store data, saving storage space and speeding up transmission. There are two main types:

压缩通过减少存储数据所需的位数来节省空间并加快传输。主要有两类:

  • Lossless compression reduces file size without losing any data – the original can be reconstructed exactly. It works by finding patterns and encoding them more efficiently (e.g. run‑length encoding, Huffman coding). Used for text, executable files, and some image formats like PNG.

    无损压缩在不丢失任何数据的前提下减小文件大小——原始数据可以完全重建。它通过寻找模式并更高效地编码(如游程编码、霍夫曼编码)。适用于文本、可执行文件和一些图像格式如 PNG。

  • Lossy compression permanently removes some data to achieve much smaller file sizes. The lost data is usually imperceptible to human senses. Used for JPEG images, MP3 audio, and MP4 video. You sacrifice some quality for greater compression.

    有损压缩会永久删除部分数据以大大减小文件大小。丢失的数据通常对人类感官不明显。用于 JPEG 图像、MP3 音频和 MP4 视频。你为了更高的压缩率而牺牲部分质量。

For the exam, you should be able to explain the differences, give examples, and discuss why certain formats are chosen in different contexts.

在考试中,你需要能解释二者的区别、举例,并讨论不同场景下为何选择特定格式。


10. Error Detection – Parity and Check Digits | 错误检测 – 奇偶校验与校验数位

When data is transmitted or stored, errors can occur. Simple error‑detection methods help identify if a single bit has changed. A parity bit is an extra bit added to a binary string to make the total number of 1s either even (even parity) or odd (odd parity). Before transmission, the sender counts the 1s in the data and sets the parity bit accordingly. The receiver recalculates parity: if it does not match, an error is detected. Parity can detect a single bit error, but not two bits flipped.

数据在传输或存储时可能发生错误。简单的错误检测方法能帮助识别是否某个位发生了变化。奇偶校验位是额外添加的一个位,使二进制串中 1 的总数为偶数(偶校验)或奇数(奇校验)。发送前,发送方统计数据中 1 的个数并相应设置校验位。接收方重新计算校验:若不匹配则检测到错误。奇偶校验可以检测单比特错误,但无法检测两个位翻转。

Another method is check digits, often used with barcodes and ISBNs. An extra digit is calculated from the other digits using an algorithm; if the computed check digit does not match the transmitted one, an error has occurred. For WJEC, you mainly need to understand parity and how it works for error detection.

另一种方法是校验数位,常用于条形码和 ISBN。根据其他数位通过算法计算出一个额外的数位;若计算值与传输值不一致,则发生错误。WJEC 课程主要需要你理解奇偶校验及其错误检测原理。


11. Representing Instructions and Data – A Unified View | 指令与数据的统一表示

At the machine level, both program instructions and data are stored as binary patterns. The CPU interprets these bit patterns based on context. An 8‑bit value 01000001 could represent the decimal number 65, the ASCII character ‘A’, or part of a machine instruction. The fetch‑decode‑execute cycle determines how each word is handled. This flexibility is a key principle of stored‑program computers. You should appreciate that data and instructions are indistinguishable at the binary level; meaning is assigned by the architecture and the software convention.

在机器层面,程序指令和数据都以二进制模式存储。CPU 根据上下文解释这些位模式。8 位值 01000001 可以表示十进制数 65、ASCII 字符 ‘A’,或某条机器指令的一部分。取指‑译码‑执行周期决定如何处理每个字。这种灵活性是存储程序计算机的关键原理。你需要理解在二进制层面数据与指令无法区分,其含义由硬件架构和软件约定赋予。


12. Exam Tips and Common Mistakes | 考试提示与常见错误

When answering data representation questions, always show your working for conversions and calculations. For binary addition, clearly mark carries and bring‑down bits. If a question asks about units, never confuse bits and bytes – use the correct symbols (b vs B). Remember that 1 kilobyte is 1024 bytes, not 1000. For file size problems, double‑check whether the answer should be given in bits, bytes, KB, or MB. Practise both interpreting hex colour codes (like #FF8C00) and describing the effect of increasing sample rate or colour depth.

在回答数据表示问题时,务必展示转换和计算过程。二进制加法要清晰地标出进位和结果位。涉及单位的问题不要混淆位和字节,使用正确符号(b 和 B)。记住 1 千字节是 1024 字节,不是 1000。对于文件大小问题,要再次确认答案应以位、字节、KB 还是 MB 给出。多加练习解读十六进制颜色码(如 #FF8C00),以及描述增加采样率或色彩深度的影响。

Published by TutorHao | 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

Exit mobile version