GCSE CIE Computer Science: Formula Summary Handbook | GCSE CIE 计算机:公式汇总手册

📚 GCSE CIE Computer Science: Formula Summary Handbook | GCSE CIE 计算机:公式汇总手册

This handbook brings together every essential formula you need for the GCSE CIE Computer Science exam. Whether you are calculating the size of an image file, estimating download times, or converting between binary units, a clear grasp of these equations will earn you valuable marks. Use this reference to test yourself and to tackle quantitative problems with confidence.

本手册汇集了GCSE CIE计算机科学考试中所有必要的公式。无论你是在计算图像文件的大小、估算下载时间,还是在二进制单位之间进行换算,清晰掌握这些公式都能为你赢得宝贵的分数。以此作为自测参考,自信地应对定量问题。


1. Unit Conversions & Storage Units | 单位换算与存储单位

In digital systems, data is measured in bits and bytes. One bit is a single binary digit (0 or 1). Eight bits make one byte. When dealing with file sizes and storage capacity, use binary prefixes where 1 KB = 1024 bytes. For network transmission speeds, decimal prefixes are standard (1 kbps = 1000 bps). Always check the context of the question.

在数字系统中,数据以位和字节度量。一个比特就是一个二进制位(0或1)。八个比特构成一个字节。处理文件大小和存储容量时,使用二进制前缀,即1 KB = 1024 字节。对于网络传输速度,则使用十进制前缀(1 kbps = 1000 bps)。务必根据题目场景选择正确的换算。

Storage Unit (Binary) 中文 (存储) Value (bytes)
1 kilobyte (1 KB) 1 千字节 2¹⁰ = 1024 bytes
1 megabyte (1 MB) 1 兆字节 2²⁰ = 1 048 576 bytes
1 gigabyte (1 GB) 1 吉字节 2³⁰ = 1 073 741 824 bytes

For data transfer rates, use the decimal scale: 1 kilobit per second (1 kbps) = 1000 bps, 1 megabit per second (1 Mbps) = 1 000 000 bps. When calculating download time, ensure you convert all quantities to the same unit (e.g., bits or bytes) before applying the formula.

对于数据传输速率,使用十进制:1 千比特每秒 (1 kbps) = 1000 bps,1 兆比特每秒 (1 Mbps) = 1 000 000 bps。在计算下载时间时,务必先将所有数据统一为相同单位(如比特或字节),再代入公式。


2. Text File Size | 文本文件大小

Text files store characters using a character encoding scheme. Each character occupies a fixed number of bits. In ASCII, one character uses 7 or 8 bits (commonly 8 bits = 1 byte). In Unicode (e.g., UTF‑8 or UTF‑16), the number of bytes per character can vary, but for exam purposes you will be told how many bytes or bits to use per character.

文本文件使用字符编码方案存储符号。每个字符占用固定数量的比特。在ASCII编码中,一个字符占用7或8比特(通常按8比特=1字节计算)。在Unicode(例如UTF‑8或UTF‑16)中,每字符的字节数可能不同,但考试中会明确给出每个字符占用的比特数或字节数。

File size (bits) = number of characters × bits per character

文件大小(比特)= 字符数 × 每字符比特数

If the result is required in bytes, divide by 8: File size (bytes) = (number of characters × bits per character) / 8

若结果需要以字节为单位,则除以8:文件大小(字节)= (字符数 × 每字符比特数) / 8

Example: A document contains 1200 characters and uses 2 bytes per character (Unicode). File size = 1200 × 2 = 2400 bytes, or 2400 ÷ 1024 ≈ 2.34 KB.

示例:一份文档包含1200个字符,每个字符使用2个字节(Unicode)。文件大小 = 1200 × 2 = 2400 字节,即 2400 ÷ 1024 ≈ 2.34 KB。


3. Image File Size | 图像文件大小

Bitmap images are composed of pixels. The colour depth (bit depth) determines how many bits are used to store the colour of each pixel. The total image size in bits is the product of width, height, and colour depth. This raw size does not include any compression or metadata.

