GCSE Edexcel Computer Science: Calculation Practice | GCSE Edexcel 计算机:计算题专项训练

📚 GCSE Edexcel Computer Science: Calculation Practice | GCSE Edexcel 计算机:计算题专项训练

In the Edexcel GCSE Computer Science specification (1CP2), calculation-based questions appear across many topics, from data representation and Boolean logic to networking and algorithm analysis. Mastering these calculations is essential for achieving top grades. This article focuses entirely on typical calculation questions you will encounter in your exams, presenting key techniques and worked examples. Each section pairs an English explanation with a Chinese translation, so you can review the material bilingually and reinforce your understanding.

在 Edexcel GCSE 计算机科学大纲 (1CP2) 中,计算题贯穿于数据表示、布尔逻辑、网络和算法分析等多个主题。掌握这些计算是取得高分的关键。本文专门针对考试中常见的计算题,介绍核心技巧并提供详细解答。每个部分均以英文说明与中文翻译配对呈现,帮助你双语复习,加深理解。


1. Number Bases Conversion | 进制转换

Converting between binary, denary (decimal), and hexadecimal is a core skill. To convert a binary number to denary, sum the place values of the bits that are 1. Each bit position represents a power of 2, starting from 2⁰ on the right.

在二进制、十进制和十六进制之间进行转换是一项核心技能。要将二进制数转换为十进制,需要把值为 1 的位所对应的位值相加。每一位的位置代表 2 的幂,从最右侧的 2⁰ 开始。

For example, the binary number 1011₂ is interpreted as (1 × 2³) + (0 × 2²) + (1 × 2¹) + (1 × 2⁰) = 8 + 0 + 2 + 1 = 11₁₀. To convert denary to binary, repeatedly divide the denary number by 2 and record the remainder; the binary number is read from the last remainder to the first.

例如,二进制数 1011₂ 可以表示为 (1 × 2³) + (0 × 2²) + (1 × 2¹) + (1 × 2⁰) = 8 + 0 + 2 + 1 = 11₁₀。要将十进制转换为二进制,可以不断将十进制数除以 2 并记录余数;二进制数从最后一个余数往第一个余数读取得到。

Hexadecimal uses base 16. Digits 10–15 are represented by letters A–F. To convert binary to hex, group bits into nibbles (4 bits) from the right, then replace each group with its hex equivalent. Converting hex to denary multiplies each digit by the appropriate power of 16.

十六进制使用基数为 16。数字 10–15 用字母 A–F 表示。要将二进制转换为十六进制,可以从右往左每 4 位分成一组,然后将每组替换为对应的十六进制数字。十六进制转十进制则将每一位数字乘以相应的 16 的幂。

Worked example: Convert 1101 1010₂ to denary and hex.

例题:将 1101 1010₂ 转换为十进制和十六进制。

Denary: (1×2⁷)+(1×2⁶)+(0×2⁵)+(1×2⁴)+(1×2³)+(0×2²)+(1×2¹)+(0×2⁰) = 128+64+0+16+8+0+2+0 = 218₁₀. Hex: split into 1101 1010 → 1101₂ = D₁₆, 1010₂ = A₁₆ → DA₁₆.

十进制:128+64+0+16+8+0+2+0 = 218₁₀。十六进制:1101₂ = D₁₆,1010₂ = A₁₆ → DA₁₆。


2. Binary Addition & Overflow | 二进制加法与溢出

Binary addition works exactly like denary addition, carrying 1 to the next column when the sum in a column reaches 2 (i.e., 1+1 = 10₂). You need to be careful with the carry bits and check for overflow when the result exceeds the available number of bits.

二进制加法与十进制加法原理相同,当某一列的和达到 2 时(即 1+1 = 10₂),便向下一列进位 1。你需要小心处理进位,并在结果超出可用位数时检查溢出。

