Year 8 SQA Computer Science: Formula & Theorem Quick Reference Handbook | Year 8 SQA 计算机:公式定理速查手册

📚 Year 8 SQA Computer Science: Formula & Theorem Quick Reference Handbook | Year 8 SQA 计算机:公式定理速查手册

This quick reference handbook brings together the essential formulas, conversions, and Boolean theorems you will encounter in Year 8 SQA Computer Science. Use it to revise data representation, file size calculations, binary‑hexadecimal systems, and core logic rules. Every formula is presented with a plain‑English explanation followed by its Chinese counterpart to support bilingual learners.

本速查手册汇集了 Year 8 SQA 计算机科学中你会遇到的关键公式、换算方法和布尔逻辑定理。用它来复习数据表示、文件大小计算、二进制与十六进制体系以及核心逻辑规则。每条公式都配有英文讲解和对应的中文说明,以满足双语学习需求。


1. Data Units Conversion | 数据单位换算

Digital data is measured in bits and bytes. The smallest unit is the binary digit (bit). Eight bits form one byte. Conversions between bits and bytes follow the rule below.

bytes = bits ÷ 8

bits = bytes × 8

数字数据以比特和字节为衡量单位。最小的单位是二进制位(比特)。八个比特组成一个字节。比特与字节的转换遵循以下规则。

For larger storage capacities, computer systems use binary prefixes based on powers of two. A kilobyte is 2¹⁰ bytes, a megabyte is 2²⁰ bytes, and a gigabyte is 2³⁰ bytes.

1 KB = 2¹⁰ bytes = 1024 bytes

1 MB = 2²⁰ bytes = 1 048 576 bytes

对于更大的存储容量,计算机系统采用基于 2 的幂次的二进制前缀。千字节 (KB) 等于 2¹⁰ 字节,兆字节 (MB) 等于 2²⁰ 字节,吉字节 (GB) 等于 2³⁰ 字节。


2. File Size Calculation for Text | 文本文件大小计算

The storage size of a plain text file depends on the number of characters and the encoding scheme. In standard ASCII, each character occupies exactly 1 byte. The formula is therefore very straightforward.

File size (bytes) = number of characters × 1

纯文本文件的存储大小取决于字符数量和编码方案。在标准 ASCII 编码中,每个字符恰好占用 1 个字节。因此计算公式非常简单。

If Unicode UTF‑8 is used, English letters and numbers still use 1 byte, but many symbols and non‑Latin scripts may need 2 or more bytes. For Year 8, you can assume 1 byte per character unless told otherwise.

若采用 Unicode UTF‑8 编码,英文字母和数字仍占用 1 字节,但许多符号和非拉丁文字可能需要 2 个或更多字节。在 Year 8 阶段,除非另有说明,通常假定每个字符占用 1 字节。


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

An uncompressed bitmap image is described by its width and height in pixels, and the colour depth (the number of bits used to store the colour of one pixel). The total file size in bits is the product of these three values. To convert to bytes, divide by 8.

Image size (bits) = width (px) × height (px) × colour depth (bpp)

Image size (bytes) = (width × height × colour depth) ÷ 8

未压缩的位图图像由其宽度(像素数)、高度(像素数)和颜色深度(表示单个像素颜色的比特数)描述。总文件大小(比特)是这三个值的乘积。要转换为字节,需除以 8。

For example, a 100×100 pixel image with a colour depth of 24 bits per pixel needs 100 × 100 × 24 = 240 000 bits, or 30 000 bytes.

例如,一幅 100×100 像素、颜色深度为 24 比特的图像需要 100 × 100 × 24 = 240 000 比特,即 30 000 字节。


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

Digital audio is captured by taking samples of the sound wave at regular intervals. The file size (in bits) depends on the sample rate, the sample resolution (bits per sample), the number of channels, and the duration in seconds.

Sound size (bits) = sample rate (Hz) × sample resolution (bits) × channels × duration (s)

数字音频是通过对声波进行等间隔采样而获得的。文件大小(比特)取决于采样率、采样分辨率(每样本的比特数)、声道数和以秒为单位的持续时间。

