A Adam Learning
Back to notes
9618-AS-03-02Chapter 3Section 3.2comprehensive

3.2 Logic gates and logic circuits 逻辑门与逻辑电路

Review the exact wording students need for this knowledge point, then open a filtered question list when ready to practise.

Find questions for 9618-AS-03-02

Syllabus learning goals 考纲学习目标

完成本节后,学生需要能够:

  • 使用 NOT、AND、OR、NAND、NOR 与 XOR (EOR) gate symbols。
  • 定义每种 gate 的 operation,并构建 truth table。
  • 从 problem statement、logic expression 或 truth table 构建 logic circuit。
  • 从 problem statement、logic circuit 或 logic expression 构建 truth table。
  • 从 problem statement、logic circuit 或 truth table 构建 logic expression。
除 NOT 外,本考纲中的 gate 只使用两个 inputs。不要凭直觉猜 final output;为每个 intermediate output 建一列并逐层计算。

1 Binary logic 二进制逻辑

  • 0 表示 false / off / low。
  • 1 表示 true / on / high。

输入通常写作 ABC,输出写作 XYQ。Gate 按固定规则把 input values 转换为 output value。

2 The six logic gates

GateOutput is 1 when...Mark-secure wording
NOTthe one input is 0The output is the inverse of the input.
ANDboth inputs are 1Both inputs are 1.
ORat least one input is 1One or both inputs are 1.
NANDnot both inputs are 1The output is 0 only when both inputs are 1.
NORboth inputs are 0The output is 1 only when both inputs are 0.
XOR / EORinputs are differentOne input is 1 and the other is 0.

XOR 不是 OR:1 XOR 1 = 0,因为 inputs 相同。

Complete truth tables

ABANDORNANDNORXOR
0000110
0101101
1001101
1111000
ANOT A
01
10

快速关系:

  • A NAND B = NOT (A AND B)
  • A NOR B = NOT (A OR B)
  • A XOR B = 1 only when A and B are different。

3 Reading logic expressions

Brackets 决定运算顺序。先算最里面,再逐层向外。

X = (A NOR B) NAND (C XOR B)

拆成 intermediate results:

P = A NOR B
Q = C XOR B
X = P NAND Q

PQ 只是中间结果名称,并不是新的 inputs。

NOT and brackets

X = NOT ((A AND B) OR C)

NOT 作用于整个 ((A AND B) OR C)。若 brackets 丢失,电路含义会改变。

若题目写 Do not simplify the expression,必须沿 circuit 原有 gate 顺序记录 sub-expressions,不要换成更短但不同结构的表达式。

4 Expression to logic circuit

采用 inside-out 方法。

Example:

X = NOT (((A AND B) OR C) AND (C NOR D))

步骤:

1. P = A AND B 2. Q = P OR C 3. R = C NOR D 4. S = Q AND R 5. X = NOT S

连接关系:

A ----\
       AND -> P ----\
B ----/              OR -> Q ----\
C ------------------/              AND -> S -> NOT -> X
C ----\                            /
       NOR -> R ------------------/
D ----/

Drawing checklist

  • 每个 bracket group 是否有对应 gate?
  • 同一 input 是否在需要时正确分支?
  • Gate output 是否接到下一层 input?
  • 最外层 operator 是否成为最后一个 gate?
  • Output 是否正确标记?

5 Logic circuit to expression

从 inputs 向 output 逐层给 wires 命名。

P = A XOR B
Q = B AND C
R = Q OR A
X = (NOT P) NAND R

代回后:

X = (NOT (A XOR B)) NAND ((B AND C) OR A)

Mark-secure method

  • 在每个 gate output 旁写 sub-expression。
  • 遇到 branching input,不要改变原 input value。
  • 最后把 sub-expressions 放入 final gate。
  • 保留 NOT、NAND、NOR 的完整 brackets。

真题评分常分别给 intermediate expression 和 final combination 分数。保留 working,即使最后一步错误仍可能得 method marks。

6 Constructing a truth table

