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

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

This quick reference guide brings together the essential formulas, key theorems and conversion rules you will encounter in the Year 9 SQA Computing Science course. Use it to revise binary conversions, file sizes, logic gates, and network calculations. All formulas are presented with simple worked examples to help you tackle exam questions confidently.

本速查手册汇集了你在 Year 9 SQA 计算机科学课程中需要掌握的核心公式、重要定理和转换规则,帮助你高效复习二进制转换、文件大小计算、逻辑门和网络计算等主题。每条公式都配以简要示例,助你自信应对考试。


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

To convert a binary number to decimal, multiply each bit by 2 raised to the power of its place value. The rightmost bit has place value 0, the next has place value 1, and so on. Then add up all the products.

将二进制数转换为十进制时,把每一位数字乘以 2 的位权次方(最右边位权为 0,向左依次递增),然后将所有乘积相加。

Decimal = dₙ₋₁×2ⁿ⁻¹ + dₙ₋₂×2ⁿ⁻² + … + d₁×2¹ + d₀×2⁰

  • Example: Binary 1101₂ = 1×2³ + 1×2² + 0×2¹ + 1×2⁰ = 8 + 4 + 0 + 1 = 13 in decimal.
  • 示例:二进制 1101₂ = 1×2³ + 1×2² + 0×2¹ + 1×2⁰ = 8 + 4 + 0 + 1 = 十进制 13。

2. Binary Addition & Overflow | 二进制加法与溢出

Binary addition follows these rules: 0+0=0, 0+1=1, 1+0=1, and 1+1=0 with a carry of 1 to the next higher bit. If the result exceeds the maximum value that can be stored in the available bits, an overflow error occurs.

二进制加法遵循以下规则:0+0=0,0+1=1,1+0=1,1+1=0 并向高位进 1。如果结果超出了可用位数能表示的最大值,就会发生溢出错误。

For an 8-bit register: Max value = 2⁸ − 1 = 255 (unsigned)

  • When adding 1010₂ (10) and 0110₂ (6) in a 4-bit register, 1010+0110 = 10000₂, which needs 5 bits — the leftmost bit is lost, giving a wrong answer.
  • 在 4 位寄存器中计算 1010₂(10)加 0110₂(6)时,1010+0110 = 10000₂ 需要 5 位存放,最左边的位丢失,导致计算结果错误。

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

Digital data is measured using a hierarchy of units based on powers of 2. The smallest unit is a bit; 8 bits form a byte. Larger units are multiples of 1024 (2¹⁰), not 1000.

数字数据使用基于 2 的幂次的单位体系。最小单位是比特(bit),8 个比特组成一个字节(byte)。更大的单位以 1024(2¹⁰)为倍数,而不是 1000。

Unit Abbreviation Relationship
bit b smallest unit
byte B 1 B = 8 b
kilobyte KB 1 KB = 1024 B
megabyte MB 1 MB = 1024 KB
gigabyte GB 1 GB = 1024 MB
terabyte TB 1 TB = 1024 GB

Size in bytes = Value × 1024^level


4. File Size Calculation – Text & Images | 文件大小计算 – 文本与图像

The size of a plain text file depends on the number of characters and the bits used per character (typically 8 bits for ASCII). For an image, file size is determined by the total number of pixels and the colour depth.

纯文本文件的大小取决于字符数量和每个字符所用的比特数(ASCII 通常为 8 比特)。图像的文件大小则由总像素数和色深决定。

Text size (bits) = Number of characters × Bits per character

Image size (bits) = Width in pixels × Height in pixels × Colour depth (bits)

  • A 500‑character ASCII text file uses 500 × 8 = 4000 bits = 500 bytes.
  • 一个 500 字符的 ASCII 文本文件占用 500 × 8 = 4000 比特 = 500 字节。
  • An uncompressed image of 800×600 pixels with 24‑bit colour needs 800 × 600 × 24 = 11,520,000 bits ≈ 1.44 MB.
  • 一幅 800×600 像素、24 位真彩色的未压缩图像需要 800 × 600 × 24 = 11,520,000 比特 ≈ 1.44 MB。

5. Logic Gates & Truth Tables | 逻辑门与真值表