位图图像由像素构成。颜色深度(位深)决定了存储每个像素颜色所需的比特数。图像的总大小(比特)是宽度、高度与颜色深度的乘积。这个原始大小不包括任何压缩或元数据。

Image file size (bits) = image width (pixels) × image height (pixels) × colour depth (bits per pixel)

图像文件大小(比特)= 图像宽度(像素)× 图像高度(像素)× 颜色深度(每像素比特数)

If a colour depth of n bits is used, the number of available colours is 2ⁿ. For example, a 24‑bit colour depth allows 2²⁴ ≈ 16.7 million colours.

如果颜色深度为 n 比特,则可显示的颜色数为 2ⁿ 种。例如,24位颜色深度可呈现 2²⁴ ≈ 1670万种颜色。

To convert to bytes, divide by 8; to convert to kilobytes, divide by 1024 again. Example: a 400 × 300 pixel image with a colour depth of 16 bits. Size = 400 × 300 × 16 = 1 920 000 bits = 240 000 bytes ≈ 234.38 KB.

转换为字节,除以8;再转换为千字节,除以1024。示例:一幅400×300像素、颜色深度为16比特的图像。大小 = 400 × 300 × 16 = 1 920 000 比特 = 240 000 字节 ≈ 234.38 KB。


4. Sound File Size | 声音文件大小

Sound is represented digitally by taking samples of the analogue signal at regular intervals. The file size depends on the sample rate (samples per second), the sample resolution (bits per sample), the number of channels (e.g., mono = 1, stereo = 2), and the duration in seconds. Higher settings improve quality but increase file size.

声音的数字化表示是通过按固定间隔对模拟信号进行采样来实现的。文件大小取决于采样率(每秒采样次数)、采样分辨率(每样本比特数)、声道数(如单声道=1、立体声=2)以及持续时间(秒)。更高的参数能提升音质,但会增大文件体积。

Sound file size (bits) = sample rate (Hz) × sample resolution (bits) × number of channels × duration (seconds)

声音文件大小(比特)= 采样率 (Hz) × 采样分辨率 (比特) × 声道数 × 持续时间 (秒)

Always convert the duration to seconds before multiplying. For example, a 5‑minute stereo recording at 44.1 kHz with 16‑bit resolution: size = 44 100 × 16 × 2 × (5 × 60) = 44 100 × 16 × 2 × 300 = 423 360 000 bits. Converting to megabytes: 423 360 000 ÷ 8 = 52 920 000 bytes ÷ 1 048 576 ≈ 50.5 MB.

计算前必须先将时间转换为秒。例如,一段5分钟立体声录音,采样率44.1 kHz、16位采样分辨率:大小 = 44 100 × 16 × 2 × (5 × 60) = 44 100 × 16 × 2 × 300 = 423 360 000 比特。转换为兆字节:423 360 000 ÷ 8 = 52 920 000 字节,再除以1 048 576 ≈ 50.5 MB。


5. Video File Size Estimation | 视频文件大小估算

Video combines a sequence of images with an audio track. The file size can be approximated by adding the video stream and audio stream sizes. The video stream depends on the resolution, colour depth, frame rate (frames per second) and duration. You may also need to account for compression if a codec is used, but for raw estimation the approach is additive.

视频由图像序列和音频轨道组合而成。文件大小可以通过叠加视频流与音频流的数据量来估算。视频流的大小取决于分辨率、颜色深度、帧率(每秒帧数)和时长。如果使用了编解码器,还需考虑压缩因素,但在原始估算中可直接累加。

Video stream size (bits) = width × height × colour depth × frame rate × duration (s)

视频流大小(比特)= 宽度 × 高度 × 颜色深度 × 帧率 × 时长 (秒)

Total video file size ≈ video stream size + audio stream size

视频文件总大小 ≈ 视频流大小 + 音频流大小

The audio stream is calculated with the sound file formula. In examination questions, you are usually provided with the necessary parameters or a compressed bit rate. Example: a 30‑second 640×480 video with 24‑bit colour, 30 fps, plus audio at 128 kbps. Video bits = 640×480×24×30×30 = 6 635 520 000 bits. Audio bits = 128 000 × 30 = 3 840 000 bits. Total ≈ 6.64 Gb (gigabits).