For example, add the 8-bit numbers 0110 1011₂ and 0101 1101₂. Starting from the rightmost bit: 1+1 = 0 carry 1; next column 1+0+carry 1 = 0 carry 1; continue until you obtain the result. If an 8-bit adder produces a carry out of the most significant bit and the answer cannot be stored in 8 bits, an overflow error occurs.

例如,将 8 位二进制数 0110 1011₂ 和 0101 1101₂ 相加。从最右位开始:1+1 = 0 进位 1;下一列 1+0+进位 1 = 0 进位 1;继续计算得到结果。如果 8 位加法器在最高位产生进位且结果无法用 8 位存储,就会发生溢出错误。

0110 1011₂ + 0101 1101₂ = 1100 1000₂

Overflow detection: in an 8-bit signed representation, if the carry into the sign bit differs from the carry out of the sign bit, overflow has occurred. In unsigned addition, simply check whether the final carry out is 1 when using a fixed width.

溢出检测:在 8 位有符号表示中,如果进入符号位的进位与离开符号位的进位不同,则表示溢出。在无符号加法中,只需检查固定位宽下的最终进位是否为 1 即可。


3. Hexadecimal Arithmetic & Conversion | 十六进制运算与转换

Hexadecimal addition is performed by adding the decimal equivalents of each column and converting the sum back to hex. When a column sum exceeds 15, you subtract 16 and carry 1 to the next column. Hexadecimal multiplication and subtraction are less common in GCSE but rely on the same principles.

十六进制加法通过将每一列的数字转换为十进制相加,再把和转换回十六进制来完成。当某列之和超过 15 时,减去 16 并向下一列进位 1。十六进制乘法和减法在 GCSE 中较少出现,但其原理相同。

Example: Add 1A₁₆ and B7₁₆. Column 1 (rightmost): A (10) + 7 = 17, 17 − 16 = 1, carry 1. Next column: 1 (original) + B (11) + carry 1 = 13, which is D₁₆. Result: D1₁₆.

例题:将 1A₁₆ 与 B7₁₆ 相加。最右列:A (10) + 7 = 17,17 – 16 = 1,进位 1。下一列:1(原数字)+ B (11) + 进位 1 = 13,即 D₁₆。结果:D1₁₆。

To convert a large denary number to hex, it is often easier to convert to binary first and then group the bits. For instance, 345₁₀ → binary 1 0101 1001₂ → grouped as 1 0101 1001 → 0159₁₆ = 159₁₆. Keep practising these conversions to build speed.

在将较大的十进制数转换为十六进制时,通常先转换为二进制再分组会更简单。例如,345₁₀ → 二进制 1 0101 1001₂ → 分组为 1 0101 1001 → 0159₁₆ = 159₁₆。多加练习可以提高转换速度。


4. Image File Size Calculations | 图像文件大小计算

To calculate the file size of a bitmap image, you need the number of pixels (image resolution) and the colour depth (bits per pixel). The formula is: file size (bits) = width (pixels) × height (pixels) × colour depth.

要计算位图图像的文件大小,你需要知道像素数量(图像分辨率)和颜色深度(每像素位数)。公式为:文件大小(位)= 宽度(像素)× 高度(像素)× 颜色深度。

Divide the result by 8 to get bytes, and further divide as appropriate to express the size in kilobytes (KB), megabytes (MB), etc. Note that 1 KB = 1024 bytes in most computing contexts, but exam questions sometimes simplify to 1000 bytes per KB. Always follow the instruction given in the question.

将结果除以 8 得到字节数,再根据需要进一步除以 1024 以千字节 (KB) 或兆字节 (MB) 表示。请注意,在多数计算环境中 1 KB = 1024 字节,但试题有时简化为 1 KB = 1000 字节。务必遵循题目中的规定。

Example: A 800 × 600 pixel image uses 24-bit colour. Calculate its file size in MB.

例题:一幅 800 × 600 像素的图像采用 24 位色彩。计算其文件大小(MB)。