For a stereo recording (2 channels) of 10 seconds, with a sample rate of 44 100 Hz and 16‑bit resolution, the calculation gives 44 100 × 16 × 2 × 10 = 14 112 000 bits. Divide by 8 to obtain bytes (1 764 000 bytes).

对于一段 10 秒的立体声录音(2 声道),采样率为 44 100 Hz、分辨率为 16 比特,计算得出 44 100 × 16 × 2 × 10 = 14 112 000 比特。除以 8 得到字节数 (1 764 000 字节)。


5. Binary to Decimal Conversion | 二进制转十进制

Every binary digit (bit) has a place value that is a power of two, starting with 2⁰ on the right. To convert a binary number into decimal, multiply each bit by its place value and add the results.

1011₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11₁₀

每个二进制位(比特)都有一个以 2 的幂次表示的位权,最右侧为 2⁰。将二进制数转换为十进制,需将每一位乘以其位权,然后求和。

The general formula for an n‑bit binary number bₙ₋₁…b₁b₀ is:

Decimal value = bₙ₋₁×2ⁿ⁻¹ + … + b₁×2¹ + b₀×2⁰

n 位二进制数 bₙ₋₁…b₁b₀ 的通式为:十进制值 = bₙ₋₁×2ⁿ⁻¹ + … + b₁×2¹ + b₀×2⁰


6. Decimal to Binary Conversion | 十进制转二进制

The repeated division‑by‑2 method is used to convert a positive decimal integer into binary. Write down the remainder at each step (0 or 1) and read the remainders backwards to obtain the binary number.

将正整数十进制转换为二进制可采用“除 2 取余”法。记录每一步的余数(0 或 1),然后反向读取余数即可得到二进制数。

Example: Convert 19₁₀ to binary.

19 ÷ 2 = 9 remainder 1

9 ÷ 2 = 4 remainder 1

4 ÷ 2 = 2 remainder 0

2 ÷ 2 = 1 remainder 0

1 ÷ 2 = 0 remainder 1

Reading from bottom to top gives 10011₂.

示例:将 19₁₀ 转换为二进制。自下向上读取得到 10011₂。


7. Hexadecimal Basics | 十六进制基础

Hexadecimal (base 16) uses digits 0–9 and letters A–F to represent values 10–15. Each hex digit corresponds to a group of four binary bits. The place values are powers of 16.

Hex to decimal: 2A₁₆ = 2×16¹ + A×16⁰ = 32 + 10 = 42₁₀

十六进制(基数为 16)使用数字 0–9 和字母 A–F 表示数值 10–15。每个十六进制位对应一组四个二进制位。位权是 16 的幂。

To convert binary to hex, group the bits in fours from the right and replace each group with the equivalent hex digit.

将二进制转换为十六进制时,从右向左每四位一组,然后用对应的十六进制数字替换每组。

11010110₂ → 1101 0110 → D6₁₆ (D=13, 6=6)


8. Boolean Algebra Laws | 布尔代数定律

Boolean algebra operates on binary variables (0 or 1). The three basic operations are AND (·), OR (+), and NOT (‘). De Morgan’s laws describe how negation distributes over AND and OR.

(A + B)’ = A’ · B’

(A · B)’ = A’ + B’

布尔代数处理二进制变量(0 或 1)。三种基本运算是与 (·)、或 (+) 和非 (‘)。德摩根定律描述了否定如何对与和或进行分配。

Other useful identities include the commutative, associative, and distributive laws, which work in a similar way to ordinary algebra.

A + B = B + A

A · (B + C) = A · B + A · C

其他常用恒等式包括交换律、结合律和分配律,其运算方式与普通代数类似。


9. Logic Gate Truth Tables | 逻辑门真值表

Truth tables define the output of a logic gate for every possible input combination. The AND gate outputs 1 only when all inputs are 1. The OR gate outputs 1 if at least one input is 1. The NOT gate inverts the input.

真值表定义了逻辑门在所有可能输入组合下的输出。与门仅在所有输入均为 1 时输出 1;或门在至少一个输入为 1 时输出 1;非门则反转输入。

A B A AND B
0 0 0
0 1 0
1 0 0
1 1 1

与门真值表:只有 A 和 B 都为 1 时输出为 1。

A B A OR B
0 0 0
0 1 1
1 0 1
1 1 更多咨询请联系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