Logic gates are the building blocks of digital circuits. Each gate follows a fixed truth table. The most common gates are AND, OR, NOT, NAND, NOR and XOR. Below are their symbols and truth tables.

逻辑门是数字电路的基本构件,每个门都有一套固定的真值表。常见的逻辑门有与门、或门、非门、与非门、或非门和异或门。下面是它们的符号和真值表。

Gate Symbol (Boolean) Truth Table (A, B → Output)
AND Q = A · B 00→0, 01→0, 10→0, 11→1
OR Q = A + B 00→0, 01→1, 10→1, 11→1
NOT Q = Ā 0→1, 1→0
NAND Q = (A · B) 00→1, 01→1, 10→1, 11→0
NOR Q = (A + B) 00→1, 01→0, 10→0, 11→0
XOR Q = A ⊕ B 00→0, 01→1, 10→1, 11→0

Note: The overbar (Ā) denotes NOT. NAND and NOR are the inverse of AND and OR.

注:上划线 (Ā) 表示非门。与非门和或非门分别是与门和或门的反相。


6. Boolean Algebra – Key Laws | 布尔代数 – 重要定律

Boolean algebra uses a set of laws to simplify logic expressions. These laws are essential for reducing circuit complexity. The most important ones for Year 9 are Commutative, Associative, Distributive, and De Morgan’s theorems.

布尔代数利用一系列定律来化简逻辑表达式,这对于降低电路复杂度至关重要。Year 9 阶段需要掌握的主要定律包括交换律、结合律、分配律和德摩根定理。

Law / Theorem Formula
Commutative (AND/OR) A·B = B·A | A+B = B+A
Associative (AND/OR) (A·B)·C = A·(B·C) | (A+B)+C = A+(B+C)
Distributive A·(B+C) = A·B + A·C
De Morgan’s (A·B) = Ā + B̄ | (A+B) = Ā · B̄
  • Use De Morgan’s law to convert an AND with inverters into an OR with inverters, making circuit design easier.
  • 利用德摩根定律可以将带有反向器的与门转换为带有反向器的或门,便于电路设计。

7. Network Speed & Transfer Time | 网络速度与传输时间

The time needed to transfer a file across a network depends on the file size and the network speed. Always make sure both are expressed in the same unit of bits or bytes before calculating.

通过网络传输文件所需的时间取决于文件大小和网络速度。计算前务必确保两者的单位统一(均为比特或均为字节)。

Transfer Time = File Size ÷ Transfer Speed

If speed is given in bits per second (bps), convert file size to bits. If speed is in bytes per second (Bps), use file size in bytes.

若速度以比特每秒(bps)给出,则将文件大小转换为比特;若速度以字节每秒(Bps)给出,则文件大小用字节表示。

  • Example: A 50 MB file over a 100 Mbps connection: (50 × 8 × 1024 × 1024) bits ÷ 100,000,000 bps ≈ 4.2 seconds (approximate).
  • 示例:通过 100 Mbps 连接传输 50 MB 文件:文件大小 = 50 × 8 = 400 兆比特,传输时间 ≈ 400 兆比特 ÷ 100 Mbps = 4 秒(近似值)。

8. Sound Sampling – Bit Rate & File Size | 声音采样 – 比特率与文件大小

Digital sound quality and file size are determined by the sample rate, bit depth, and number of channels. Higher values give better quality but create larger files.

数字音频的质量和文件大小由采样率、位深度和声道数决定。数值越高音质越好,但文件也越大。

Bit Rate (bps) = Sample Rate (Hz) × Bit Depth × Number of Channels

File Size (bits) = Bit Rate × Duration (seconds)

  • CD‑quality stereo: 44,100 Hz × 16 bits × 2 channels = 1,411,200 bps ≈ 1.41 Mbps.
  • CD 音质立体声:44,100 Hz × 16 bits × 2 声道 = 1,411,200 bps ≈ 1.41 Mbps。
  • A 3‑minute song (180 s) at this rate: 1,411,200 bps × 180 s = 254,016,000 bits ≈ 30.3 MB.
  • 以此码率录制 3 分钟歌曲(180 秒):1,411,200 bps × 180 s = 254,016,000 比特 ≈ 30.3 MB。

9. Image Representation – Resolution & Colour Depth | 图像表示 – 分辨率与色深

