Logic Circuits, Logic Expressions, Truth Tables and Problem Statements | 逻辑电路、逻辑表达式、真值表与问题陈述

📚 Logic Circuits, Logic Expressions, Truth Tables and Problem Statements | 逻辑电路、逻辑表达式、真值表与问题陈述

Digital computers process information using binary signals: 0 (low / false) and 1 (high / true). Logic circuits are built from logic gates that perform Boolean operations on these binary signals. Understanding logic circuits, logic expressions and truth tables is essential for the Cambridge IGCSE Science and Computer Science syllabuses.

数字计算机使用二进制信号处理信息:0(低电平 / 假)和 1(高电平 / 真)。逻辑电路由执行布尔运算的逻辑门构成。理解逻辑电路、逻辑表达式和真值表是剑桥 IGCSE 科学和计算机科学课程大纲的核心要求。


1. What is a Logic Circuit? | 什么是逻辑电路?

A logic circuit is an arrangement of logic gates connected together to process binary inputs and produce a binary output. Each gate performs a specific Boolean operation such as AND, OR, NOT, NAND, NOR or XOR.

逻辑电路是由多个逻辑门连接而成的网络,用于处理二进制输入并产生二进制输出。每个逻辑门执行特定的布尔运算,如 AND(与)、OR(或)、NOT(非)、NAND(与非)、NOR(或非)或 XOR(异或)。

In IGCSE examinations, circuits are usually given with standard symbols. You may be asked to:

在 IGCSE 考试中,电路通常使用标准符号给出。你可能会被要求完成以下任务:

  • Complete a truth table for a given circuit | 为给定电路完成真值表
  • Write a logic expression for a circuit | 为电路写出逻辑表达式
  • Draw a circuit from a logic expression | 根据逻辑表达式画出电路
  • Solve a real-world problem using logic gates | 使用逻辑门解决实际生活问题

2. The Three Basic Logic Gates | 三种基本逻辑门

AND gate (与门): The output is 1 only when all inputs are 1. For two inputs A and B, the expression is:

与门:仅当所有输入均为 1 时,输出才为 1。对于两个输入 A 和 B,表达式为:

X = A · B

A B X = A · B
0 0 0
0 1 0
1 0 0
1 1 1

OR gate (或门): The output is 1 when at least one input is 1. For two inputs A and B, the expression is:

或门:当至少一个输入为 1 时,输出为 1。对于两个输入 A 和 B,表达式为:

X = A + B

A B X = A + B
0 0 0
0 1 1
1 0 1
1 1 1

NOT gate (非门): The output is the opposite of the single input. For input A, the expression is:

非门:输出是单输入的反相。对于输入 A,表达式为:

X = ¬A

A X = ¬A
0 1
1 0

3. NAND, NOR and XOR Gates | 与非门、或非门与异或门

NAND gate (与非门): It is the combination of an AND gate followed by a NOT gate. The output is 0 only when both inputs are 1. Expression: X = ¬(A · B).

与非门:它是由与门后接非门组合而成。仅当两个输入均为 1 时,输出才为 0。表达式:X = ¬(A · B)。

A B X = ¬(A · B)
0 0 1
0 1 1
1 0 1
1 1 0

NOR gate (或非门): It is the combination of an OR gate followed by a NOT gate. The output is 1 only when both inputs are 0. Expression: X = ¬(A + B).

或非门:它是由或门后接非门组合而成。仅当两个输入均为 0 时,输出才为 1。表达式:X = ¬(A + B)。

A B X = ¬(A + B)
0 0 1
0 1 0
1 0 0
1 1 0

XOR gate (异或门): The output is 1 when the two inputs are different. Expression: X = A ⊕ B. For example, 0 ⊕ 1 = 1 and 1 ⊕ 1 = 0.

异或门:当两个输入不同时,输出为 1。表达式:X = A ⊕ B。例如,0 ⊕ 1 = 1,而 1 ⊕ 1 = 0。

A B X = A ⊕ B
0 0 0
0 1 1
1 0 1
1 1 0

4. Writing Logic Expressions | 逻辑表达式的书写

