Year 8 OCR Computer Science: Quick Reference Handbook of Formulas and Theorems | Year 8 OCR 计算机:公式定理速查手册

📚 Year 8 OCR Computer Science: Quick Reference Handbook of Formulas and Theorems | Year 8 OCR 计算机:公式定理速查手册

This quick reference handbook is designed for Year 8 students following the OCR Computer Science curriculum. It brings together all the essential formulas, theorems and conversion tables you need for data representation, Boolean logic, algorithm efficiency and network calculations. Use it to revise key concepts and solve numerical problems with confidence.

本速查手册专为学习OCR计算机课程的Year 8学生编写。它汇集了数据表示、布尔逻辑、算法效率和网络计算中所有必需的公式、定理和换算表。用它来复习核心概念,自信地解决数值问题。


1. Data Units and Conversions | 数据单位与转换

Computers store all data as sequences of bits. A single bit can be 0 or 1. The fundamental units and their relationships are shown in the table below. When converting between units, always multiply or divide by 1024 (2¹⁰), not 1000, because memory is addressed in powers of two.

计算机将所有数据存储为二进制位序列。一个位可以是0或1。基本单位及其关系如下表所示。在单位之间转换时,始终乘以或除以1024(2¹⁰),而不是1000,因为内存以2的幂进行寻址。

Unit Abbreviation Equivalent
Bit b 0 or 1
Byte B 8 bits
Kilobyte KB 1024 bytes
Megabyte MB 1024 KB
Gigabyte GB 1024 MB
Terabyte TB 1024 GB

To convert a larger unit to a smaller unit, multiply by 1024 for each step. For example, 5 MB to bytes: 5 × 1024 × 1024 = 5,242,880 bytes. To convert from bytes to a larger unit, divide repeatedly by 1024.

将较大单位转换为较小单位时,每步乘以1024。例如,5 MB转换为字节:5 × 1024 × 1024 = 5,242,880 B。将字节转换为较大单位时,连续除以1024。


2. Binary and Denary Conversions | 二进制与十进制转换

Binary is a base-2 number system using only 0 and 1. Denary (decimal) is base-10. To convert an 8-bit binary number to denary, draw a place value table with headings 128, 64, 32, 16, 8, 4, 2, 1. Add the headings wherever a 1 appears. For example, binary 01001101 equals 64 + 8 + 4 + 1 = 77 in denary.

二进制是以2为基的数制,只用0和1。十进制是以10为基的数制。要将8位二进制数转换为十进制,画一个位值表,表头为128, 64, 32, 16, 8, 4, 2, 1。在出现1的位上累加表头的值。例如,二进制01001101等于64 + 8 + 4 + 1 = 77(十进制)。

To convert denary to binary, repeatedly divide by 2 and record the remainders. Read the remainders from bottom to top to obtain the binary equivalent. Alternatively, subtract the largest possible place value until you reach zero, inserting a 1 for each value you use and 0 for those you skip.

将十进制转换为二进制,反复除以2并记录余数。从下往上读余数,即得二进制数。另一种方法,依次减去可能的最大位值,直至为零,使用到的位写1,跳过位写0。

Denary value = Σ (binary digit × 2position)

十进制值 = Σ (二进制数位 × 2位权)


3. Hexadecimal Basics | 十六进制基础

Hexadecimal (hex) is base-16 and uses digits 0-9 and letters A-F (A=10, B=11, C=12, D=13, E=14, F=15). It provides a shorter way to represent long binary numbers. Each hex digit corresponds to exactly 4 bits (a nibble).

十六进制是以16为基的数制,使用数字0-9和字母A-F(A=10, B=11, C=12, D=13, E=14, F=15)。它为表示长二进制数提供了更简短的方式。每个十六进制位恰好对应4个二进制位(半个字节)。

To convert binary to hex, split the binary number into groups of four bits from the right, then convert each group into its hex equivalent. For example, 110110102 becomes 1101 1010, which is D A in hex, written as DA16. To convert hex to denary, first write the hex digits with place values of 161, 160, etc.

将二进制转换为十六进制时,从右向左每4位分组,然后将每组转换为对应的十六进制字符。例如,110110102分为1101和1010,即十六进制的D和A,写作DA16。将十六进制转换为十进制时,先写出每位按16的幂次加权。


4. Text Representation: ASCII | 文本表示:ASCII

ASCII (American Standard Code for Information Interchange) uses 7 bits to represent 128 characters, including uppercase and lowercase letters, digits, punctuation and control codes. Each character is assigned a unique decimal number. For instance, ‘A’ = 65, ‘a’ = 97, ‘0’ = 48, and space = 32.