Bits = 800 × 600 × 24 = 11,520,000 bits. Bytes = 11,520,000 ÷ 8 = 1,440,000 B. In KB (1000) = 1,440 KB; in MB = 1.44 MB. If using 1024, MB = 1,440,000 ÷ (1024×1024) ≈ 1.37 MB. Always check which convention is expected.

位数 = 800 × 600 × 24 = 11,520,000 位。字节数 = 11,520,000 ÷ 8 = 1,440,000 B。按 1000 进制,KB = 1,440 KB;MB = 1.44 MB。若按 1024 进制,MB ≈ 1.37 MB。务必确认题目要求的换算标准。


5. Sound File Size Calculations | 声音文件大小计算

Sound file size depends on sample rate (samples per second), bit depth (bits per sample), number of channels (e.g., mono=1, stereo=2), and duration in seconds. The formula is: file size (bits) = sample rate × bit depth × number of channels × duration (s).

声音文件大小取决于采样率(每秒样本数)、位深度(每个样本的位数)、声道数(例如单声道=1,立体声=2)以及以秒为单位的时长。公式为:文件大小(位)= 采样率 × 位深度 × 声道数 × 时长(秒)。

Like images, convert bits to bytes by dividing by 8 and then to larger units. Sound calculations often produce large numbers, so careful unit conversion is critical.

与图像一样,将位数除以 8 转换为字节,再转换为更大的单位。声音计算往往产生较大的数字,因此仔细进行单位换算非常重要。

Example: A stereo audio track of 3 minutes 30 seconds is recorded at 44.1 kHz with 16-bit resolution. Calculate the uncompressed file size in MB using 1 MB = 1,000,000 bytes.

例题:一段时长 3 分 30 秒的立体声音频以 44.1 kHz 采样率和 16 位分辨率录制。按 1 MB = 1,000,000 字节计算未压缩文件大小。

Duration = 210 seconds. Bits = 44,100 × 16 × 2 × 210 = 44,100 × 16 × 420 = 296,352,000 bits. Bytes = 296,352,000 ÷ 8 = 37,044,000 B. MB = 37,044,000 ÷ 1,000,000 ≈ 37.04 MB.

时长 210 秒。位数 = 44,100 × 16 × 2 × 210 = 296,352,000 位。字节 = 37,044,000 B。MB ≈ 37.04 MB。


6. Text Encoding Sizes | 文本编码大小

The storage size of a text file is determined by the number of characters and the number of bits used per character. With standard ASCII, each character uses 7 bits (often stored as 8 bits, i.e., 1 byte). Extended ASCII uses 8 bits per character. Unicode encodings like UTF-8 may use 1–4 bytes per character, while UTF-16 uses 2 or 4 bytes. GCSE questions often simplify: ASCII = 8 bits (1 byte) per character, Unicode = 16 bits (2 bytes) per character.

文本文件的存储大小取决于字符数量以及每个字符使用的位数。标准 ASCII 中,每个字符使用 7 位(通常存储为 8 位,即 1 字节)。扩展 ASCII 每字符使用 8 位。Unicode 编码(如 UTF-8)可能每字符使用 1–4 字节,而 UTF-16 每字符使用 2 或 4 字节。GCSE 试题通常简化为:ASCII 每字符 8 位(1 字节),Unicode 每字符 16 位(2 字节)。

Thus, to calculate the size of a plain text message, multiply the character count by the bit width and convert to bytes. Leave room for metadata if the question asks for it, but typically you are asked to find the raw text data size.

因此,要计算纯文本消息的大小,将字符数乘以位宽并转换为字节。如果试题要求包含元数据则需额外考虑,但通常只需计算原始文本数据大小。

Example: A paragraph contains 500 characters. What is the file size in bytes using (a) ASCII, (b) Unicode (16-bit)?

例题:一个段落包含 500 个字符。分别使用 (a) ASCII 和 (b) Unicode (16 位) 时,文件大小是多少字节?

