📚 Boolean Algebra for IGCSE AQA Computer Science | 布尔代数:考点精讲
Boolean algebra forms the backbone of digital logic and computer circuits. It deals with variables that can only take two values — usually denoted 0 (False) and 1 (True). In the IGCSE AQA Computer Science specification, understanding Boolean algebra is essential for designing and simplifying logic circuits, analysing truth tables, and writing efficient Boolean expressions. This revision guide covers all the key points you need to master.
布尔代数是数字逻辑和计算机电路的基础。它处理只能取两个值的变量——通常用 0(假)和 1(真)表示。在 IGCSE AQA 计算机科学大纲中,理解布尔代数对于设计和简化逻辑电路、分析真值表以及编写高效的布尔表达式至关重要。本复习指南涵盖了你需要掌握的所有关键点。
1. What is Boolean Algebra? | 什么是布尔代数?
Boolean algebra is a branch of algebra where variables represent truth values (True or False, 1 or 0). It uses logical operations such as AND, OR, and NOT to create expressions. These expressions can be evaluated to control digital circuits, and they obey a set of laws that allow simplification. Unlike ordinary algebra that deals with numbers, Boolean algebra deals with binary states.
布尔代数是代数学的一个分支,其中的变量表示真值(真或假,1 或 0)。它使用与(AND)、或(OR)、非(NOT)等逻辑运算来创建表达式。这些表达式可以求值,以控制数字电路,并且它们遵循一系列允许化简的定律。与处理数字的普通代数不同,布尔代数处理的是二进制状态。
2. Basic Logic Gates and Their Symbols | 基本逻辑门及其符号
The three fundamental logic gates are: AND gate (output is 1 only if all inputs are 1), OR gate (output is 1 if at least one input is 1), and NOT gate (inverter, output is opposite of input). In circuit diagrams, each gate has a distinct shape: AND is a D-shape, OR is a curved arrow shape, and NOT is a triangle with a bubble. Additionally, NAND and NOR are inverted versions, and XOR (exclusive OR) outputs 1 only when inputs differ.
三个基本逻辑门是:与门(仅当所有输入为 1 时输出为 1)、或门(只要至少一个输入为 1 输出即为 1)和非门(反相器,输出与输入相反)。在电路图中,每个门都有独特的形状:与门是 D 形,或门是弧形箭头形状,非门是带小圆圈的三角形。此外,与非门和或非门是反相的版本,而异或门(XOR)仅当输入不同时才输出 1。
Here are the standard symbols and their Boolean expressions:
以下是标准符号及其布尔表达式:
| Gate | Symbol Shape | Boolean Expression |
|---|---|---|
| AND | D-shape with two inputs, one output | X = A · B |
| OR | Curved pointed shape with two inputs | X = A + B |
| NOT | Triangle with a small bubble at output | X = A’ or X = ¬A |
| NAND | AND symbol + bubble | X = (A · B)’ |
| NOR | OR symbol + bubble | X = (A + B)’ |
| XOR | OR gate with an extra curved line on inputs | X = A ⊕ B |
3. Truth Tables | 真值表
A truth table lists every possible combination of inputs and the corresponding output for a given logic circuit or expression. If there are n inputs, the table has 2ⁿ rows. For a two-input AND gate, the output is 1 only when A=1 and B=1; otherwise it is 0. For an OR gate, output is 1 if either A=1 or B=1 (or both). For NOT, a single input is inverted.
真值表列出了给定逻辑电路或表达式的每种可能输入组合及其对应输出。若有 n 个输入,则表有 2ⁿ 行。对于两输入与门,仅当 A=1 且 B=1 时输出为 1;否则为 0。对于或门,如果 A=1 或 B=1(或两者均为 1),则输出为 1。对于非门,单个输入被取反。
Example truth table for XOR (A ⊕ B):
异或门(A ⊕ B)的真值表示例:
| A | B | X |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
4. Writing Boolean Expressions | 编写布尔表达式
A Boolean expression shows how logic variables are combined using operators. We generally use A · B for AND, A + B for OR, and A’ for NOT. Precedence matters: NOT is performed first, then AND, then OR, unless brackets are used. For instance, A + B · C means A OR (B AND C), not (A OR B) AND C. When you are asked to write an expression from a circuit, trace each gate from inputs to final output.
布尔表达式展示了如何使用运算符组合逻辑变量。我们通常用 A · B 表示与,A + B 表示或,A’ 表示非。优先级很重要:除非使用括号,否则先做非运算,然后是与运算,最后是或运算。例如,A + B · C 表示 A 或(B 与 C),而非(A 或 B)与 C。当你需要从电路写出表达式时,应从输入端顺着每个门追踪到最终输出。
For a circuit with A and B fed into an AND gate, whose output goes to a NOT gate, the final expression is (A · B)’. Always use brackets to clearly show intermediate operations.
对于 A 和 B 输入一个与门,其输出再进入一个非门的电路,最终表达式为 (A · B)’。始终使用括号明确表示中间运算。
5. Basic Laws of Boolean Algebra | 布尔代数的基本定律
Boolean algebra has a set of fundamental laws that help simplify expressions. These include:
- Identity laws: A + 0 = A, A · 1 = A
- Null (dominance) laws: A + 1 = 1, A · 0 = 0
- Idempotent laws: A + A = A, A · A = A
- Complement laws: A + A’ = 1, A · A’ = 0
- Double negation: (A’)’ = A
- 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)
- Absorption laws: A + (A · B) = A, A · (A + B) = A
布尔代数有一组基本定律,有助于化简表达式。这些定律包括:
- 同一律:A + 0 = A,A · 1 = A
- 零一律(支配律):A + 1 = 1,A · 0 = 0
- 幂等律:A + A = A,A · A = A
- 互补律:A + A’ = 1,A · A’ = 0
- 双重否定: (A’)’ = A
- 交换律:A + B = B + A,A · B = B · A
- 结合律:(A + B) + C = A + (B + C),(A · B) · C = A · (B · C)
- 分配律:A · (B + C) = A · B + A · C,A + (B · C) = (A + B) · (A + C)
- 吸收律:A + (A · B) = A,A · (A + B) = A
6. De Morgan’s Laws | 德摩根定律
De Morgan’s Laws are two transformation rules that are extremely useful for simplifying expressions that involve negation of AND or OR operations. They state:
(A · B)’ = A’ + B’
(A + B)’ = A’ · B’
In words: the complement of an AND is the OR of the complements; the complement of an OR is the AND of the complements. You can extend these to more than two variables: (A · B · C)’ = A’ + B’ + C’.
德摩根定律是两条变换规则,对于化简包含与或或运算取反的表达式极为有用。它们是:
(A · B)’ = A’ + B’
(A + B)’ = A’ · B’
用语言描述:与运算的补是各补的或;或运算的补是各补的与。你可以将其推广到多于两个变量的情形:(A · B · C)’ = A’ + B’ + C’。
These laws often help to replace a NAND gate with an OR of inverters, or a NOR gate with an AND of inverters. They are vital when converting between logic gate types.
这些定律常有助于用反相器的或门代替与非门,或用反相器的与门代替或非门。在逻辑门类型之间转换时,它们至关重要。
7. Simplifying Boolean Expressions | 化简布尔表达式
Simplification makes a logic circuit cheaper and faster by using fewer gates. Apply Boolean laws step by step. Start by expanding bracketed terms using the distributive law, then combine terms using absorption, complement, or idempotent laws. For example:
化简可以通过使用更少的门使逻辑电路更便宜、更快速。逐步应用布尔定律。先用分配律展开括号项,然后用吸收律、互补律或幂等律合并项。例如:
X = A · B + A · B’
Factor out A: X = A · (B + B’) = A · 1 = A. Here we used complement law B + B’ = 1 and identity law A · 1 = A.
提出公因子 A:X = A · (B + B’) = A · 1 = A。这里使用了互补律 B + B’ = 1 和同一律 A · 1 = A。
Another example: X = (A + B) · (A + C) distributes to A + (B · C). Always verify your simplified expression by constructing a truth table for both original and final forms — they must match.
另一个例子:X = (A + B) · (A + C) 分配为 A + (B · C)。始终通过为原始形式和最终形式构建真值表来验证你化简后的表达式——它们必须一致。
8. From Logic Circuit to Expression and Back | 从逻辑电路到表达式以及反向转换
Given a combinational logic circuit diagram, you can write the corresponding Boolean expression by working from the inputs to the output, assigning variable names or sub-expressions to each gate’s output. For example, if A and B go into an OR gate, and C is inverted then ANDed with the OR output, the expression is (A + B) · C’.
给定一个组合逻辑电路图,你可以通过从输入到输出的方向,为每个门的输出指定变量名或子表达式,从而写出相应的布尔表达式。例如,如果 A 和 B 进入一个或门,而 C 取反后与或门的输出进行与运算,则表达式为 (A + B) · C’。
Conversely, you can draw a circuit from an expression: identify the order of operations, draw the necessary gates, and connect them. Remember to use a NOT gate for every complemented variable. This mapping is central to the AQA exam questions.
反之,你可以根据表达式绘制电路:识别运算顺序,绘制所需的门并连接它们。记得为每个取反变量使用一个非门。这种映射是 AQA 考试题目的核心。
9. Deriving an Expression from a Truth Table (SOP) | 从真值表推导表达式(积之和)
One common exam task is to produce a Boolean expression from a given truth table. The Sum of Products (SOP) method is used. For each row where the output is 1, write a product (AND) term that is true only for that row. To form a product term for a row, if an input variable is 0, use its complement; if it is 1, use the variable itself. Then sum (OR) all these product terms together.
一项常见的考试任务是根据给定的真值表生成布尔表达式。使用积之和(SOP)方法。对于输出为 1 的每一行,写出一个仅在该行才为真的乘积(与)项。为某行构造乘积项时,若输入变量为 0,则使用其补;若为 1,则使用变量本身。然后将所有这些乘积项相加(或)。
For example, for a truth table where X=1 when A=0,B=1 and when A=1,B=0, the SOP expression is X = A’ · B + A · B’. This is exactly the XOR function.
例如,对于一个真值表,当 A=0,B=1 以及 A=1,B=0 时 X=1,则积之和表达式为 X = A’ · B + A · B’。这正是异或函数。
This method can be applied to any number of inputs. The resulting expression can then be simplified using Boolean algebra laws.
这种方法可应用于任意数量的输入。随后可用布尔代数定律化简所得的表达式。
10. NAND and NOR as Universal Gates | 与非门和或非门作为通用门
A universal gate is one that can be used to implement any Boolean function without needing any other gate type. Both NAND and NOR gates are universal. You can create NOT, AND, and OR gates using only NANDs, for instance:
- NOT: tie both inputs of a NAND together, output = (A · A)’ = A’
- AND: NAND followed by NOT (i.e., two NANDs) → A · B = ((A · B)’)’
- OR: three NANDs: A’ = (A · A)’, B’ = (B · B)’, then NAND of A’ and B’ gives (A’ · B’)’ = A + B (by De Morgan).
通用门是指无需任何其他门类型即可实现任何布尔函数的门。与非门和或非门都是通用门。例如,你可以仅用与非门构造非门、与门和或门:
- 非门:将与非门的两个输入连在一起,输出 = (A · A)’ = A’
- 与门:与非门后接非门(即两个与非门)→ A · B = ((A · B)’)’
- 或门:三个与非门:A’ = (A · A)’,B’ = (B · B)’,然后对 A’ 和 B’ 进行与非运算得到 (A’ · B’)’ = A + B(根据德摩根定律)。
Understanding this universality is important for answering questions on gate equivalence and circuit design using only one gate type.
理解这种通用性对于回答仅使用单一门类型的门等价性和电路设计问题很重要。
11. Common Pitfalls and Exam Tips | 常见错误与考试技巧
Many students lose marks by confusing the AND and OR symbols, forgetting operator precedence, or incorrectly applying De Morgan’s Laws. Remember: AND · binds tighter than OR +. Always use parentheses to avoid ambiguity. When simplifying, work step by step and annotate each law you use. If a question asks for a circuit diagram, ensure your gate shapes are clear and correctly labelled, and don’t forget the bubbles for inverted gates.
许多学生因混淆与和或符号、忘记运算符优先级或错误应用德摩根定律而失分。请记住:与 · 的优先级高于或 + 。始终使用括号避免歧义。化简时,一步步进行并标注所使用的每一条定律。若题目要求绘制电路图,确保门形状清晰并正确标注,且不要忘记表示反相门的小圆圈。
Also practise reverse engineering: given an expression, draw the circuit; given a circuit, write the expression; given a truth table, derive and simplify the expression. These three skills are heavily tested.
还要练习逆向工程:给定表达式绘制电路;给定电路写出表达式;给定真值表推导并化简表达式。这三项技能常作为重点考查。
12. Summary of Boolean Algebra for IGCSE AQA | IGCSE AQA 布尔代数总结
Boolean algebra is a powerful tool for analysing and designing digital systems. Master the foundational concepts: logic gate symbols and truth tables for AND, OR, NOT, NAND, NOR, XOR; writing and simplifying Boolean expressions using laws such as Commutative, Associative, Distributive, Absorption, and De Morgan’s; converting between truth tables, expressions, and logic circuits; and understanding the universality of NAND and NOR gates. With consistent practice, you can confidently tackle any IGCSE Computer Science question on this topic.
布尔代数是分析和设计数字系统的强大工具。掌握基础概念:与、或、非、与非、或非、异或门的逻辑门符号和真值表;使用交换律、结合律、分配律、吸收律和德摩根定律等写出并化简布尔表达式;在真值表、表达式和逻辑电路之间进行转换;理解与非门和或非门的通用性。通过持续练习,你就能自信地应对 IGCSE 计算机科学中与此主题相关的任何问题。
Published by TutorHao | Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导