逻辑门 | Logic Gates
逻辑门是数字电路中的基本构建块,用于实现布尔逻辑运算。每个逻辑门执行一种基本逻辑操作,如与(AND)、或(OR)、非(NOT)等。以下是主要逻辑门及其功能、符号和真值表。
Logic gates are fundamental building blocks in digital circuits used to implement Boolean logic operations. Each logic gate performs a basic logic function such as AND, OR, NOT, etc. Here are the primary logic gates, their functions, symbols, and truth tables.
与门 | AND Gate
定义 | Definition
与门执行逻辑与操作,只有当所有输入均为 1 时,输出才为 1。
An AND gate performs a logical AND operation, outputting 1 only if all inputs are 1.
符号 | Symbol
真值表 | Truth Table
A | B | Q |
---|---|---|
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
或门 | OR Gate
定义 | Definition
或门执行逻辑或操作,只要有一个输入为 1,输出即为 1。
An OR gate performs a logical OR operation, outputting 1 if any input is 1.
符号 | Symbol
真值表 | Truth Table
A | B | Q |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
非门 | NOT Gate
定义 | Definition
非门执行逻辑非操作,将输入反转:输入为 0 时输出为 1,输入为 1 时输出为 0。
A NOT gate performs a logical NOT operation, inverting the input: outputting 1 if the input is 0, and outputting 0 if the input is 1.
符号 | Symbol
真值表 | Truth Table
A | Q |
---|---|
0 | 1 |
1 | 0 |
异或门 | XOR Gate
定义 | Definition
异或门执行逻辑异或操作,当两个输入不同时,输出为 1;当两个输入相同时,输出为 0。
An XOR gate performs a logical exclusive OR operation, outputting 1 if the inputs are different, and 0 if the inputs are the same.
符号 | Symbol
真值表 | Truth Table
A | B | Q |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
逻辑门的组合 | Combination of Logic Gates
逻辑门可以组合成复杂的电路,以执行更复杂的逻辑运算。以下是一些常见的组合。
Logic gates can be combined to form complex circuits to perform more sophisticated logic operations. Here are some common combinations.
与非门 | NAND Gate
定义 | Definition
与非门是与门和非门的组合,输出为与门输出的反转。只有当所有输入均为 1 时,输出才为 0。
A NAND gate is a combination of an AND gate and a NOT gate, outputting the inverse of the AND gate’s output. It outputs 0 only if all inputs are 1.
符号 | Symbol
真值表 | Truth Table
A | B | Q |
---|---|---|
0 | 0 | 1 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
或非门 | NOR Gate
定义 | Definition
或非门是或门和非门的组合,输出为或门输出的反转。只要有一个输入为 1,输出即为 0。
A NOR gate is a combination of an OR gate and a NOT gate, outputting the inverse of the OR gate’s output. It outputs 0 if any input is 1.
符号 | Symbol
真值表 | Truth Table
A | B | Q |
---|---|---|
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 0 |
同或门 | XNOR Gate
定义 | Definition
同或门是异或门和非门的组合,输出为异或门输出的反转。当两个输入相同时,输出为 1;当两个输入不同时,输出为 0。
An XNOR gate is a combination of an XOR gate and a NOT gate, outputting the inverse of the XOR gate’s output. It outputs 1 if the inputs are the same, and 0 if the inputs are different.
符号 | Symbol
真值表 | Truth Table
A | B | Q |
---|---|---|
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
总结 | Summary
逻辑门是数字电路的基础,通过基本的逻辑操作,可以实现复杂的逻辑功能。 Understanding the basic logic gates and their operations is essential for designing and analyzing digital circuits. Combining these basic gates allows for the creation of complex logic circuits.