A logic expression uses Boolean algebra to describe the relationship between inputs and output. The standard symbols are:

逻辑表达式使用布尔代数来描述输入与输出之间的关系。常用符号如下:

  • NOT A is written as ¬A | 非 A 写作 ¬A
  • A AND B is written as A · B | A 与 B 写作 A · B
  • A OR B is written as A + B | A 或 B 写作 A + B

The order of precedence follows: NOT first, then AND, then OR, unless brackets are used to change the order. For example:

运算优先级为:先非门,再与门,最后或门,除非使用括号改变顺序。例如:

X = ¬A · B + A · ¬B

This expression means: (NOT A AND B) OR (A AND NOT B).

这个表达式表示:(非 A 与 B)或(A 与非 B)。


5. Constructing Truth Tables | 构造真值表

A truth table shows every possible combination of inputs and the corresponding output. For n inputs, the table must contain 2ⁿ rows. For example, 2 inputs give 4 rows, and 3 inputs give 8 rows.

真值表列出所有可能的输入组合及其对应的输出。对于 n 个输入,表格必须包含 2ⁿ 行。例如,2 个输入有 4 行,3 个输入有 8 行。

Follow these steps:

按以下步骤操作:

  • Write the input columns in binary counting order: 000, 001, 010, 011, … | 按二进制计数顺序书写输入列:000、001、010、011、……
  • Add intermediate columns for each sub-expression | 为每个子表达式添加中间列
  • Evaluate each gate from inputs towards the output | 从输入向输出方向逐门计算
  • Complete the final output column | 完成最终输出列

6. Building Circuits from Logic Expressions | 根据逻辑表达式构建电路

To draw a circuit from an expression, work from the inputs to the output:

要根据表达式绘制电路,请从输入向输出推导:

  • Identify all input variables and draw them on the left | 识别所有输入变量并将其画在左侧
  • Draw NOT gates for any negated inputs | 为任何取反的输入画出非门
  • Draw AND gates for each · operation | 为每个 · 运算画出与门
  • Draw OR gates for each + operation, combining the AND outputs | 为每个 + 运算画出或门,将各与门输出连接起来
  • Label the final output on the right side | 在右侧标记最终输出

For example, the expression X = A · (B + C) requires an OR gate combining B and C first, then an AND gate combining A with that result.

例如,表达式 X = A · (B + C) 需要先用或门合并 B 和 C,然后使用与门将 A 与该结果结合。


7. Deriving Expressions from Circuits | 从电路推导表达式

When a circuit diagram is given, you can write its logic expression by labelling intermediate outputs:

当给出电路图时,可以通过标记中间输出来写出逻辑表达式:

  • Label the output of every gate with a temporary letter | 为每个逻辑门的输出标记临时字母
  • Write the expression for each gate using its inputs | 使用其输入写出每个逻辑门的表达式
  • Substitute backwards until only A, B, C, … remain | 从输出向输入逐级代入,直到只剩 A、B、C……等输入变量

Suppose a circuit has an AND gate with inputs A and B, whose output goes into a NOT gate. The final output is X = ¬(A · B). This is exactly a NAND gate.

假设一个电路包含一个输入为 A 和 B 的与门,其输出接至非门。最终输出为 X = ¬(A · B)。这正是与非门。


8. From Problem Statements to Logic | 从问题陈述到逻辑

Real-world problems can be converted into logic expressions by defining binary conditions. Each condition becomes a Boolean variable that is 1 when true and 0 when false.

实际生活问题可以通过定义二进制条件转化为逻辑表达式。每个条件成为一个布尔变量,条件为真时取 1,为假时取 0。

Example 1: A greenhouse fan turns on when the temperature sensor reads high (T = 1) OR the humidity sensor reads high (H = 1). The expression is Fan = T + H.

例 1:当温度传感器读数高(T = 1)或湿度传感器读数高(H = 1)

Published by TutorHao | IGCSE Science Revision Series | aleveler.com

更多咨询请联系16621398022(同微信)

Comments

屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply

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

Exit mobile version