Logic gates · 逻辑门
| English | 中文 | Pinyin · 拼音 |
|---|---|---|
| Boolean logic/ˈbuːlɪən ˈlɒdʒɪk/ | 布尔逻辑 | bù ěr luó jí |
| logic gate/ˈlɒdʒɪk ɡeɪt/ | 逻辑门 | luó jí mén |
| truth table/truːθ ˈteɪbl/ | 真值表 | zhēn zhí biǎo |
| inverted/ɪnˈvɜːtɪd/ | 取反 | qǔ fǎn |
The building blocks of circuits
- Boolean logic 布尔逻辑 works with values that are true (1) or false (0).
- A logic gate 逻辑门 takes inputs and gives one output by a fixed rule.
- A truth table 真值表 lists every input combination and its output.
电路的构建块
- 布尔逻辑(Boolean logic)处理**真(1)或假(0)**的值。
- 一个逻辑门(logic gate)接收输入并按一个固定的规则给出一个输出。
- 一个真值表(truth table)列出每个输入组合和它的输出。
The six gates
- You must know six: NOT, AND, OR, NAND, NOR, XOR.
- NOT has one input; the rest have two. A small circle on the output means inverted 取反 (NOT, NAND, NOR).
AND outputs 1 only when both inputs are 1
六个门
- 你必须知道六个:NOT、AND、OR、NAND、NOR、XOR。
- NOT 有一个输入;其余的有两个。输出上的一个小圆圈意味着取反(inverted,NOT、NAND、NOR)。

Logic gates · 逻辑门
output from the truth table · 来自真值表的输出
Toggle A and B through each gate and read the result off the truth table. · 通过每个门切换 A 和 B,并从真值表读出结果。
NOT, AND, OR
- NOT reverses the input. AND is 1 only when both inputs are 1. OR is 1 when at least one input is 1.
| A | B | A AND B | A OR B |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 |
(NOT: 0→1, 1→0.)
A real logic chip: inside are logic gates like the ones on this page
NOT、AND、OR
- NOT 反转输入。AND 只在两个输入都是 1 时为 1。OR 在至少一个输入是 1 时为 1。
| A | B | A AND B | A OR B |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 |
(NOT:0→1,1→0。)

一个真实的逻辑芯片:内部是像这一页上这些的逻辑门
An AND gate gives output 1 when: · 一个 AND 门在以下情况给出输出 1:
AND outputs 1 only when every input is 1. · AND 只在每个输入都是 1 时输出 1。
An OR gate gives output 0 only when: · 一个 OR 门只在以下情况给出输出 0:
OR is 1 if at least one input is 1, so it is 0 only when both are 0. · OR 在至少一个输入是 1 时为 1,所以它只在两者都是 0 时为 0。
NAND, NOR, XOR
- NAND = opposite of AND; NOR = opposite of OR; XOR = 1 when the inputs are different.
| A | B | A NAND B | A NOR B | A XOR B |
|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 0 |
The six logic gates. A small circle on the output means the result is inverted (NOT, NAND, NOR).
NAND、NOR、XOR
- NAND = AND 的相反;NOR = OR 的相反;XOR 在输入不同时为 1。
| A | B | A NAND B | A NOR B | A XOR B |
|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 0 |

六个逻辑门。输出上的一个小圆圈意味着结果被取反(NOT、NAND、NOR)。
A XOR gate gives output 1 when: · 一个 XOR 门在以下情况给出输出 1:
XOR (exclusive OR) is 1 when the inputs differ. · XOR(异或)在输入不同时为 1。
Match each gate to when its output is 1. · 把每个门匹配到它的输出何时为 1。
AND = all 1s, OR = any 1, XOR = inputs differ, NAND = NOT AND. · AND = 全是 1,OR = 任一个 1,XOR = 输入不同,NAND = NOT AND。
A NOR gate with both inputs 0 gives what output (0 or 1)? · 一个两个输入都是 0 的 NOR 门给出什么输出(0 或 1)?
NOR = NOT OR. OR of (0,0) is 0, so NOR is 1. NOR is 1 only when both inputs are 0. · NOR = NOT OR。(0,0) 的 OR 是 0,所以 NOR 是 1。NOR 只在两个输入都是 0 时为 1。
You've got it
- 1 = true, 0 = false; a truth table lists every input combination
- AND = both 1 · OR = at least one 1 · NOT = invert
- NAND/NOR = AND/OR with the output inverted (the circle)
- XOR = 1 when the inputs differ
你掌握了
- 1 = 真,0 = 假;一个真值表列出每个输入组合
- AND = 都是 1 · OR = 至少一个 1 · NOT = 取反
- NAND/NOR = 输出被取反的 AND/OR(那个圆圈)
- XOR = 输入不同时为 1