← 返回资讯屏轩教育 · 行业资讯

IGCSE Computer Science: Formula Handbook | IGCSE 计算机科学:公式汇总手册

2026-07-15 01:46 · 本文部分内容由AI辅助创作

📚 IGCSE Computer Science: Formula Handbook | IGCSE 计算机科学:公式汇总手册

This handbook brings together every essential formula you will encounter in IGCSE Computer Science. From bit, byte and file size calculations to data transfer time and compression ratios, these expressions form the backbone of many exam questions. Work through each section, practise with real-world numbers, and you will be able to handle any calculation-based problem with ease.

本手册汇集了 IGCSE 计算机科学课程中你会遇到的每一个核心公式。从位、字节和文件大小计算到数据传输时间与压缩比,这些表达式构成了许多考试题目的基础。认真学习每一节,用真实数值进行练习,你就能轻松应对任何计算类题目。


1. Units of Data Storage | 数据存储单位

All digital data is measured in bits and bytes. A single bit (b) can store either 0 or 1, while a group of 8 bits forms one byte (B). Larger units are built on powers of 2, which is why we use 1024 rather than 1000 as the multiplier between successive units.

所有的数字数据都以比特和字节来衡量。一个比特(b)可以储存 0 或 1,而 8 个比特组成一个字节(B)。更大的单位都基于 2 的幂次,这就是为什么相邻单位之间我们使用 1024 而非 1000 作为换算倍数。

UnitSymbolEquivalent
bitb0 or 1
byteB1 B = 8 b
kilobyteKB1 KB = 1024 B
megabyteMB1 MB = 1024 KB
gigabyteGB1 GB = 1024 MB
terabyteTB1 TB = 1024 GB

ide when moving to a larger unit. For example, to change 5 MB into KB: 5 × 1024 = 5120 KB.

在单位之间转换时,向更小的单位转换要乘以 1024,向更大的单位转换则除以 1024。例如,将 5 MB 转换为 KB:5 × 1024 = 5120 KB。

Number of smaller units = Number of larger units × 1024

较小单位的数量 = 较大单位的数量 × 1024


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

The size of a plain text file depends on the number of characters and the number of bytes allocated per character. With standard ASCII encoding, each character requires 1 byte (7 or 8 bits). If Unicode is used, a character may occupy 2 bytes or more, but IGCSE typically asks for the simple 1-byte-per-character assumption unless stated otherwise.

纯文本文件的大小取决于字符数量以及每个字符所占的字节数。标准 ASCII 编码中,每个字符需要 1 字节(7 或 8 比特)。如果使用 Unicode,一个字符可能占用 2 字节甚至更多,但 IGCSE 通常假定每个字符占 1 字节,除非题目另有说明。

Text file size (B) = Number of characters × Bytes per character

文本文件大小 (B) = 字符数量 × 每个字符的字节数

00 ASCII characters will have a size of 2000 × 1 = 2000 B, which is approximately 1.95 KB.

示例:一个包含 2000 个 ASCII 字符的文档大小为 2000 × 1 = 2000 B,约等于 1.95 KB。


3. File Size of Sound | 声音文件大小

Uncompressed sound files store the amplitude of the wave at regular intervals. The file size is therefore determined by four factors: the sample rate (how many samples are taken per second, measured in hertz), the bit depth (number of bits used for each sample), the number of audio channels (1 for mono, 2 for stereo), and the duration of the recording in seconds. The product gives the total number of bits; divide by 8 to obtain bytes.

未压缩的声音文件按固定间隔记录声波的幅度。因此,文件大小由四个因素决定:采样率(每秒采样次数,以赫兹为单位)、位深度(每个样本所用的位数)、声道数(单声道为 1,立体声为 2)以及录音时长(以秒为单位)。相乘得到总位数,再除以 8 即可得到字节数。

Sound file size (bits) = Sample rate (Hz) × Bit depth × Number of channels × Duration (s)

声音文件大小 (bit) = 采样率 (Hz) × 位深度 × 声道数 × 时长 (s)

To convert the result into bytes: Sound file size (B) = (Sample rate × Bit depth × Channels × Duration) ÷ 8

