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

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

Calculations form a core part of GCSE Computer Science. Whether you are converting between number bases, estimating file sizes, or determining transmission times, a solid grasp of the underlying formulas and methods is essential. This article revisits the most common calculation topics with clear step-by-step explanations, examples, and practical hints to help you tackle exam questions confidently.

计算是 GCSE 计算机科学考试的核心部分。无论是进制转换、估算文件大小还是计算传输时间,牢固掌握基本公式和方法都至关重要。本文通过清晰的逐步解析、示例和实用提示,回顾最常见的计算主题,帮助你有信心地应对考题。


1. Binary to Decimal Conversion | 二进制转十进制

To convert a binary number into decimal, each binary digit (bit) is multiplied by its place value, which is a power of 2. The rightmost bit has the place value 2⁰ (1), the next 2¹ (2), then 2² (4), and so on. Summing all these products gives the decimal equivalent.

要将二进制数转换为十进制,每一位二进制数字(比特)乘以它的位权——2 的幂。最右边的位权是 2⁰(1),接着是 2¹(2)、2²(4),依此类推。将所有乘积相加,即得十进制值。

Formula: Decimal = dₙ₋₁ · 2ⁿ⁻¹ + dₙ₋₂ · 2ⁿ⁻² + … + d₁ · 2¹ + d₀ · 2⁰

公式:十进制数 = dₙ₋₁ · 2ⁿ⁻¹ + dₙ₋₂ · 2ⁿ⁻² + … + d₁ · 2¹ + d₀ · 2⁰

Example: Convert 1011₂ to decimal. The positions from left to right: 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11, so 1011₂ = 11₁₀.

举例:将 1011₂ 转换为十进制。从左到右各位权:1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11,即 1011₂ = 11₁₀。


2. Decimal to Binary Conversion | 十进制转二进制

One common method for converting a decimal number to binary is successive division by 2. Write down the remainder (0 or 1) after each division, then read the remainders from bottom to top to obtain the binary representation.

将十进制转换为二进制的一种常用方法是连续除以 2。每次除法后记下余数(0 或 1),然后从下往上读取余数,就得到二进制表示。

Example: Convert 13 to binary. 13 ÷ 2 = 6 remainder 1; 6 ÷ 2 = 3 remainder 0; 3 ÷ 2 = 1 remainder 1; 1 ÷ 2 = 0 remainder 1. Reading remainders from bottom: 1101₂, so 13₁₀ = 1101₂.

示例:将 13 转换为二进制。13 ÷ 2 = 6 余 1;6 ÷ 2 = 3 余 0;3 ÷ 2 = 1 余 1;1 ÷ 2 = 0 余 1。从下往上读余数:1101₂,所以 13₁₀ = 1101₂。


3. Binary Addition and Overflow | 二进制加法与溢出

Binary addition follows four simple rules: 0+0=0, 0+1=1, 1+0=1, and 1+1=0 with a carry of 1 to the next higher bit. If a carry from the most significant bit occurs but there is no room to store it, an overflow error happens – common in fixed-width registers.

二进制加法遵循四条简单规则:0+0=0,0+1=1,1+0=1,1+1=0 并向高位进 1。当最高位产生进位却没有空间存储时,就会发生溢出错误——这在固定宽度寄存器中很常见。

