📚 IB Mathematics: Switching Circuits and Boolean Expressions | IB数学:开关电路与布尔表达式
In computer science and digital electronics, switching circuits form the physical backbone of all computational devices. A switching circuit is simply a network of switches that can be either open (off) or closed (on), controlling whether current flows through the system. The mathematical language used to describe and analyse these circuits is Boolean algebra, developed by George Boole in the mid-19th century.
在计算机科学与数字电子学中,开关电路构成了所有计算设备的物理基础。开关电路就是一组开关的网络,每个开关要么处于断开状态(关),要么处于闭合状态(开),从而控制电流是否通过整个系统。用于描述和分析这些电路的数学语言是布尔代数,由乔治·布尔于19世纪中叶创立。
1. Boolean Variables and Logical Values | 布尔变量与逻辑值
In Boolean algebra, variables can only take one of two values: 0 or 1. These values represent the two possible states of a switch: 0 corresponds to an open switch (no current), and 1 corresponds to a closed switch (current flows). The variables are often denoted by letters such as A, B, C, or x, y, z.
在布尔代数中,变量只能取两个值之一:0或1。这两个值表示开关的两种可能状态:0对应断开(无电流通过),1对应闭合(电流通过)。变量通常用字母A、B、C或x、y、z表示。
The basic operations of Boolean algebra are AND (conjunction, denoted by × or ∧), OR (disjunction, denoted by + or ∨), and NOT (negation, denoted by a bar above the variable, e.g., Ā or A’). These operations mirror the behaviour of switches connected in series, in parallel, and in inverse, respectively.
布尔代数的基本运算包括与(AND,记为×或∧)、或(OR,记为+或∨)和非(NOT,记为变量上方的横线,如Ā或A’)。这些运算分别对应串联、并联和反向开关的行为。
2. Series and Parallel Connections | 串联与并联连接
Two switches connected in series form an AND circuit. For current to flow through the entire branch, both switches must be closed. If A and B are in series, the circuit conducts only when A = 1 AND B = 1. Thus, the Boolean expression for a series connection is written as A × B, or simply AB.
两个开关串联连接构成一个与门电路。为了使电流通过整个支路,两个开关都必须闭合。A和B串联时,只有当A = 1且B = 1时电路导通。因此,串联连接的布尔表达式写作A × B,通常简写为AB。
Two switches connected in parallel form an OR circuit. Current flows if at least one of the switches is closed. If A and B are in parallel, the circuit conducts when A = 1 OR B = 1 (or both). The Boolean expression is A + B.
两个开关并联连接构成一个或门电路。只要至少有一个开关闭合,电流就能通过。A和B并联时,当A = 1或B = 1(或两者均为1)时电路导通。其布尔表达式为A + B。
| Connection 连接方式 | Circuit behaviour 电路行为 | Boolean expression 布尔表达式 |
| Series 串联 | Current flows only if both are closed 仅当两者都闭合时才导通 | A × B (AND) |
| Parallel 并联 | Current flows if at least one is closed 只要至少一个闭合就导通 | A + B (OR) |
3. Truth Tables for Basic Operations | 基本运算的真值表
A truth table lists all possible combinations of input values and the corresponding output. For two variables A and B, there are 2² = 4 combinations. Let us examine the truth tables for the three fundamental operations.
真值表列出所有可能的输入值组合及其对应的输出结果。对于两个变量A和B,共有2² = 4种组合。让我们考察三种基本运算的真值表。
For A AND B (A × B): the output is 1 only when both A and B are 1.
对于A与B(A × B):仅当A和B都为1时,输出才为1。
| A | B | A × B |
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
For A OR B (A + B): the output is 1 if at least one input is 1.
对于A或B(A + B):只要至少一个输入为1,输出就为1。
| A | B | A + B |
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
For NOT A (Ā): the output is the opposite of the input.
对于非A(Ā):输出是输入的反向。
| A | Ā |
| 0 | 1 |
| 1 | 0 |
4. Laws of Boolean Algebra | 布尔代数定律
Boolean algebra follows a set of laws that allow expressions to be manipulated and simplified. These laws are similar to, but not identical with, the laws of ordinary algebra. The most important ones for circuit analysis include the commutative, associative, distributive, identity, and complement laws.
布尔代数遵循一套定律,使得表达式可以被变换和化简。这些定律与普通代数定律类似,但并不完全相同。电路分析中最重要的定律包括交换律、结合律、分配律、同一律和互补律。
Commutative laws 交换律: A × B = B × A; A + B = B + A
Associative laws 结合律: (A × B) × C = A × (B × C); (A + B) + C = A + (B + C)
Distributive laws 分配律: A × (B + C) = (A × B) + (A × C); A + (B × C) = (A + B) × (A + C)
Identity laws 同一律: A × 1 = A; A + 0 = A
Complement laws 互补律: A × Ā = 0; A + Ā = 1
Additionally, two special laws called absorption laws are very useful: A + (A × B) = A and A × (A + B) = A. These can dramatically simplify expressions involving a variable and a more complex term.
此外,还有两条称为吸收律的特殊定律非常有用:A + (A × B) = A 和 A × (A + B) = A。这些定律可以极大地简化包含变量与更复杂项的表达式。
5. De Morgan’s Laws | 德摩根定律
De Morgan’s laws are essential for converting between AND and OR operations when negation is involved. They state that the negation of an AND is the OR of the negations, and the negation of an OR is the AND of the negations.
德摩根定律在涉及否定时,对于与运算和或运算之间的转换至关重要。它们指出:与运算的否定等于各变量否定的或运算;或运算的否定等于各变量否定的与运算。
(A × B)’ = Ā + B̄
(A + B)’ = Ā × B̄
These laws can be verified using truth tables. For example, (A × B)’ is 1 whenever A × B is 0, which occurs for all input combinations except both A = 1 and B = 1. Meanwhile, Ā + B̄ is 1 whenever at least one of Ā or B̄ is 1, which likewise occurs for all combinations except A = B = 1. Both expressions produce identical outputs.
这些定律可以用真值表验证。例如,(A × B)’在A × B为0时取值为1,即除A = 1且B = 1之外的所有输入组合。而Ā + B̄在Ā或B̄至少一个为1时取值为1,同样除A = B = 1之外的所有组合均满足。两种表达式输出完全一致。
6. From Circuits to Boolean Expressions | 从电路到布尔表达式
Given a switching circuit diagram, we can derive its Boolean expression step by step. Start by identifying the component segments: series connections become AND operations, parallel connections become OR operations, and switches labelled with a bar are negated variables.
给定一个开关电路图,我们可以逐步推导出其布尔表达式。首先识别各个组成部分:串联连接变成与运算,并联连接变成或运算,带有横线标记的开关则为取反变量。
Consider a simple circuit: two branches in parallel. The first branch has a single switch A. The second branch has switches B and C in series. The overall circuit conducts when either A is closed, or both B and C are closed. The Boolean expression is therefore:
考虑一个简单电路:两条支路并联。第一条支路仅含一个开关A。第二条支路由开关B和C串联组成。整个电路在A闭合,或B与C均闭合时导通。因此,其布尔表达式为:
Output = A + (B × C)
If switches are labelled with negation, for example a normally-closed switch that opens when activated, then the variable appears as Ā in the expression. Always read the circuit carefully, noting whether each path is series or parallel and whether any switch is inverted.
如果开关带有否定标记,例如一个常闭开关在被触发时断开,那么该变量在表达式中以Ā形式出现。务必仔细阅读电路图,注意每条路径是串联还是并联,以及是否有开关取反。
7. From Boolean Expressions to Circuits | 从布尔表达式到电路
Conversely, given a Boolean expression, we can draw a corresponding switching circuit. The expression must first be written in terms of AND, OR, and NOT operations. Then, AND operations map to series connections, OR operations map to parallel connections, and NOT operations map to switches that are normally closed (open when activated).
反过来,给定一个布尔表达式,我们也可以画出相应的开关电路。首先必须将表达式用与、或、非运算表示。然后,与运算对应串联连接,或运算对应并联连接,非运算对应常闭式开关(在激活时断开)。
For example, the expression (A + B) × C corresponds to a circuit where a parallel combination of A and B is placed in series with switch C. The circuit conducts current when C is closed AND at least one of A or B is closed.
例如,表达式(A + B) × C对应一个电路:A与B的并联组合与开关C串联。该电路在C闭合且A或B至少一个闭合时导通。
Drawing order matters. The hierarchy of operations follows the same convention as algebra: parentheses first, then AND (multiplication-like), then OR (addition-like). This ensures that the expression and the circuit are consistent in meaning.
绘制顺序很重要。运算的优先级遵循与代数相同的约定:先括号,再与运算(类似乘法),最后或运算(类似加法)。这确保了表达式与电路在含义上的一致。
8. Simplifying Boolean Expressions | 化简布尔表达式
Simplifying Boolean expressions is of great practical importance because a simpler expression leads to a simpler circuit, which uses fewer components, consumes less power, and is more reliable. The primary simplification tools are the algebraic laws presented earlier, including De Morgan’s laws and absorption laws.
化简布尔表达式具有重要的实际意义,因为更简单的表达式对应更简洁的电路,从而使用更少的元件、消耗更低的功率并且更可靠。主要的化简工具是前面介绍的代数定律,包括德摩根定律和吸收律。
Let us simplify the expression: F = A’B + AB.
让我们化简表达式:F = A’B + AB。
Using the distributive law (in reverse), we can factor out B:
利用分配律(反向运用),我们可以提出公因子B:
F = B × (A’ + A)
By the complement law, A’ + A = 1. Hence F = B × 1 = B. Thus the entire circuit, which initially appeared to require two branches, is equivalent to a single switch B.
根据互补律,A’ + A = 1。因此F = B × 1 = B。这样,原本看似需要两个支路的整个电路,实际上等效于单个开关B。
Another example: simplify F = A + AB. By the absorption law, A + AB = A. The circuit simplifies to just the switch A, regardless of B.
另一个例子:化简F = A + AB。根据吸收律,A + AB = A。该电路化简为仅含开关A,与B无关。
9. Logic Gates and Switching Circuits | 逻辑门与开关电路
Switching circuits can also be represented using logic gates, which are the fundamental building blocks of digital integrated circuits. The three basic gates — AND gate, OR gate, and NOT gate (inverter) — correspond to the three basic Boolean operations. NAND and NOR gates are combinations of these with a NOT at the output.
开关电路也可以用逻辑门来表示,逻辑门是数字集成电路的基本构建模块。三种基本门——与门、或门和非门(反相器)——对应三种基本布尔运算。与非门和或非门则是基本门输出端再取反的组合。
Each type of gate has a distinct standard symbol. An AND gate outputs 1 only if all its inputs are 1, an OR gate outputs 1 if any input is 1, and a NOT gate inverts its single input. In switching circuit terms, an AND gate corresponds to a series connection, and an OR gate corresponds to a parallel connection of switches.
每种门都有其特定的标准符号。与门仅当所有输入为1时输出1,或门在任意输入为1时输出1,非门则对单一输入取反。在开关电路的术语中,与门对应串联连接,或门对应并联连接。
| Gate 门 | Symbol 符号 | Boolean expression 布尔表达式 | Circuit equivalent 电路等效 |
| AND 与门 | D-shaped 矩形加半圆 | A × B | Series 串联 |
| OR 或门 | Shield-shaped 盾形 | A + B | Parallel 并联 |
| NOT 非门 | Triangle with bubble 三角形带小圈 | Ā | Inverted switch 取反开关 |
10. Worked Example: A Complex Circuit | 综合实例:一个复杂电路
Let us analyse a more involved circuit. Suppose we have three switches A, B, and C arranged as follows: switches A and B are in parallel, and this parallel combination is in series with switch C. Additionally, there is a parallel branch with the negation of A (Ā) alone, connected across the entire combination.
让我们分析一个更复杂的电路。假设有三个开关A、B、C,布置如下:A和B并联,该并联组合与C串联。此外,还有一个单独含非A(Ā)的并联支路,跨接在整个组合两端。
First, the series-parallel portion gives (A + B) × C. The whole circuit then has this in parallel with Ā. Thus the Boolean expression is:
首先,串联-并联部分产生(A + B) × C。整个电路再与Ā并联。因此,布尔表达式为:
F = Ā + [(A + B) × C]
Using the distributive law, we expand (A + B) × C = (A × C) + (B × C). The expression becomes:
利用分配律,展开(A + B) × C = (A × C) + (B × C)。表达式变为:
F = Ā + (A × C) + (B × C)
This is the simplified sum-of-products form. If we further examine when F = 0, we see that F = 0 requires Ā = 0 (so A = 1), A × C = 0 (so C = 0), and B × C = 0 (already satisfied since C = 0). Therefore F = 0 exactly when A = 1 and C = 0, regardless of B. In all other cases, F = 1.
这是化简后的积之和形式。如果进一步考察F = 0的情况,我们可看出F = 0需要Ā = 0(即A = 1)、A × C = 0(即C = 0)以及B × C = 0(因C = 0已自动满足)。因此,F = 0恰好当A = 1且C = 0时成立,与B无关。其他所有情况下F = 1。
11. Application: Binary Adder Design | 应用:二进制加法器设计
A fundamental application of Boolean algebra in computer hardware is the design of an adder circuit. A half-adder takes two binary digits A and B and produces a sum bit S and a carry bit C_out. The sum bit is 1 when exactly one of A or B is 1, and the carry bit is 1 when both are 1.
布尔代数在计算机硬件中的一个基本应用是加法器电路的设计。半加器接收两个二进制位A和B,产生和位S与进位位C_out。和位在恰好一个输入为1时为1,进位位在两个输入均为1时为1。
The sum bit is given by the XOR operation, expressible as S = A × B̄ + Ā × B. The carry bit is simply C_out = A × B. A full adder extends this concept to include a carry-in from a previous stage.
和位由异或运算给出,可表示为S = A × B̄ + Ā × B。进位位即为C_out = A × B。全加器将此概念扩展,纳入来自低位的进位输入。
This example demonstrates how switching circuits, described by Boolean expressions, directly implement arithmetic operations inside a computer processor. Every addition, subtraction, multiplication, and comparison performed by a CPU ultimately reduces to these basic Boolean operations.
这个例子展示了由布尔表达式描述的开关电路如何直接在计算机处理器内部实现算术运算。CPU执行的每一次加、减、乘、比较运算,最终都归结为这些基本的布尔操作。
12. Common Pitfalls and Exam Tips | 常见错误与应试建议
Students often confuse the distributive law of Boolean algebra with that of ordinary arithmetic. While A × (B + C) = A × B + A × C holds in both systems, the Boolean version also allows A + (B × C) = (A + B) × (A + C), which has no equivalent in ordinary algebra. Be ready to use both forms.
学生经常混淆布尔代数的分配律与普通算术的分配律。虽然A × (B + C) = A × B + A × C在两种体系中均成立,但布尔版本还允许A + (B × C) = (A + B) × (A + C),这在普通代数中没有对应。要准备好使用这两种形式。
De Morgan’s law requires careful distribution of the negation across each term: the negation flips AND to OR and OR to AND, and each variable is individually complemented. A common mistake is forgetting to change the operation type, writing (A × B)’ = Ā × B̄ erroneously.
德摩根定律要求小心地将否定分配到每一项上:否定将与转为或、将或转为与,且每个变量各自取补。一个常见错误是忘记改变运算类型,错误地写成(A × B)’ = Ā × B̄。
Exam questions often present a circuit diagram and ask for the Boolean expression, then ask for a truth table or simplification. Practise converting between all three representations: circuit diagram ↔ Boolean expression ↔ truth table. Speed and accuracy in these conversions are essential for success in IB mathematics paper.
考试题目通常给出电路图,要求写出布尔表达式,随后要求真值表或化简。请练习在三种表示之间相互转换:电路图 ↔ 布尔表达式 ↔ 真值表。在IB数学考试中,这些转换的速度和准确性是取得好成绩的关键。
Published by TutorHao | IB Mathematics Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply