📚 KS3 OCR Computer Science Formula & Theorem Quick Reference Handbook | KS3 OCR 计算机科学公式定理速查手册
This comprehensive quick reference handbook is designed for KS3 students following the OCR Computer Science curriculum. It consolidates all the essential formulas, theorems, conversion rules, and calculation methods you need to master the fundamentals of computing. From binary arithmetic to file size estimation, from Boolean logic to search algorithms, every key concept is presented in clear paired explanations. Use this guide to revise efficiently and build confidence for your assessments in Key Stage 3 Computer Science.
这本全面的速查手册专为学习 OCR 计算机科学课程的 KS3 学生设计。它汇集了所有你需要掌握计算机基础的关键公式、定理、转换规则和计算方法。从二进制算术到文件大小估算,从布尔逻辑到搜索算法,每个核心概念都以清晰的中英对照解释呈现。使用本指南高效复习,为你的 KS3 计算机科学评估建立信心。
1. Binary to Denary Conversion | 二进制转十进制转换
To convert an 8-bit binary number to its denary (decimal) equivalent, multiply each bit by its corresponding place value, which is a power of 2. The rightmost bit (least significant bit, LSB) has a place value of 2⁰ = 1, and the leftmost bit (most significant bit, MSB) has a place value of 2⁷ = 128. Sum all the products to obtain the final denary number. The place values from left to right are: 128, 64, 32, 16, 8, 4, 2, 1.
要将一个 8 位二进制数转换为对应的十进制数,需要将每一位乘以相应的位权重(即 2 的幂)。最右边的位(最低有效位,LSB)的位权重为 2⁰ = 1,最左边的位(最高有效位,MSB)的位权重为 2⁷ = 128。将所有乘积相加即可得到最终的十进制数。从左到右的位权重依次为:128、64、32、16、8、4、2、1。
Denary Value = d₇ × 128 + d₆ × 64 + d₅ × 32 + d₄ × 16 + d₃ × 8 + d₂ × 4 + d₁ × 2 + d₀ × 1
For example, the binary number 01101001 is converted as: (0×128) + (1×64) + (1×32) + (0×16) + (1×8) + (0×4) + (0×2) + (1×1) = 0 + 64 + 32 + 0 + 8 + 0 + 0 + 1 = 105. The denary value is therefore 105. This method works for any binary number up to 8 bits in length, covering the denary range from 0 to 255 inclusive.
例如,二进制数 01101001 的转换过程为:(0×128) + (1×64) + (1×32) + (0×16) + (1×8) + (0×4) + (0×2) + (1×1) = 0 + 64 + 32 + 0 + 8 + 0 + 0 + 1 = 105。因此十进制值为 105。此方法适用于任何长度不超过 8 位的二进制数,覆盖从 0 到 255(含)的十进制范围。
2. Denary to Binary Conversion | 十进制转二进制转换
To convert a denary number into binary, use the successive division by 2 method (also known as the short division method). Repeatedly divide the denary number by 2, recording the remainder each time. Continue dividing until the quotient becomes 0. The binary equivalent is formed by reading the remainders from the bottom upwards (the last remainder obtained is the most significant bit). Alternatively, you can use the place value subtraction method: compare the denary number with the largest binary place value (128 for 8-bit), and place a 1 under each place value that fits, subtracting that value from the running total.
要将十进制数转换为二进制,可使用连续除以 2 的方法(也称为短除法)。反复将十进制数除以 2,每次记录余数。继续相除直到商变为 0。从下往上读取余数(最后得到的余数为最高有效位),即可形成对应的二进制数。或者,你也可以使用位权重减法:将十进制数与最大的二进制位权重(8 位时为 128)进行比较,在每个能够容纳的位权重下放置 1,并从运行总数中减去该值。
Divide by 2 repeatedly → Read remainders from bottom to top
Example using the division method: Convert 105 to binary. 105 ÷ 2 = 52 remainder 1; 52 ÷ 2 = 26 remainder 0; 26 ÷ 2 = 13 remainder 0; 13 ÷ 2 = 6 remainder 1; 6 ÷ 2 = 3 remainder 0; 3 ÷ 2 = 1 remainder 1; 1 ÷ 2 = 0 remainder 1. Reading remainders from bottom: 1101001. As an 8-bit number, pad with a leading zero to give 01101001. Using the place value method: 105 – 64 = 41 (place 1 at 64), 41 – 32 = 9 (place 1 at 32), 9 – 8 = 1 (place 1 at 8), 1 – 1 = 0 (place 1 at 1), and place 0 elsewhere, yielding 01101001.
以除法为例:将 105 转换为二进制。105 ÷ 2 = 52 余 1;52 ÷ 2 = 26 余 0;26 ÷ 2 = 13 余 0;13 ÷ 2 = 6 余 1;6 ÷ 2 = 3 余 0;3 ÷ 2 = 1 余 1;1 ÷ 2 = 0 余 1。从下往上读取余数:1101001。作为 8 位二进制数,在前面补零得到 01101001。使用位权重法:105 – 64 = 41(在 64 处置 1),41 – 32 = 9(在 32 处置 1),9 – 8 = 1(在 8 处置 1),1 – 1 = 0(在 1 处置 1),其余位置 0,同样得到 01101001。
3. Binary Addition Rules | 二进制加法规则
Binary addition follows four fundamental rules that mirror denary addition but operate in base 2. The rules are: 0 + 0 = 0; 0 + 1 = 1; 1 + 0 = 1; and 1 + 1 = 0 with a carry of 1 to the next column (this is equivalent to the denary 2, which is written as 10 in binary). When three 1s are added in a column (two bits plus a carry-in), the result is 1 with a carry of 1 (since 1 + 1 + 1 = 3, and 3 in binary is 11). Work from right to left, column by column, writing the sum bit and passing any carry to the next left column.
二进制加法遵循四条基本规则,与十进制加法相似,但以 2 为基数进行运算。规则为:0 + 0 = 0;0 + 1 = 1;1 + 0 = 1;1 + 1 = 0 并向下一列进位 1(这相当于十进制中的 2,在二进制中写作 10)。当一列中有三个 1 相加时(两个位加上一个进位输入),结果为 1 并进位 1(因为 1 + 1 + 1 = 3,而 3 的二进制表示为 11)。从右向左逐列进行,写下和位并将任何进位传递给左边的下一列。
0+0=0 | 0+1=1 | 1+0=1 | 1+1=0 (carry 1) | 1+1+1=1 (carry 1)
An overflow error occurs when the result of an 8-bit binary addition exceeds 255 (the maximum value representable with 8 bits). In such cases, a 9th bit is required for the correct result, but since the computer only allocates 8 bits of storage, the carry out from the most significant bit is lost, and the stored result is incorrect. For example, adding 11111111 (255) and 00000001 (1) produces 1 00000000 in 9 bits, but stored as 00000000 in 8 bits — a classic overflow scenario.
当 8 位二进制加法的结果超过 255(8 位所能表示的最大值)时,就会发生溢出错误。在这种情况下,正确结果需要第 9 位,但由于计算机只分配了 8 位存储空间,最高有效位的进位输出会丢失,存储的结果因此不正确。例如,将 11111111(255)与 00000001(1)相加,9 位结果为 1 00000000,但以 8 位存储时变为 00000000——这是一个典型的溢出场景。
4. Hexadecimal Conversion | 十六进制转换
Hexadecimal (base 16) provides a compact way to represent binary values. Each hex digit corresponds to exactly 4 bits (a nibble). The digits 0-9 represent their usual denary values, while A, B, C, D, E, and F represent the denary values 10, 11, 12, 13, 14, and 15 respectively. To convert an 8-bit binary number to hexadecimal, split the binary into two nibbles (groups of 4 bits), convert each nibble to its denary equivalent, and then map that value to the corresponding hex digit. For example, 01101001 splits into 0110 (denary 6, hex 6) and 1001 (denary 9, hex 9), giving the hex value 69.
十六进制(基数为 16)提供了一种紧凑的方式来表示二进制值。每个十六进制数字恰好对应 4 位(一个半字节)。数字 0-9 代表其通常的十进制值,而 A、B、C、D、E 和 F 分别代表十进制值 10、11、12、13、14 和 15。要将一个 8 位二进制数转换为十六进制,将二进制分成两个半字节(每组 4 位),将每个半字节转换为其十进制等效值,然后将该值映射到相应的十六进制数字。例如,01101001 分为 0110(十进制 6,十六进制 6)和 1001(十进制 9,十六进制 9),得到十六进制值 69。
Binary → Nibbles → Denary → Hex digit | A=10, B=11, C=12, D=13, E=14, F=15
To convert from hexadecimal to denary, multiply each hex digit by the appropriate power of 16. The rightmost digit has place value 16⁰ = 1, and the next digit to the left has place value 16¹ = 16. For a two-digit hex number such as 3F, the calculation is: (3 × 16) + (15 × 1) = 48 + 15 = 63. To convert denary to hex, repeatedly divide by 16 and record the remainders, converting any remainders greater than 9 into the letters A-F as needed. Read the remainders from bottom to top to form the hex number.
要将十六进制转换为十进制,将每个十六进制数字乘以相应的 16 的幂。最右边的数字位权重为 16⁰ = 1,左边下一位的位权重为 16¹ = 16。对于一个两位的十六进制数如 3F,计算过程为:(3 × 16) + (15 × 1) = 48 + 15 = 63。要将十进制转换为十六进制,反复除以 16 并记录余数,根据需要将大于 9 的余数转换为字母 A-F。从下往上读取余数即可形成十六进制数。
5. Data Size Units | 数据大小单位
Digital data is measured using a hierarchical system of units based on the bit, the smallest unit of data capable of storing a single binary value (0 or 1). Understanding these units and their relationships is essential for calculating file sizes, storage capacities, and data transfer requirements. The key units, in ascending order, are: bit (b), nibble (4 bits), byte (B, 8 bits), kilobyte (KB, 1024 bytes), megabyte (MB, 1024 KB), gigabyte (GB, 1024 MB), and terabyte (TB, 1024 GB). Note that in computing, the multiplier between units is 1024 (2¹⁰), not 1000, although some storage manufacturers use decimal (1000-based) measurements for marketing purposes.
数字数据使用基于比特的分层单位系统来衡量,比特是能够存储单个二进制值(0 或 1)的最小数据单位。理解这些单位及其关系对于计算文件大小、存储容量和数据传输需求至关重要。按升序排列的关键单位有:比特(b)、半字节(4 比特)、字节(B,8 比特)、千字节(KB,1024 字节)、兆字节(MB,1024 KB)、吉字节(GB,1024 MB)和太字节(TB,1024 GB)。请注意,在计算领域中,单位之间的乘数是 1024(即 2¹⁰),而非 1000,尽管一些存储制造商出于营销目的使用十进制(基于 1000)的度量方式。
1 byte = 8 bits | 1 KB = 1024 B | 1 MB = 1024 KB | 1 GB = 1024 MB | 1 TB = 1024 GB
When performing calculations involving data sizes, always ensure that all values are expressed in the same unit before applying any formula. For instance, when calculating the number of bytes in a 5 MB file: 5 × 1024 × 1024 = 5,242,880 bytes. A common exam requirement is to convert between bits and bytes accurately — multiply by 8 when converting bytes to bits, and divide by 8 when converting bits to bytes. The nibble, though less frequently used in modern contexts, remains a useful concept for understanding hexadecimal digits, each of which exactly fills one nibble.
在进行涉及数据大小的计算时,在应用任何公式之前,务必确保所有值都使用相同的单位。例如,计算一个 5 MB 文件中的字节数:5 × 1024 × 1024 = 5,242,880 字节。考试中常见的要求是准确地在比特和字节之间进行转换——从字节转换为比特时乘以 8,从比特转换为字节时除以 8。半字节虽然在现代语境中使用较少,但对于理解十六进制数字(每个十六进制数字恰好填满一个半字节)仍然是一个有用的概念。
6. Image File Size Calculation | 图像文件大小计算
The file size of a bitmap image depends on three factors: the image width in pixels, the image height in pixels, and the colour depth (the number of bits used to represent the colour of each pixel). The total number of pixels is obtained by multiplying width by height. Each pixel requires a certain number of bits determined by the colour depth. For example, a colour depth of 24 bits (often called true colour) allows 2²⁴ (approximately 16.7 million) different colours per pixel. The formula for image file size in bytes is: File Size (bytes) = (Width × Height × Colour Depth in bits) ÷ 8. The result is typically expressed in bytes, then converted to larger units (KB, MB) as needed by dividing by 1024 repeatedly.
位图图像的文件大小取决于三个因素:图像的像素宽度、像素高度和色深(用于表示每个像素颜色的位数)。像素总数由宽度乘以高度得出。每个像素所需的位数由色深决定。例如,24 位色深(通常称为真彩色)允许每个像素有 2²⁴(约 1670 万)种不同的颜色。图像文件大小(以字节为单位)的计算公式为:文件大小(字节)=(宽度 × 高度 × 色深,以位为单位)÷ 8。结果通常以字节表示,然后根据需要除以 1024 逐步转换为更大的单位(KB、MB)。
Image File Size (bytes) = (Width in pixels × Height in pixels × Colour Depth in bits) ÷ 8
Example calculation: A bitmap image has dimensions 800 × 600 pixels and uses a colour depth of 24 bits. Total pixels = 800 × 600 = 480,000. Total bits = 480,000 × 24 = 11,520,000 bits. File size in bytes = 11,520,000 ÷ 8 = 1,440,000 bytes. Converting to MB: 1,440,000 ÷ 1024 ≈ 1406.25 KB, and 1406.25 ÷ 1024 ≈ 1.37 MB. This formula helps explain why higher resolution images and greater colour depths produce larger file sizes, and is fundamental to understanding digital image storage requirements.
计算示例:一张位图图像尺寸为 800 × 600 像素,色深为 24 位。总像素数 = 800 × 600 = 480,000。总位数 = 480,000 × 24 = 11,520,000 位。文件大小(字节)= 11,520,000 ÷ 8 = 1,440,000 字节。转换为 MB:1,440,000 ÷ 1024 ≈ 1406.25 KB,1406.25 ÷ 1024 ≈ 1.37 MB。这个公式有助于解释为什么更高分辨率的图像和更大的色深会产生更大的文件大小,是理解数字图像存储需求的基础。
7. Sound File Size Calculation | 声音文件大小计算
Digital sound is captured by sampling the amplitude of an analogue sound wave at regular intervals. The file size of an uncompressed audio recording is determined by four parameters: the sample rate (number of samples taken per second, measured in hertz, Hz), the bit depth (number of bits used to store each sample), the number of channels (1 for mono, 2 for stereo), and the duration of the recording in seconds. The formula for calculating the file size in bytes is: File Size (bytes) = (Sample Rate × Bit Depth × Number of Channels × Duration in seconds) ÷ 8. Higher sample rates and greater bit depths produce more accurate digital representations of the original sound but result in larger file sizes.
数字声音是通过以固定间隔对模拟声波的振幅进行采样来捕获的。未压缩音频录音的文件大小由四个参数决定:采样率(每秒采集的样本数,以赫兹 Hz 为单位)、位深度(用于存储每个样本的位数)、声道数(单声道为 1,立体声为 2)以及录音时长(以秒为单位)。文件大小(以字节为单位)的计算公式为:文件大小(字节)=(采样率 × 位深度 × 声道数 × 时长,以秒为单位)÷ 8。更高的采样率和更大的位深度能产生更准确的原声数字表示,但会导致文件大小更大。
Sound File Size (bytes) = (Sample Rate × Bit Depth × Channels × Duration) ÷ 8
Consider a 30-second stereo audio clip recorded at a sample rate of 44,100 Hz (CD quality) with a bit depth of 16 bits. Using the formula: 44,100 × 16 × 2 × 30 = 42,336,000 bits. Dividing by 8 gives 5,292,000 bytes, which is approximately 5.05 MB. Common sample rates in computing include 44.1 kHz (CD standard) and 48 kHz (DVD and professional audio). Typical bit depths are 16 bits (CD quality) and 24 bits (studio quality). Understanding this formula allows you to estimate storage requirements for audio projects and compare the impact of different quality settings on file sizes.
假设有一段 30 秒的立体声音频剪辑,以 44,100 Hz 的采样率(CD 品质)和 16 位的位深度录制。使用公式:44,100 × 16 × 2 × 30 = 42,336,000 位。除以 8 得到 5,292,000 字节,约 5.05 MB。计算中常见的采样率有 44.1 kHz(CD 标准)和 48 kHz(DVD 和专业音频)。典型的位深度为 16 位(CD 品质)和 24 位(录音室品质)。理解这个公式可以帮助你估算音频项目的存储需求,并比较不同质量设置对文件大小的影响。
8. Network Data Transfer Time | 网络数据传输时间
The time required to transfer a file across a network depends on the size of the file and the speed (bandwidth) of the network connection. The fundamental formula is: Transfer Time (seconds) = Data Size ÷ Transfer Rate. It is crucial that both quantities use consistent units. Typically, file sizes are given in bytes, kilobytes, megabytes, or gigabytes, while network speeds are expressed in bits per second (bps), kilobits per second (kbps), megabits per second (Mbps), or gigabits per second (Gbps). You must convert file sizes to bits (multiply bytes by 8) or convert the transfer rate to bytes per second (divide bps by 8) before applying the formula to avoid unit mismatch errors.
通过网络传输文件所需的时间取决于文件的大小和网络连接的速度(带宽)。基本公式为:传输时间(秒)= 数据大小 ÷ 传输速率。关键在于两个量必须使用一致的单位。通常,文件大小以字节、千字节、兆字节或吉字节给出,而网络速度以比特每秒(bps)、千比特每秒(kbps)、兆比特每秒(Mbps)或吉比特每秒(Gbps)表示。在应用公式之前,必须将文件大小转换为比特(将字节乘以 8),或将传输速率转换为字节每秒(将 bps 除以 8),以避免单位不匹配的错误。
Transfer Time (s) = Data Size (bits) ÷ Transfer Rate (bps) | 1 byte = 8 bits
Example: Calculate the time to download a 50 MB file over a 10 Mbps connection. First, convert 50 MB to bits: 50 × 1024 × 1024 × 8 = 419,430,400 bits. Next, convert 10 Mbps to bps: 10 × 1,000,000 = 10,000,000 bps (note that network speeds conventionally use decimal multipliers). Transfer time = 419,430,400 ÷ 10,000,000 ≈ 41.94 seconds. In practice, actual transfer times are often longer due to network overheads, latency, and protocol inefficiencies. This formula provides a theoretical best-case estimate and is widely used in exam scenarios.
示例:计算通过 10 Mbps 连接下载一个 50 MB 文件所需的时间。首先,将 50 MB 转换为比特:50 × 1024 × 1024 × 8 = 419,430,400 比特。接着,将 10 Mbps 转换为 bps:10 × 1,000,000 = 10,000,000 bps(注意,网络速度通常使用十进制乘数)。传输时间 = 419,430,400 ÷ 10,000,000 ≈ 41.94 秒。实际上,由于网络开销、延迟和协议效率等因素,实际传输时间通常更长。这个公式提供了一个理论上的最佳情况估算,并在考试场景中被广泛使用。
9. Boolean Logic Truth Tables | 布尔逻辑真值表
Boolean logic forms the mathematical foundation of digital circuit design and computer programming. It operates on binary variables that can only take the values TRUE (1) or FALSE (0). The three fundamental Boolean operations are NOT, AND, and OR. The NOT operator is a unary operator that inverts its input: NOT 0 = 1 and NOT 1 = 0. The AND operator returns TRUE only when both inputs are TRUE. The OR operator returns TRUE when at least one input is TRUE. Truth tables systematically list all possible input combinations and their corresponding outputs, serving as the definitive reference for each logical operator.
布尔逻辑构成了数字电路设计和计算机编程的数学基础。它处理只能取 TRUE(1)或 FALSE(0)值的二进制变量。三种基本的布尔运算是 NOT、AND 和 OR。NOT 运算符是一元运算符,用于反转其输入:NOT 0 = 1,NOT 1 = 0。AND 运算符仅在两个输入都为 TRUE 时才返回 TRUE。OR 运算符在至少一个输入为 TRUE 时返回 TRUE。真值表系统地列出了所有可能的输入组合及其对应的输出,作为每个逻辑运算符的权威参考。
| NOT Gate Truth Table | NOT 门真值表 | |
|---|---|
| Input A | Output (NOT A) |
| 0 | 1 |
| 1 | 0 |
| AND Gate Truth Table | AND 门真值表 | ||
|---|---|---|
| Input A | Input B | Output (A AND B) |
| 0 | 0 | 0 |
| 0 | 1 |
🛒
CASIO fx-991CN X 科学计算器
¥168
预估佣金 ¥5.88(3.5%)
📱 去京东购买
jd_prepop · 京东返佣
更多咨询请联系16621398022(同微信) CommentsMore posts |
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply