📚 GCSE Computer Science: Calculation Practice Guide | GCSE 计算机科学:计算题专项训练
Calculation questions form a substantial part of GCSE Computer Science exams, testing your ability to convert between number systems, perform logical operations, and compute file sizes or data transfer rates. This guide consolidates the essential calculation skills through clear explanations, worked examples, and practice points for each topic.
计算题在 GCSE 计算机科学考试中占据重要比重,考察你进行数制转换、逻辑运算,以及计算文件大小或数据传输速率的能力。本指南通过清晰解释、详细示例和各主题练习要点,帮助你巩固必备的计算技能。
1. Binary and Denary Conversions | 二进制与十进制转换
To convert a binary number to denary, write the column headings as powers of 2, from right to left, starting with 2⁰. Multiply each binary digit by its column value and sum the results. For example, the binary number 1101₂ equals 1×8 + 1×4 + 0×2 + 1×1 = 13 in denary.
将二进制数转换为十进制时,从右向左写出以 2 为底的幂次列标题,从 2⁰ 开始。将每一位二进制数字与其列值相乘,然后求和。例如,二进制数 1101₂ 等于 1×8 + 1×4 + 0×2 + 1×1 = 13(十进制)。
To convert a denary number to binary, repeatedly divide the denary number by 2, recording the remainder at each step. Read the remainders from bottom to top to form the binary equivalent. For 13, 13 ÷ 2 = 6 r1, 6 ÷ 2 = 3 r0, 3 ÷ 2 = 1 r1, 1 ÷ 2 = 0 r1; reading upwards gives 1101₂.
要将十进制数转换为二进制,则不断除以 2,记录每一步的余数。从下往上读取余数即可得到二进制表示。以 13 为例,13 ÷ 2 = 6 余 1,6 ÷ 2 = 3 余 0,3 ÷ 2 = 1 余 1,1 ÷ 2 = 0 余 1;从下往上读得 1101₂。
Binary to denary: D = Σ (bᵢ × 2ⁱ)
Quick practice: Convert 101010₂ to denary. Answer: 42. | 快速练习:将 101010₂ 转换为十进制。答案:42。
2. Binary Addition and Overflow | 二进制加法与溢出
Binary addition follows four basic rules: 0+0=0, 0+1=1, 1+0=1, and 1+1=0 carry 1. When adding two 8-bit numbers, a carry into a non-existent 9th bit causes an overflow error. Overflow occurs when the result exceeds the maximum value that can be stored in the given number of bits.
二进制加法遵循四条基本规则:0+0=0,0+1=1,1+0=1,1+1=0 进 1。在将两个 8 位二进制数相加时,若产生向不存在的第 9 位的进位,则出现溢出错误。当结果超出指定位数所能存储的最大值时,即发生溢出。
Add the binary numbers 01101001₂ (105) and 00111100₂ (60) using column addition. Working from right to left, you obtain 10100101₂ (165), which fits in 8 bits and produces no carry out of the most significant column. However, adding 11001100₂ (204) and 01111000₂ (120) yields 01000100₂ with a carry out, indicating an incorrect result due to overflow.
使用按位加法计算二进制数 01101001₂ (105) 与 00111100₂ (60)。从右向左逐位相加,得到 10100101₂ (165),该值可容纳于 8 位中,最高位未产生进位。然而,若计算 11001100₂ (204) 与 01111000₂ (120),则得到 01000100₂ 并产生进位输出,表明因溢出而导致结果错误。
Overflow check: If carry into MSB ≠ carry out of MSB, overflow occurs.
3. Hexadecimal Conversions | 十六进制转换
Hexadecimal (base 16) uses digits 0–9 and letters A–F to represent values 10–15. Converting binary to hex is straightforward: split the binary number into nibbles (groups of 4 bits) from the right, then convert each nibble to its hex equivalent. For example, 11011010₂ becomes 1101 1010₂, which is D in hex for 1101 and A for 1010, giving DA₁₆.
十六进制(基数为 16)使用数字 0–9 和字母 A–F 表示 10–15。二进制转十六进制非常简单:从右侧起将二进制数分割为半字节(4 位一组),然后将每个半字节转换为相应的十六进制值。例如,11011010₂ 拆分为 1101 1010₂,其中 1101 对应十六进制 D,1010 对应 A,结果为 DA₁₆。
To convert hex to denary, multiply each hex digit by 16 raised to the power of its position (starting from 0 on the right). The hex number 2F₁₆ equals (2×16¹) + (15×16⁰) = 32 + 15 = 47.
将十六进制转换为十进制,则将每位十六进制数字乘以 16 的相应次幂(从右侧的 0 次幂开始)。十六进制数 2F₁₆ 等于 (2×16¹) + (15×16⁰) = 32 + 15 = 47。
Denary from hex: D = Σ (hᵢ × 16ⁱ)
4. Binary Shifts – Multiplication and Division | 二进制移位——乘法与除法
A left shift of one place multiplies a binary number by 2. Shifting left by n places multiplies by 2ⁿ, provided no bits are lost off the left end. For example, shifting 00010100₂ (20) left by two places yields 01010000₂ (80), which is 20 × 4.
向左移一位二进制数相当于乘以 2。向左移 n 位则乘以 2ⁿ,前提是左侧末端没有丢失位数。例如,将 00010100₂ (20) 左移两位得到 01010000₂ (80),即 20 × 4。
A right shift of one place divides a binary number by 2, discarding any remainder for logical shifts. Shifting 00101010₂ (42) right by two places gives 00001010₂ (10), because 42 ÷ 4 = 10.5, and the fractional part is dropped.
向右移一位二进制数相当于除以 2,逻辑移位时舍弃任何余数。将 00101010₂ (42) 右移两位得到 00001010₂ (10),因为 42 ÷ 4 = 10.5,小数部分被丢弃。
Left shift n places: value × 2ⁿ Right shift n places: value ÷ 2ⁿ (integer division)
5. Representing Characters – Size Calculations | 字符表示——存储空间计算
The number of bits per character depends on the character set. Standard ASCII uses 7 bits per character, but is often stored as 8 bits (1 byte) per character. Extended ASCII uses 8 bits per character, supporting 256 symbols. Unicode can use up to 32 bits per character, though common implementations such as UTF‑8 vary from 8 to 32 bits.
每个字符所占的比特数取决于字符集。标准 ASCII 每个字符使用 7 比特,但通常每字符存储为 8 比特(1 字节)。扩展 ASCII 每字符使用 8 比特,可支持 256 个符号。Unicode 最多每字符可用 32 比特,不过常见实现(如 UTF‑8)使用 8 至 32 比特不等。
Calculate the file size for a text file containing 3,000 characters stored in extended ASCII (8 bits per character): 3000 × 8 = 24,000 bits = 3,000 bytes. If stored in 16-bit Unicode, the size would double: 3000 × 16 = 48,000 bits = 6,000 bytes.
计算一个包含 3,000 字符且以扩展 ASCII(每字符 8 比特)存储的文本文件的文件大小:3000 × 8 = 24,000 比特 = 3,000 字节。如果以 16 位 Unicode 存储,大小将翻倍:3000 × 16 = 48,000 比特 = 6,000 字节。
Text file size (bits) = Number of characters × Bits per character
6. Image File Size Calculations | 图像文件大小计算
An image’s size in bits is the product of its resolution (pixels wide × pixels high) and its colour depth (bits per pixel). For a 600 × 400 pixel image with 24-bit colour, the size is 600 × 400 × 24 = 5,760,000 bits. Divide by 8 to get bytes (720,000 B), and further divide by 1024 for approximate kilobytes (703.125 KiB).
图像大小(以比特为单位)是其分辨率(宽度像素 × 高度像素)与颜色深度(每像素比特数)的乘积。对于一幅具有 24 位色彩的 600 × 400 像素图像,大小为 600 × 400 × 24 = 5,760,000 比特。除以 8 得到字节数(720,000 字节),再除以 1024 可得近似千字节数(703.125 KiB)。
If the colour depth is reduced to 8 bits, the same image would occupy 600 × 400 × 8 = 1,920,000 bits (240,000 bytes). This demonstrates how lowering colour depth significantly reduces file size at the expense of colour fidelity.
如果将颜色深度减少到 8 位,同一图像将占 600 × 400 × 8 = 1,920,000 比特(240,000 字节)。这表明降低颜色深度可大幅减小文件大小,但会牺牲色彩保真度。
Image size (bits) = Width (pixels) × Height (pixels) × Colour depth (bpp)
7. Sound File Size Calculations | 声音文件大小计算
The size of an uncompressed sound file depends on its sample rate (Hz), duration (seconds), bit depth, and number of channels (mono = 1, stereo = 2). Multiply these values together to find the size in bits. For a 30-second stereo recording sampled at 44.1 kHz with 16-bit depth, the calculation is 44100 × 30 × 16 × 2 = 42,336,000 bits.
未压缩的声音文件大小取决于其采样率(Hz)、时长(秒)、位深度以及声道数(单声道 = 1,立体声 = 2)。将这些数值相乘即可得到比特大小。对于一段 30 秒、采样率 44.1 kHz、位深度 16 位的立体声录音,计算过程为 44100 × 30 × 16 × 2 = 42,336,000 比特。
Convert to megabytes: 42,336,000 bits ÷ 8 = 5,292,000 bytes; ÷ 1024 ≈ 5168 KiB; ÷ 1024 again ≈ 5.05 MiB. Understanding these conversions helps you determine storage requirements and data transfer times.
转换为兆字节:42,336,000 比特 ÷ 8 = 5,292,000 字节;÷ 1024 ≈ 5168 KiB;再 ÷ 1024 ≈ 5.05 MiB。掌握这些换算有助于你确定存储需求和数据传输时间。
Sound size (bits) = Sample rate (Hz) × Duration (s) × Bit depth × Channels
8. Logic Gate Calculations | 逻辑门计算
Logic gates process binary inputs to produce a single output. You should be able to deduce the output of a combination of AND, OR, NOT, XOR, NAND, and NOR gates given specific inputs. Create a truth table for each gate first, then trace the signals through intermediate points.
逻辑门处理二进制输入以产生单一输出。你应当能够针对给定输入,推导出由与、或、非、异或、与非和或非门组合产生的输出结果。首先为每种门创建真值表,然后追踪经过各个中间点的信号。
For a circuit where A and B feed an AND gate, whose output is passed to a NOT gate, the final output is the NAND of A and B. If A=1 and B=0, the AND output is 0, and NOT makes it 1. Systematic tracing avoids mistakes in exam calculations.
假设某一电路中 A 和 B 输入至一个与门,其输出再经过一个非门,最终输出即为 A 和 B 的与非结果。若 A=1 且 B=0,与门输出为 0,经非门变为 1。通过系统化追踪可避免考试计算中的错误。
Calculate the number of possible input combinations for an n-input logic circuit as 2ⁿ. For three inputs, there are 2³ = 8 rows in the truth table.
计算 n 输入逻辑电路的可能输入组合数为 2ⁿ。对于三个输入,真值表共有 2³ = 8 行。
9. Processor Performance Calculations | 处理器性能计算
The clock speed, measured in Hertz, indicates how many instruction cycles a processor can execute per second. A 3.5 GHz processor performs 3.5 × 10⁹ cycles per second. To find the time taken for one cycle, calculate the reciprocal: 1 ÷ (3.5 × 10⁹) ≈ 0.286 nanoseconds.
时钟速度以赫兹为单位,表示处理器每秒可执行多少个指令周期。一块 3.5 GHz 的处理器每秒执行 3.5 × 10⁹ 个周期。要计算一个周期所需的时间,取其倒数:1 ÷ (3.5 × 10⁹) ≈ 0.286 纳秒。
If an instruction set architecture requires an average of 2 cycles per instruction (CPI), the number of instructions executed per second is clock rate ÷ CPI. At 3.5 GHz and CPI = 2, instructions per second = 1.75 × 10⁹. This helps compare different processor designs.
若某个指令集架构平均每条指令需要 2 个周期(CPI),则每秒执行的指令数为时钟速率 ÷ CPI。在 3.5 GHz 且 CPI = 2 的情况下,每秒指令数为 1.75 × 10⁹。这有助于比较不同的处理器设计方案。
Execution time per cycle = 1 / Clock frequency Instructions per second = Clock frequency / CPI
10. Data Transfer and Network Speed Calculations | 数据传输与网络速度计算
Calculate the time required to transfer a file by dividing the file size by the transfer rate, ensuring both are in the same units. A 56 Megabyte file over a 100 Megabit per second network transfers in (56 × 8) ÷ 100 = 4.48 seconds, assuming no overhead. Since 1 Byte = 8 bits, multiply the file size in bytes by 8 to convert to bits.
计算传输文件所需时间时,用文件大小除以传输速率,确保两者单位一致。若通过 100 兆比特/秒的网络传输 56 兆字节的文件,假设无协议开销,传输时间为 (56 × 8) ÷ 100 = 4.48 秒。因为 1 字节 = 8 比特,所以将以字节为单位的文件大小乘以 8 转换为比特。
Be careful with prefixes: 1 Megabyte = 10⁶ bytes (or 2²⁰ bytes in storage contexts; exam boards specify which standard to use). Similarly, 1 Megabit = 10⁶ bits. Always read the question carefully to identify whether numbers are in bits or bytes.
注意前缀的用法:1 兆字节 = 10⁶ 字节(或在存储语境下为 2²⁰ 字节;考试局会明确使用哪种标准)。同样地,1 兆比特 = 10⁶ 比特。务必仔细审题,辨认数值的单位是比特还是字节。
Transfer time (s) = (File size in bits) / (Transfer rate in bits per second)
11. Storage Unit Conversion Drill | 存储单位换算训练
You need to move fluently between bits, bytes, kilobytes, megabytes, gigabytes, and terabytes. While exam boards may vary, both the binary definitions (1 KiB = 1024 bytes, etc.) and decimal definitions (1 KB = 1000 bytes) are tested. Always check the context: storage device manufacturers typically use decimal; operating systems usually use binary.
你需要熟练地在比特、字节、千字节、兆字节、千兆字节和太字节之间进行转换。尽管不同考试局的要求可能有所不同,但二进制定义(1 KiB = 1024 字节等)和十进制定义(1 KB = 1000 字节)均会被考查。始终结合语境判断:存储设备制造商通常采用十进制,操作系统通常采用二进制。
Work out the number of 4 KiB photos that can fit on a 64 GB smartphone if the operating system uses binary multiples: 64 GiB = 64 × 1024 MiB = 65,536 MiB; 65,536 MiB × 1024 KiB/MiB = 67,108,864 KiB; divided by 4 KiB per photo gives approximately 16,777,216 photos.
计算一块 64 GB 的智能手机在操作系统使用二进制倍率的情况下可存储多少张 4 KiB 的照片:64 GiB = 64 × 1024 MiB = 65,536 MiB;65,536 MiB × 1024 KiB/MiB = 67,108,864 KiB;除以每张照片 4 KiB 得到约 16,777,216 张照片。
Binary: 1 KiB = 2¹⁰ bytes = 1024 bytes Decimal: 1 KB = 10³ bytes = 1000 bytes
12. Checking Calculations and Avoiding Common Errors | 检查计算与避免常见错误
Always double-check your units and perform a sanity check on the magnitude of your answer. If you calculate that a 1-second audio clip requires several gigabytes, you have probably mixed up bits and bytes. Write down your conversion steps and label each number with its unit to reduce careless mistakes.
请务必仔细检查单位,并对答案的数量级进行合理的合理性检验。如果计算出 1 秒钟的音频需要数 GB,那么极有可能混淆了比特和字节。写下转换步骤并为每个数值标注单位,可有效减少粗心错误。
In binary addition, a common error is forgetting to carry. Annotate each column with small carry markers. For shifts, verify the result by converting both original and shifted numbers to denary and checking the arithmetic relationship.
在二进制加法中,常见的错误是忘记进位。可在每列用小进位标记进行标注。对于移位运算,可将原数和移位后的数均转换为十进制,再检验其算术关系来验证结果。
Use the formula triangles or written relationships provided in this guide as an exam-day reference, but practise enough so that the methods become second nature.
可将本指南中提供的公式三角或数学关系作为考试日的参考,但应通过充分练习使这些方法成为习惯。
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课程辅导,国外大学本科硕士研究生博士课程论文辅导