将结果转换为字节:声音文件大小 (B) = (采样率 × 位深度 × 声道数 × 时长) ÷ 8

e: 44100 × 16 × 2 × 10 = 14 112 000 bits, which is 1 764 000 bytes, approximately 1.68 MB.

例如,一段 10 秒的立体声录音,采样率 44.1 kHz、位深度 16 位:44100 × 16 × 2 × 10 = 14 112 000 bits,即 1 764 000 字节,约 1.68 MB。


4. File Size of Image | 图像文件大小

Bitmap images are built from a grid of pixels. The information needed to describe the colour of each pixel is the colour depth (bits per pixel). The total number of bits required for an uncompressed image is simply the width in pixels multiplied by the height in pixels multiplied by the colour depth. After calculating the bit total, divide by 8 to express the size in bytes.

位图图像由像素网格构成。描述每个像素颜色所需的信息就是颜色深度(每像素位数)。一幅未压缩图像所需的位数等于像素宽度乘以像素高度再乘以颜色深度。计算出总位数后,除以 8 即可用字节表示大小。

Image file size (bits) = Width (pixels) × Height (pixels) × Colour depth (bits per pixel)

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

size is 800 × 600 × 24 = 11 520 000 bits. Dividing by 8 gives 1 440 000 bytes (≈ 1.37 MB).

若一幅图像分辨率为 800 × 600 且采用 24 位颜色,则大小为 800 × 600 × 24 = 11 520 000 bits。除以 8 得到 1 440 000 字节(约 1.37 MB)。


广告 / Sponsored

5. File Size of Video | 视频文件大小

Video is essentially a sequence of still images (frames) played in rapid succession. The uncompressed file size can be estimated by first calculating the size of a single frame using the image formula, then multiplying by the frame rate (frames per second, fps) and the total duration in seconds. This gives the theoretical maximum size, though real video files are usually compressed.

视频本质上是一系列静止图像(帧)快速连续播放。未压缩的文件大小可以这样估算:先用图像公式计算单帧大小,再乘以帧率(每秒帧数,fps)和总时长(秒)。这样得出的是理论最大值,实际视频文件通常会进行压缩。

Video file size (bits) = Frame size (bits) × Frame rate (fps) × Duration (s)

视频文件大小 (bit) = 帧大小 (bit) × 帧率 (fps) × 时长 (s)

Where the frame size is calculated as Width (pixels) × Height (pixels) × Colour depth (bits per pixel).

其中帧大小计算为 宽度 (像素) × 高度 (像素) × 颜色深度 (每像素位数)。

video: 49 766 400 × 30 × 30 = 44 789 760 000 bits, or roughly 5.22 GB before compression.

以一段 30 秒的视频为例,分辨率 1920 × 1080,24 位颜色,帧率 30 fps。单帧:1920 × 1080 × 24 = 49 766 400 bits。整段视频:49 766 400 × 30 × 30 = 44 789 760 000 bits,压缩前约 5.22 GB。


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

When a file is sent over a network, the time required depends on the file size and the data transfer rate (bandwidth). Bandwidth is usually given in bits per second (bps) or one of its multiples such as Mbps. Make sure the file size is converted to bits if the bandwidth is expressed in bps, then divide the file size by the bandwidth to obtain the transfer time in seconds.

当文件通过网络发送时,所需时间取决于文件大小和数据传输速率(带宽)。带宽通常以每秒比特数(bps)或其倍数(如 Mbps)表示。如果带宽用 bps 表示,应确保文件大小已转换为比特,然后用文件大小除以带宽即可得到以秒为单位的传输时间。

Transfer time (s) = File size (bits) ÷ Bandwidth (bps)

传输时间 (s) = 文件大小 (bit) ÷ 带宽 (bps)

To use bytes instead: Transfer time (s) = File size (B) ÷ (Bandwidth (bps) ÷ 8)

如使用字节:传输时间 (s) = 文件大小 (B) ÷ (带宽 (bps) ÷ 8)

onvert file size to bits: 250 × 1024 × 1024 × 8 = 2 097 152 000 bits. Bandwidth = 100 × 106 bps. Time = 2 097 152 000 ÷ 100 000 000 ≈ 20.97 seconds.