(a) ASCII: 500 × 1 byte = 500 bytes. (b) Unicode: 500 × 2 bytes = 1000 bytes (1 KB approx.)

(a) ASCII: 500 × 1 B = 500 字节。(b) Unicode: 500 × 2 B = 1000 字节(约 1 KB)。


7. Data Compression Ratios | 数据压缩率计算

Compression reduces file size using either lossless or lossy techniques. The compression ratio is defined as original size ÷ compressed size. It tells you how many times smaller the compressed file is. A ratio of 4:1 means the compressed file is one quarter of the original.

压缩通过无损或有损技术减小文件大小。压缩比定义为 原始大小 ÷ 压缩后大小。它告诉你压缩后的文件小了多少倍。4:1 的压缩比意味着压缩文件大小为原来的四分之一。

You may also be asked to calculate the compressed size given the original size and the ratio or percentage reduction. For example, if a 2 MB file is compressed by 60%, the compressed size = original size × (1 − 0.60) = 0.8 MB.

试题也可能要求根据原始大小和压缩比或压缩百分比计算压缩后的大小。例如,一个 2 MB 的文件压缩了 60%,则压缩后大小 = 2 × (1 − 0.60) = 0.8 MB。

Example: An image file is originally 4.5 MB. After lossless compression it becomes 1.5 MB. Calculate the compression ratio and the space saving percentage.

例题:一幅图像文件原大小为 4.5 MB。经过无损压缩后变为 1.5 MB。计算压缩比和空间节省百分比。

Compression ratio = 4.5 ÷ 1.5 = 3:1. Space saving = ((4.5−1.5) ÷ 4.5) × 100% = (3 ÷ 4.5) × 100% ≈ 66.7%.

压缩比 = 3:1。空间节省百分比 ≈ 66.7%。


8. Network Data Transfer Speed | 网络数据传输速度计算

Calculating data transfer times is a common exam requirement. The key formula is: time (seconds) = data size (bits) ÷ transfer speed (bps). Always ensure size and speed use the same units – convert file size to bits if speed is given in bits per second. For larger units, use standard prefixes: kilo (k) = 10³, Mega (M) = 10⁶, Giga (G) = 10⁹ unless specified in binary (1024).

计算数据传输时间是常见的考试要求。关键公式为:时间(秒)= 数据大小(位)÷ 传输速度(bps)。务必确保数据大小与速度使用的单位一致——如果速度以 bps 为单位,则将文件大小也转换为位。对于较大单位,使用标准前缀:kilo (k) = 10³,Mega (M) = 10⁶,Giga (G) = 10⁹,除非题目指定使用二进制前缀 (1024)。

If speed is given in bytes per second (Bps), first convert data size to bytes. Be methodical and write down each conversion step.

如果速度以字节每秒 (Bps) 给出,则先将数据大小转换为字节。做题时要按步骤逐步转换。

Example: A 100 MB file is downloaded over a 50 Mbps connection. Calculate the minimum download time in seconds (assume 1 MB = 1,000,000 bytes, 1 Mbps = 1,000,000 bps).

例题:一个 100 MB 的文件通过 50 Mbps 的连接下载。计算最短下载时间(单位:秒,假设 1 MB = 1,000,000 字节,1 Mbps = 1,000,000 bps)。

File size in bits = 100 × 1,000,000 × 8 = 800,000,000 bits. Speed = 50,000,000 bps. Time = 800,000,000 ÷ 50,000,000 = 16 seconds.

文件大小(位)= 100 × 1,000,000 × 8 = 800,000,000 位。速度 = 50,000,000 bps。时间 = 800,000,000 ÷ 50,000,000 = 16 秒。


9. Logic Expression Simplification | 逻辑表达式简化计算