ASCII(美国信息交换标准代码)用7位二进制表示128个字符,包括大小写字母、数字、标点符号和控制代码。每个字符分配了唯一十进制编号。例如,’A’ = 65,’a’ = 97,’0′ = 48,空格 = 32。

Extended ASCII uses 8 bits, allowing 256 characters. When storing text, each character is converted to its binary ASCII code. The size of a plain text file in bytes equals the number of characters if no extra formatting is included.

扩展ASCII使用8位,可表示256个字符。存储文本时,每个字符被转换为其二进制ASCII码。如果没有额外格式,纯文本文件的大小(字节)等于字符数量。


5. Image File Size Formula | 图像文件大小公式

A bitmap image is made up of a grid of pixels. The colour depth is the number of bits used to represent the colour of each pixel. The file size of an uncompressed bitmap can be calculated using the formula below. Remember to divide by 8 to convert bits to bytes.

位图图像由像素网格组成。颜色深度是用于表示每个像素颜色的位数。未压缩位图的文件大小可用以下公式计算。记住除以8以将位转换为字节。

File Size (bytes) = (Image Width × Image Height × Colour Depth) / 8

文件大小(字节)= (图像宽度 × 图像高度 × 颜色深度) / 8

To express the result in KB, divide by 1024. For example, a 300 × 200 pixel image with a 24-bit colour depth requires (300 × 200 × 24) / 8 = 180,000 bytes, which is approximately 175.8 KB when divided by 1024.

要以KB为单位表示,再除以1024。例如,一个300 × 200像素、24位颜色深度的图像需要 (300 × 200 × 24) / 8 = 180,000 字节,除以1024后约为175.8 KB。

Colour depth directly determines the number of available colours: Number of colours = 2colour depth. A 1-bit image can display 2 colours (black and white), 8-bit gives 256 colours, and 24-bit gives over 16 million colours.

颜色深度直接决定了可用颜色数:颜色数 = 2颜色深度。1位图像可显示2种颜色(黑白),8位显示256色,24位可显示超过1600万色。


6. Sound File Size Formula | 声音文件大小公式

Sound is represented digitally by sampling the analogue wave at regular intervals. The key parameters are sample rate (measured in Hz), bit depth (bits per sample), number of channels (1 for mono, 2 for stereo) and duration in seconds. The file size for uncompressed audio is calculated as shown.

声音通过定期对模拟波形采样来数字表示。关键参数是采样率(单位Hz)、位深度(每样本位数)、声道数(1=单声道,2=立体声)和时长(秒)。未压缩音频的文件大小计算如下。

File Size (bits) = Sample Rate × Bit Depth × Duration (s) × Number of Channels

文件大小(位)= 采样率 × 位深度 × 时长(秒)× 声道数

To obtain the file size in bytes, divide by 8. For KB, divide by (8 × 1024). For example, a 10-second stereo recording at 44,100 Hz with 16-bit depth uses 44,100 × 16 × 10 × 2 = 14,112,000 bits, which equals 1,764,000 bytes or about 1.72 MB.

要得到以字节为单位的文件大小,除以8。要得到KB,除以 (8 × 1024)。例如,一段10秒、44,100 Hz、16位深度立体声录音占用 44,100 × 16 × 10 × 2 = 14,112,000 位,等于1,764,000字节,约1.72 MB。


7. Logic Gates and Truth Tables | 逻辑门与真值表

Logic gates are the building blocks of digital circuits. The basic gates you need to know are NOT, AND, OR, NAND, NOR and XOR. Each gate has a defined truth table showing the output for every possible input combination. Inputs and outputs are binary: 0 (False) or 1 (True).

逻辑门是数字电路的构建块。你需要了解的基本门有非门、与门、或门、与非门、或非门和异或门。每个门都有确定的真值表,展示每种可能输入组合下的输出。输入和输出都是二进制的:0(假)或1(真)。

Gate Symbol Truth Table
NOT ¬A or A’ A=0 → 1; A=1 → 0
AND A ∧ B 0∧0=0; 0∧1=0; 1∧0=0; 1∧1=1
OR A ∨ B 0∨0=0; 0∨1=1; 1∨0=1; 1∨1=1
NAND ¬(A ∧ B) 0∧0→1; 0∧1→1; 1∧0→1; 1∧1→0
NOR ¬(A ∨ B) 0∨0→1; 0∨1→0; 1∨0→0; 1∨1→0
XOR A ⊕ B 0⊕0=0; 0⊕1=1; 1⊕0=1; 1⊕1=0

A NAND gate is a universal gate, meaning any other logic function can be built using only NAND gates. Similarly, NOR gates are also universal. Understanding truth tables is essential for simplifying digital circuits and writing Boolean expressions.