n 个 inputs,就有 2^n rows:2 inputs 有 4 rows;3 inputs 有 8 rows;4 inputs 有 16 rows。

三输入标准顺序相当于从 binary 000 数到 111

ABC
000
001
010
011
100
101
110
111

Worked example

X = (A NOR B) NAND (C XOR B)
ABCP = A NOR BQ = C XOR BX = P NAND Q
000101
001110
010011
011001
100001
101011
110011
111001

最终 column 是 1, 0, 1, 1, 1, 1, 1, 1,与对应 mark scheme 一致。

每个 sub-expression 单独一列,可以避免漏掉 NOT 或混淆 NAND/NOR,也方便逐行检查。

7 Problem statement to expression

先翻译关键词:

  • “and” → AND
  • “or / one or more” → OR
  • “not / off / not detected” → NOT
  • “either but not both / different” → XOR

例:E=1 表示 security system on,A=1 表示 daylight low,C=1 表示 person detected。三者都满足时 floodlight 才亮:

X = E AND A AND C

系统开启,并且 door/person 条件至少一个为真时 alarm 启动:

Y = E AND (B OR C OR D)

Brackets 不能省略。E AND (B OR C OR D) 表示 E 始终必须为 1(E AND B) OR C OR D 的含义不同。

8 Truth table to expression

为每一行 output = 1 写一个 AND term,再用 OR 连接所有 terms。

Q=1 只出现在:

R S T
0 0 1
1 1 0

第一行写:

NOT R AND NOT S AND T

第二行写:

R AND S AND NOT T

完整 expression:

Q = (NOT R AND NOT S AND T) OR (R AND S AND NOT T)

Row-to-term rule

  • Input 为 1:写 variable 本身。
  • Input 为 0:写 NOT variable
  • 同一 row 的条件用 AND
  • 不同 output-1 rows 用 OR

9 NAND, NOR and XOR traps

  • NAND:先算 AND,再反转;只有 1,1 时输出 0
  • NOR:先算 OR,再反转;只有 0,0 时输出 1
  • XOR:inputs 不同时输出 1;相同时输出 0
0 XOR 1 = 1
1 XOR 0 = 1
0 XOR 0 = 0
1 XOR 1 = 0

有连续 XOR 或复杂 brackets 时,严格按照 circuit/brackets 建 intermediate columns,不要把 XOR 当作 OR。

10 Common mistakes 常见失分点

  • 把 XOR 写成 “one or both inputs are 1”;这是 OR。
  • NAND/NOR 忘记 final inversion。
  • NOT 的 brackets 范围错误。
  • Expression → circuit 时不从最内层开始。
  • Circuit → expression 时省略 intermediate brackets。
  • Truth table 不是 2^n rows,或 input combinations 重复/遗漏。
  • 不写 intermediate columns,final output 出错后无法定位。
  • Problem statement 中的关键 brackets 丢失。
  • Truth table → expression 时错误使用 output 0 rows。
  • 题目要求 do not simplify 时改变原 gate structure。

11 Exam-answer checklist 真题检查表

  • 能否一句话准确描述六种 gates?
  • 是否记住 XOR = different inputs?
  • 是否按 000...111... 列出所有 rows?
  • 是否为每个 bracket group 建 intermediate result?
  • NAND/NOR 是否进行了 inversion?
  • Circuit 最后一层是否对应 expression 最外层 operator?
  • Expression 是否保留清楚 brackets?
  • 从 truth table 写 expression 时,是否只选 output 1 rows?
  • 每个 output-1 row 是否用 AND,再用 OR 合并?
  • 是否保留 working 以争取 method marks?

本材料依据 9618 syllabus 3.2 的五项要求,并综合本页所列 2021-2025 past-paper questions 及 mark schemes。步骤和示例围绕 gate definitions、intermediate working、brackets 和 output-1 rows 组织。

Practice This Knowledge Point

Open the question bank with this knowledge code already filled in. The filtered list will show matching questions for this note.

Open filtered practice
Source questions used