音频流依据声音文件公式计算。在考试题中,通常会给出所需参数或者压缩后的比特率。示例:一段30秒、640×480分辨率、24位色彩、30 fps的视频,加上128 kbps的音频。视频比特数 = 640×480×24×30×30 = 6 635 520 000 比特;音频比特数 = 128 000 × 30 = 3 840 000 比特。总计约 6.64 Gb(吉比特)。


6. Compression Ratio | 压缩比

Data compression reduces file size for storage or transmission. The compression ratio compares the uncompressed size to the compressed size and tells you how much space has been saved. A higher ratio means more aggressive compression. Lossless compression reduces file size without losing data; lossy compression achieves greater reduction by discarding some data.

数据压缩可以减小存储或传输的文件体积。压缩比通过对比未压缩大小与压缩后大小,反映出节省了多少空间。比值越高,表示压缩越彻底。无损压缩在不丢失数据的前提下缩小文件;有损压缩则通过舍弃部分数据来获得更高压缩率。

Compression ratio = uncompressed file size / compressed file size

压缩比 = 未压缩文件大小 / 压缩后文件大小

It is often expressed as a ratio like 4:1, meaning the original file is four times as large as the compressed file. The space saving percentage can be calculated as: Space saving (%) = (1 − (compressed size / uncompressed size)) × 100.

通常表示为如 4:1 的形式,表示原始文件是压缩后文件的4倍大。空间节省百分比的计算公式为:空间节省 (%) = (1 − (压缩后大小 / 未压缩大小)) × 100

Example: a 800 KB image is compressed to 200 KB. Compression ratio = 800 ÷ 200 = 4:1. Space saving = (1 − (200/800)) × 100 = 75%.

示例:一张800 KB的图像压缩后变为200 KB。压缩比 = 800 ÷ 200 = 4:1。节省的空间 = (1 − (200/800)) × 100 = 75%。


7. Data Transfer Time | 数据传输时间

When a file is sent over a network, the transfer time depends on the size of the file and the bandwidth (data transfer rate) of the connection. The basic formula refers to the theoretical minimum time, ignoring protocol overheads and latency. Always use matching units (bits or bytes) for both quantities.

当文件通过网络传输时,传输时间取决于文件大小以及连接带宽(数据传输速率)。基本公式指的是理论最短时间,忽略了协议开销和网络延迟。务必保证两个量的单位统一(同为比特或同为字节)。

Transfer time (seconds) = file size (bits) / transfer rate (bps)

传输时间 (秒) = 文件大小 (比特) / 传输速率 (bps)

If the file size is given in bytes and the rate in Mbps, convert both to the same combination. For example, to download a 50 MB file using a 10 Mbps connection: 50 MB = 50 × 1024 × 1024 × 8 bits = 419 430 400 bits. Rate = 10 × 1 000 000 = 10 000 000 bps. Time = 419 430 400 / 10 000 000 ≈ 41.94 seconds.

如果文件大小以字节给出,而传输速率以 Mbps 给出,需将两者转化为同一组合。例如,用10 Mbps 连接下载一个50 MB 文件:50 MB = 50 × 1024 × 1024 × 8 比特 = 419 430 400 比特;速率 = 10 × 1 000 000 = 10 000 000 bps。时间 = 419 430 400 / 10 000 000 ≈ 41.94 秒。

The same relationship can be rearranged to find the required transfer rate or the file size that can be transferred in a given time: Transfer rate = file size / time and File size = transfer rate × time.

该关系式可以变形,用以求所需传输速率或给定时间内可传输的文件大小:传输速率 = 文件大小 / 时间文件大小 = 传输速率 × 时间


8. Range of Binary Integers | 二进制整数表示范围

Computers use a fixed number of bits to store integers. The range of values that can be represented depends on the number of bits and the type of representation (unsigned or two’s complement). Understanding these limits allows you to determine whether an overflow will occur and to predict the minimum and maximum possible values.