Example: Add 0110₂ (6) and 0111₂ (7) in a 4-bit system. 0110 + 0111 = 1101₂, but the correct sum is 13, which requires 5 bits (1101₂ is 13, actually fits? Let’s recalc: 0110 (6) + 0111 (7) = 1101 (13). In a 4-bit unsigned system, 1101 is 13, no overflow if range is 0–15. But if we use signed representation, overflow occurs when the sign bit changes unexpectedly. A clearer example: 1000₂ (8) + 1000₂ (8) = 1 0000₂, the carry out of the 4‑bit register indicates overflow.

示例:在 4 位系统中计算 1000₂ (8) + 1000₂ (8)。1 0000₂ 需要 5 位,多出的第 5 位无法存入 4 位寄存器,产生溢出错误。对于无符号数,4 位范围是 0–15,8+8=16 超出范围即溢出。


4. Data Unit Conversions | 数据单位换算

Data sizes are measured in bits and bytes, and quantities grow by powers of 2. A byte is 8 bits. One kibibyte (KiB) is 2¹⁰ = 1024 bytes, one mebibyte (MiB) is 2²⁰ bytes, and so on. In many GCSE contexts, the terms KB, MB, GB are used but imply binary multiples (×1024).

数据大小以比特和字节为单位,数量按 2 的幂增长。1 字节 = 8 比特。1 千比字节 (KiB) 为 2¹⁰ = 1024 字节,1 兆比字节 (MiB) 为 2²⁰ 字节,以此类推。在许多 GCSE 考试中,KB、MB、GB 这些术语通常隐含二进制倍数(×1024)。

Common conversions: 1 byte = 8 bits; 1 KiB = 1024 bytes; 1 MiB = 1024 KiB; 1 GiB = 1024 MiB; 1 TiB = 1024 GiB.

常见换算:1 字节 = 8 比特;1 KiB = 1024 字节;1 MiB = 1024 KiB;1 GiB = 1024 MiB;1 TiB = 1024 GiB。

To convert bits to bytes, divide by 8. To go from a smaller unit to a larger one, divide by 1024 repeatedly; to go larger to smaller, multiply by 1024.

比特转换为字节除以 8;小单位到大单位逐次除以 1024;大单位到小单位逐次乘以 1024。


5. Image File Size Calculation | 图像文件大小计算

An uncompressed image’s file size depends on its resolution and colour depth. Resolution is width × height in pixels. Colour depth is the number of bits used to represent each pixel’s colour. The basic formula in bytes is:

未压缩图像的文件大小取决于分辨率和色深。分辨率是像素的宽 × 高。色深是用来表示每个像素颜色的比特数。基本公式(以字节为单位)为:

Image size (bytes) = (Width × Height × Colour Depth) ÷ 8

图像大小 (字节) = (宽度 × 高度 × 色深) ÷ 8

Example: A 1920×1080 image with 24-bit colour depth. Number of pixels = 1920 × 1080 = 2,073,600. Total bits = 2,073,600 × 24 = 49,766,400 bits. In bytes = 49,766,400 ÷ 8 = 6,220,800 bytes ≈ 6.22 MB (dividing by 1024²).

示例:一幅 1920×1080、24 位色深的图像。像素总数 = 1920 × 1080 = 2,073,600。总比特数 = 2,073,600 × 24 = 49,766,400 比特。字节数 = 49,766,400 ÷ 8 = 6,220,800 字节 ≈ 6.22 MB(除以 1024²)。


6. Sound File Size Calculation | 声音文件大小计算

Uncompressed sound file size is calculated using the sample rate, bit depth, number of channels, and duration. Sample rate is measured in hertz (Hz), bit depth in bits per sample, and time in seconds.

未压缩声音文件的大小按采样率、采样位数、声道数和时长计算。采样率以赫兹 (Hz) 为单位,采样位数以比特每采样为单位,时长以秒为单位。

Sound size (bits) = Sample Rate × Bit Depth × Channels × Duration (s)

声音大小 (比特) = 采样率 × 采样位数 × 声道数 × 时长 (秒)

Then convert bits to bytes by dividing by 8. For example, a 3-minute stereo track sampled at 44.1 kHz with 16-bit depth: bits = 44,100 × 16 × 2 × 180 = 254,016,000 bits. Bytes = 254,016,000 ÷ 8 = 31,752,000 B ≈ 30.3 MB.

再将比特除以 8 转换为字节。例如,一段 3 分钟立体声、44.1 kHz 采样率、16 位采样位数:比特数 = 44,100 × 16 × 2 × 180 = 254,016,000 比特。字节数 = 254,016,000 ÷ 8 = 31,752,000 B ≈ 30.3 MB。


7. Text File Size Estimation | 文本文件大小估算

The size of a plain text file depends on the character encoding used. ASCII uses 7 or 8 bits per character (commonly 1 byte per character). Unicode encodings like UTF-8 use 1‑4 bytes per character, while UTF-16 typically uses 2 or 4 bytes. For estimation, GCSE questions often treat ASCII as 1 byte per character and Unicode (UTF-16) as 2 bytes per character.

纯文本文件的大小取决于所用字符编码。ASCII 每字符使用 7 或 8 比特(通常按 1 字节/字符计)。Unicode 编码如 UTF-8 每字符 1–4 字节,而 UTF-16 通常为 2 或 4 字节。估算时,GCSE 试题常把 ASCII 视为每字符 1 字节,Unicode (UTF-16) 视为每字符 2 字节。

Multiply the number of characters by the byte size per character. For example, a 1500-character essay in ASCII uses approximately 1500 bytes. The same essay in Unicode (2 bytes per char) would need about 3000 bytes.

将字符数乘以每字符字节数即可。例如,一篇 1500 字符的 ASCII 文章约需 1500 字节;同一篇文章用 Unicode(每字符 2 字节)约需 3000 字节。


8. Compression Ratio | 压缩率计算

Compression ratio measures the effectiveness of compression by comparing original and compressed sizes. It can be expressed as a simple ratio or as a percentage saving.

压缩率通过比较原始大小和压缩后大小来衡量压缩效果,可以用简单比值或节省百分比表示。

Compression Ratio = Original Size ÷ Compressed Size

压缩比 = 原始大小 ÷ 压缩后大小

Space Saving (%) = (1 − Compressed Size ÷ Original Size) × 100%

空间节省 (%) = (1 − 压缩后大小 ÷ 原始大小) × 100%

Example: A 50 MB file is compressed to 20 MB. Compression ratio = 50 ÷ 20 = 2.5:1. Space saving = (1 − 20/50) × 100% = 60%.

示例:一个 50 MB 文件压缩后为 20 MB。压缩比 = 50 ÷ 20 = 2.5:1。空间节省 = (1 − 20/50) × 100% = 60%。


9. Boolean Expression Evaluation | 布尔表达式求值

Calculation questions may present a logic circuit or Boolean expression and ask for the output given certain inputs. You must apply the order of precedence (typically NOT first, then AND, then OR) and truth tables for each gate.

计算题可能给出一个逻辑电路或布尔表达式,要求根据特定输入算出输出。你需要按优先级(通常先 NOT,再 AND,再 OR)并依据每种门电路的真值表进行计算。

Example: Evaluate Q = (A AND B) OR NOT C when A=1, B=0, C=1. Step 1: A AND B = 1 AND 0 = 0. Step 2: NOT C = NOT 1 = 0. Step 3: Q = 0 OR 0 = 0.

示例:求 Q = (A AND B) OR NOT C 当 A=1, B=0, C=1 时的值。步骤 1:A AND B = 1 AND 0 = 0。步骤 2:NOT C = NOT 1 = 0。步骤 3:Q = 0 OR 0 = 0。

Truth tables tabulate all possible input combinations. For two inputs, there are 2² = 4 rows; for three inputs, 2³ = 8 rows.

真值表列出所有可能的输入组合。两个输入有 2² = 4 行;三个输入有 2³ = 8 行。


10. Network Transmission Time | 网络传输时间

Transmission time is the time required to send a file across a network, calculated from the data size and the transfer rate. The fundamental formula is:

传输时间是指通过网络发送文件所需的时间,由数据大小和传输速率计算得到。基本公式为:

Time (seconds) = Data Size (bits) ÷ Transfer Rate (bits per second)

时间 (秒) = 数据大小 (比特) ÷ 传输速率 (比特每秒)

Ensure all units match. If the file size is given in bytes, multiply by 8 to get bits. If the rate is in megabits per second (Mbps), be careful with scaling: 1 Mbps = 1,000,000 bps (in decimal terms used in networking) or sometimes 1,048,576 bps in binary contexts – follow the question’s convention. Many GCSE papers use 1 Mbps = 1,000,000 bps.

确保单位一致。若文件大小以字节给出,则乘以 8 得到比特。若速率以兆比特每秒 (Mbps) 给出,注意换算:网络领域通常 1 Mbps = 1,000,000 bps,有些场景使用 1 Mbps = 1,048,576 bps——遵从题目约定。多数 GCSE 试卷使用 1 Mbps = 1,000,000 bps。

Example: A 100 megabit (Mb) file over a 50 Mbps connection. Time = 100 Mb ÷ 50 Mbps = 2 seconds. If a file is 25 MB (megabytes), first convert to bits: 25 × 8 = 200 Mb. Time = 200 Mb ÷ 50 Mbps = 4 s.

示例:一个 100 Mb 的文件通过 50 Mbps 连接传输。时间 = 100 Mb ÷ 50 Mbps = 2 秒。若文件大小为 25 MB,先转换为比特:25 × 8 = 200 Mb。时间 = 200 Mb ÷ 50 Mbps = 4 秒。


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