与非门是一种通用门,意味着仅用与非门就可以构建任何其他逻辑功能。类似地,或非门也是通用门。理解真值表对于简化数字电路和编写布尔表达式至关重要。


8. Boolean Algebra Theorems | 布尔代数定理

Boolean algebra provides a mathematical method for simplifying logic expressions. The fundamental identities and theorems are listed below. They help reduce the number of logic gates required, saving cost and power. Here A, B, and C represent Boolean variables (0 or 1).

布尔代数为化简逻辑表达式提供了数学方法。基本恒等式和定理如下所示。它们有助于减少所需逻辑门的数量,从而节省成本和功耗。这里A、B和C代表布尔变量(0或1)。

Commutative Law / 交换律: A ∧ B = B ∧ A; A ∨ B = B ∨ A

Associative Law / 结合律: (A ∧ B) ∧ C = A ∧ (B ∧ C); (A ∨ B) ∨ C = A ∨ (B ∨ C)

Distributive Law / 分配律: A ∧ (B ∨ C) = (A ∧ B) ∨ (A ∧ C); A ∨ (B ∧ C) = (A ∨ B) ∧ (A ∨ C)

Identity Law / 同一律: A ∧ 1 = A; A ∨ 0 = A

Complement Law / 互补律: A ∧ ¬A = 0; A ∨ ¬A = 1

De Morgan’s Theorems / 德摩根定理:

¬(A ∧ B) = ¬A ∨ ¬B

¬(A ∨ B) = ¬A ∧ ¬B

These theorems allow you to push negations inward and convert between AND and OR forms. For example, the expression ¬(A ∧ B) can be implemented using an OR gate with inverted inputs, which is very common in circuit design.

这些定理允许你将否定推入内部并在与和或形式之间转换。例如,表达式 ¬(A ∧ B) 可以使用带反相输入的或门来实现,这在电路设计中非常常见。


9. Algorithm Efficiency: Linear vs Binary Search | 算法效率:线性搜索与二分搜索

Searching algorithms are compared by the maximum number of comparisons they might need for a sorted list of n items. A linear search checks each item one by one and may need up to n comparisons. A binary search repeatedly divides the list in half; its worst-case number of comparisons grows very slowly as n increases.

搜索算法的比较依据是对含有n个元素的已排序列表进行查找时可能需要的最大比较次数。线性搜索逐个检查每一项,最多可能需要n次比较。二分搜索反复将列表对半分;其最坏情况下的比较次数随n增长得非常缓慢。

Linear Search max comparisons = n

线性搜索最大比较次数 = n

Binary Search max comparisons ≈ ⌈log₂(n+1)⌉

二分搜索最大比较次数 ≈ ⌈log₂(n+1)⌉

For example, with 1000 items, linear search may need 1000 comparisons, while binary search needs at most about 10 comparisons because 2¹⁰ = 1024. This logarithmic efficiency makes binary search dramatically faster for large lists, but it requires the list to be sorted first.

例如,有1000个元素时,线性搜索可能需要1000次比较,而二分搜索最多只需约10次比较,因为2¹⁰ = 1024。这种对数级效率使二分搜索对于大列表快得多,但它要求列表首先已排序。


10. Network Data Transfer Time | 网络数据传输时间

When sending a file across a network, the transfer time depends on the size of the file and the bandwidth (transfer rate) of the connection. The fundamental formula relates these quantities. Always ensure that file size is in bits and the transfer rate is in bits per second (bps) before calculating.

通过网络发送文件时,传输时间取决于文件大小和连接的带宽(传输速率)。基本公式关联了这些量。计算前务必确保文件大小单位为位,传输速率单位为位每秒(bps)。

Transfer Time (seconds) = File Size (bits) / Bandwidth (bps)

传输时间(秒)= 文件大小(位)/ 带宽(bps)

To work out the file size in bits, multiply the size in bytes by 8. Common bandwidth units include Kbps, Mbps and Gbps. For example, to send 10 MB over a 50 Mbps connection: file size = 10 × 1024 × 1024 × 8 = 83,886,080 bits; time = 83,886,080 / 50,000,000 ≈ 1.68 seconds.

要计算以位为单位的文件大小,将字节数乘以8。常见带宽单位有Kbps、Mbps和Gbps。例如,通过50 Mbps连接发送10 MB文件:文件大小 = 10 × 1024 × 1024 × 8 = 83,886,080 位;时间 = 83,886,080 / 50,000,000 ≈ 1.68秒。

Factors such as network congestion and protocol overhead can increase the actual transfer time, but the formula gives a theoretical minimum under ideal conditions.

网络拥塞和协议开销等因素会增加实际传输时间,但该公式给出了理想条件下的理论最小值。


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