Boolean algebra is used to simplify logic circuits. You may be asked to reduce an expression like (A ∧ B) ∨ (¬A ∧ B) to B. The GCSE Edexcel spec expects you to know the basic identities and use truth tables to verify equivalence.

布尔代数用于化简逻辑电路。考试可能要求你将 (A ∧ B) ∨ (¬A ∧ B) 简化为 B。Edexcel GCSE 大纲期望你了解基本恒等式,并使用真值表验证等价性。

For calculation-style questions, you may need to fill in truth table columns for a given expression and count the number of inputs that yield an output of 1, or calculate the number of gates saved by simplification. Always work systematically.

对于计算类题目,可能需要为给定表达式填写真值表,统计输出为 1 的输入组合数量,或计算简化后节省的门电路数量。解题时要系统进行。

Example: The expression Q = (A AND B) OR (A AND NOT B). Derive the simplified form and state how many 2-input gates are used before and after simplification.

例题:表达式 Q = (A AND B) OR (A AND NOT B)。推导简化形式,并说明简化前后各使用了多少个 2 输入门。

Distributing: A AND (B OR NOT B) = A AND 1 = A. Original used two AND gates and one OR gate (3 gates). Simplified just uses a wire (0 gates). So simplification saved all 3 gates.

分配律:A AND (B OR NOT B) = A AND 1 = A。原来使用两个与门和一个或门(共 3 个门)。简化后仅需一条连线(0 个门),即节省了 3 个门。


10. Trace Table Calculations | 算法跟踪表计算

Trace tables are used to manually step through an algorithm, recording the values of variables at each step. Typical GCSE calculation questions ask you to complete a partial trace table or to determine the final output of an algorithm that uses loops, conditionals, and arithmetic operations.

跟踪表用于手动模拟算法的每一步,记录变量的值。典型的 GCSE 计算题会要求你补全一张部分给出的跟踪表,或确定使用循环、条件判断和算术运算的算法的最终输出。

You must show each variable update and keep track of indices and totals. For example, a simple FOR loop that sums numbers from 1 to 5: total starts at 0, i=1 total=1, i=2 total=3, i=3 total=6, i=4 total=10, i=5 total=15. The trace table documents these changes.

你需要展示每一次变量更新,并跟踪索引和累计值。例如,一个将 1 到 5 相加的简单 FOR 循环:total 初始为 0,i=1 时 total=1,i=2 时 total=3,i=3 total=6,i=4 total=10,i=5 total=15。跟踪表会记录这些变化。

When loops contain conditional statements, you must carefully follow the logic and only update variables when conditions are met. Exam questions often provide a blank table and ask you to fill in the values for the given inputs.

当循环中包含条件语句时,你需要严格遵循逻辑,只有当条件满足时才更新变量。考试题目通常会提供一个空表,要求你根据给定输入填写数值。

Example: Algorithm: x ← 10; while x > 0: if x mod 2 = 0 then y ← y + x; x ← x − 1. Starting with y = 0, trace for the first three iterations.

例题:算法:x ← 10;当 x > 0 时:如果 x mod 2 = 0 则 y ← y + x;x ← x − 1。从 y = 0 开始,追踪前三次迭代。

Iteration 1: x=10 (even), y becomes 10, x becomes 9. Iteration 2: x=9 (odd), y unchanged (10), x becomes 8. Iteration 3: x=8 (even), y becomes 10+8=18, x becomes 7. The trace table would record x, y, and condition results.

第一次迭代:x=10(偶数),y 变为 10,x 变为 9。第二次:x=9(奇数),y 不变(仍为 10),x 变为 8。第三次:x=8(偶数),y 变为 10+8=18,x 变为 7。跟踪表会记录 x、y 以及条件判断结果。

By mastering these calculation techniques across all these topics, you will be well-prepared for the computational demands of the Edexcel GCSE Computer Science exams. Regular practice with bilingual resources can solidify your understanding.

通过掌握所有这些专题的计算技巧,你将为 Edexcel GCSE

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