示例:一个 250 MB 的文件通过 100 Mbps 连接传输。先将文件大小转换为比特:250 × 1024 × 1024 × 8 = 2 097 152 000 bits。带宽 = 100 × 10⁶ bps。时间 = 2 097 152 000 ÷ 100 000 000 ≈ 20.97 秒。


7. Compression Ratio | 压缩比

Compression reduces file size by removing redundancy or by representing data more efficiently. The compression ratio compares the original (uncompressed) file size with the compressed file size. A ratio of 4:1 means the original file was four times larger than the compressed version. The formula is straightforward: divide the uncompressed size by the compressed size.

压缩通过消除冗余或以更高效的方式表示数据来减小文件大小。压缩比将原始(未压缩的)文件大小与压缩后的文件大小进行比较。4:1 的压缩比意味着原始文件是压缩文件的四倍。公式很简单:用未压缩大小除以压缩后大小。

Compression ratio = Uncompressed size ÷ Compressed size

压缩比 = 未压缩大小 ÷ 压缩后大小

first convert both to kilobytes: 2048 KB ÷ 500 KB = 4.096. The ratio is approximately 4:1.

两个大小必须使用相同单位。如果一幅图像原本 2 MB,压缩后变为 500 KB,先统一为千字节:2048 KB ÷ 500 KB = 4.096,压缩比约为 4:1。


8. Binary Number Range | 二进制数值范围

With n bits, you can represent exactly 2n different binary patterns. If you are storing unsigned integers, the values go from 0 up to 2n – 1. This explains why an 8-bit unsigned integer has a maximum value of 255 (2⁸ – 1) and a 16-bit unsigned integer can reach 65 535.

使用 n 位二进制,可以表示刚好 2ⁿ 种不同的组合。如果存储的是无符号整数,数值范围是从 0 到 2ⁿ – 1。这解释了为什么 8 位无符号整数的最大值是 255(2⁸ – 1),而 16 位无符号整数可以达到 65 535。

Number of patterns = 2n

组合数 = 2ⁿ

Unsigned range: 0 to 2n – 1

无符号范围:0 到 2ⁿ – 1

When dealing with two's complement representation for signed integers, the range becomes –2(n–1) to 2(n–1) – 1. For instance, an 8-bit signed integer can store values from –128 to 127.

若使用二进制补码表示有符号整数,范围则变为 –2(n–1) 到 2(n–1) – 1。例如,8 位有符号整数可以存储从 –128 到 127 的值。


9. Sampling and Bit Rate | 采样与比特率

The bit rate of an audio stream is the number of bits processed per second. It directly relates to the quality and file size. The bit rate can be calculated from the sample rate, bit depth and number of channels. This value is often used when estimating storage requirements for long recordings or when comparing uncompressed and compressed audio formats.

音频流的比特率是每秒处理的比特数。它直接关系到音质和文件大小。比特率可以根据采样率、位深度和声道数计算出来。在估算长时间录音的存储需求,或比较未压缩与压缩音频格式时,经常会用到这个值。

Bit rate (bps) = Sample rate (Hz) × Bit depth × Number of channels

比特率 (bps) = 采样率 (Hz) × 位深度 × 声道数

pically referred to as 1411 kbps. This is the standard uncompressed bit rate for CD audio.

以 CD 质量的立体声音频为例:44 100 × 16 × 2 = 1 411 200 bps,通常称为 1411 kbps。这是 CD 音频的标准未压缩比特率。


Published by TutorHao | IGCSE Computer Science Revision Series | aleveler.com

广告 / Sponsored
现货 Cambridge International AS & ALevel IT Coursebook剑桥国际IGC…
计算机 备考教辅 · 正版现货 · 与本文内容相关
查看详情 / View on Taobao参考价 ¥467.0

更多咨询请联系16621398022(同微信)

备考资讯每日更新,关注不错过
考纲变化 · 科目分析 · 学习方法
扫码关注公众号 tutorhao
在微信里长按二维码识别关注
或截图后用「扫一扫 → 相册」选择本图
公众号:tutorhao