计算机使用固定比特数存储整数。能够表示的数值范围取决于比特数和表示方式(无符号或二进制补码)。了解这些限制能帮助你判断是否会发生溢出,以及预测可能的最小值和最大值。

Unsigned n-bit integer range: 0 to 2ⁿ − 1

无符号 n 位整数范围: 0 至 2ⁿ − 1

Two’s complement n-bit integer range: −2ⁿ⁻¹ to 2ⁿ⁻¹ − 1

二进制补码 n 位整数范围: −2ⁿ⁻¹ 至 2ⁿ⁻¹ − 1

For example, with 8 bits, unsigned integers can hold values from 0 to 255 (2⁸ − 1). Two’s complement allows −128 (−2⁷) to +127 (2⁷ − 1). In calculation questions, you may need to verify whether a given result fits into the allocated number of bits; if it exceeds the range, an overflow occurs and the stored value will be incorrect.

例如,使用8比特时,无符号整数可存储0到255(2⁸ − 1)之间的数值。二进制补码则可表示−128(−2⁷)至+127(2⁷ − 1)。在计算题中,你可能需要验证某个结果能否放入分配的比特数内;若超出范围,则发生溢出,存储的值将出现错误。


9. Sampling Parameters & Resolution | 采样参数与分辨率

Besides file size formulas, it is important to understand the individual parameters that affect the quality and size of digital media. Sample resolution (bit depth) determines the number of discrete levels available to encode a sample. Sample rate measures how often samples are taken per second. Both parameters directly influence file size as shown in the image and sound formulas.

除了文件大小公式,理解影响数字媒体质量和体积的各项参数也很重要。采样分辨率(位深)决定了编码每个样本时可用的离散级数。采样率则衡量每秒采集样本的次数。这两个参数都会直接影响文件大小,正如前述图像和声音公式所展示的那样。

Number of discrete levels = 2^(resolution in bits)

离散级数 = 2^(分辨率比特数)

For audio, a 16‑bit sample resolution provides 2¹⁶ = 65 536 possible amplitude levels. For images, an 8‑bit colour depth gives 2⁸ = 256 levels per channel. Increasing resolution or sample rate improves fidelity but demands more storage.

对于音频,16比特的采样分辨率可提供 2¹⁶ = 65 536 个振幅级。对于图像,8比特的颜色深度在每个通道可呈现 2⁸ = 256 个级别。提升分辨率或采样率能改善保真度,但会占用更多存储空间。

A summary of how these settings are used appears in the file size formulas above. Always ensure you substitute the correct values, paying close attention to units such as Hz, bits, and seconds.

这些参数的使用方式汇总于此前的文件大小公式中。务必准确代入数值,并特别注意赫兹、比特、秒等单位。


10. Checksum & Check Digit Basics | 校验和与校验位基础

Checksums and check digits are used to detect errors in data transmission or entry. While not always represented by a single formula, the underlying idea involves arithmetic operations that produce a fixed‑length value. For example, an 8‑bit checksum is the sum of data bytes, modulo 256, often appended and then the sum recalculated to compare. The general principle is pattern‑based, but you may be asked to calculate a simple checksum or verify a given check digit.

校验和与校验位用于检测数据传输或录入中的错误。虽然并不总以单一公式出现,但其核心理念是进行算术运算以产生定长数值。例如,一个8位校验和可以是数据字节之和模256,通常附加后重新求和比较。其原理基于模式,但你可能会被要求计算简单的校验和或验证给定的校验位。

For an ISBN‑13 check digit: each digit is multiplied alternately by 1 and 3, the products are summed, and the check digit is the number that makes the total a multiple of 10. The formula can be expressed as: (sum of (digit × weight)) mod 10 = 0 after including the check digit.

以ISBN‑13校验位为例:每位数字交替乘以1和3,乘积相加后,校验位是使总和成为10的倍数的那个数字。该规则可表达为:包含校验位后, (数字 × 权重的总和) mod 10 = 0

While CIE questions rarely ask you to memorise the exact algorithm, you should be comfortable applying a described rule to find or check a check digit.

虽然CIE考试很少要求你死记具体算法,但你应该能熟练运用给定的规则来找出或校验一个校验位。


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