Every digital image is a grid of pixels. Resolution tells how many pixels there are (width × height). Colour depth (bits per pixel) determines how many colours each pixel can display: 2ⁿ colours for n bits.

每幅数字图像都是由像素组成的网格。分辨率说明像素的总数(宽×高)。色深(每像素比特数)决定了每个像素能显示多少种颜色:n 比特可表示 2ⁿ 种颜色。

Number of pixels = Width × Height

File Size (bits) = Width × Height × Colour Depth

Colour Depth Colours Common Use
1 bit 2 (black & white) scanned text
8 bits 256 greyscale or indexed colour
24 bits 16.7 million true colour photos
  • An 800×600 image at 24‑bit colour: 800 × 600 × 24 = 11,520,000 bits ≈ 1.44 MB (uncompressed).
  • 一幅 800×600 的 24 位真彩色图像:800 × 600 × 24 = 11,520,000 比特 ≈ 1.44 MB(未压缩)。

10. Processor Performance – Clock Speed & Cores | 处理器性能 – 时钟速度与核心

CPU performance is influenced by clock speed (measured in Hz), the number of cores, and the amount of cache memory. While there is no single formula, the relationship is often described as:

CPU 性能受时钟速度(以 Hz 为单位)、核心数量和缓存大小的影响。虽然没有单一公式,但这种关系通常描述为:

Performance ≈ Clock Speed × IPC × Number of Cores

Where IPC (Instructions Per Cycle) is an average measure of how many instructions the CPU can execute per clock tick. For Year 9, remember that a higher clock speed or more cores can speed up tasks, especially when software is designed to use multiple cores.

其中 IPC(每周期指令数)衡量 CPU 每个时钟周期平均能执行多少条指令。在 Year 9 阶段,只需记住更高的时钟速度或更多的核心能加快任务速度,尤其在软件支持多核时效果更明显。

  • A 3.5 GHz quad‑core processor can often finish parallel work faster than a 2.0 GHz dual‑core processor, but actual speed depends on the program.
  • 3.5 GHz 的四核处理器在处理并行任务时通常比 2.0 GHz 的双核处理器更快,但实际速度还取决于程序本身。

11. Hexadecimal to Binary & Decimal | 十六进制与二进制、十进制转换

Hexadecimal uses base 16 with digits 0–9 and letters A–F (A=10, B=11, …, F=15). Each hex digit maps directly to a 4‑bit binary nibble, making conversions fast and reducing the length of long binary strings.

十六进制以 16 为基数,使用数字 0–9 和字母 A–F(A=10, B=11, …, F=15)。每个十六进制数字正好对应一个 4 位的二进制半字节,使转换迅速且缩短了冗长的二进制串表示。

Binary to Hex: Split binary number into groups of 4 bits (from right), convert each group.

Hex to Binary: Replace each hex digit with its 4‑bit binary equivalent.

Decimal Hex Binary
0 0 0000
10 A 1010
15 F 1111
255 FF 1111 1111

12. Error Detection – Parity & Check Digits | 错误检测 – 奇偶校验与校验位

Simple error detection methods add extra bits or digits to data so that receivers can spot accidental changes. Two common schemes in Year 9 are parity bits and check digits (e.g., ISBN, barcodes).

简单的错误检测方法会向数据中加入额外的比特或数字,以便接收方发现意外变化。Year 9 涉及的两个常见方案是奇偶校验位和校验位(如 ISBN、条形码)。

Even parity bit: make total number of 1s even. Odd parity: make total odd.

Check digit = remainder or sum calculated using a fixed algorithm (e.g., modulo 11, modulo 10).

  • Data byte 1011001 has four 1s (even). For even parity the parity bit is 0; for odd parity it would be 1.
  • 数据字节 1011001 有四个 1(偶数)。采用偶校验时校验位为 0,奇校验时为 1。
  • A simple check digit: for number 123, sum of digits = 6; check digit = 6, transmitted as 1236. If received 1246, sum = 13 ≠ 6, so error detected.
  • 简单校验位示例:数字 123 各位之和 = 6,校验位为 6,传输为 1236。若收到 1246,各位之和 = 13 ≠ 6,说明检测到错误。

Published by TutorHao | Computing 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