📚 GCSE AQA Computer Science: Boolean Algebra – Key Points Explained | GCSE AQA 计算机科学:布尔代数 考点精讲
Boolean algebra is a cornerstone of digital logic and computer science. At GCSE level, AQA expects you to understand the fundamental logic operations, be able to construct and interpret truth tables, simplify Boolean expressions using algebraic laws, and relate them to logic gates. This article breaks down every essential concept, providing clear explanations, worked examples, and exam-focused tips to help you master Boolean algebra with confidence.
布尔代数是数字逻辑和计算机科学的基石。在 GCSE 阶段,AQA 考试要求你理解基本的逻辑运算,能够构建并解读真值表,使用代数定律简化布尔表达式,并将其与逻辑门关联起来。本文将逐一剖析每个核心概念,提供清晰的解释、实例演练和面向考试的技巧,帮助你自信掌握布尔代数。
1. What is Boolean Algebra? | 什么是布尔代数?
Boolean algebra is a branch of algebra where variables can only have one of two possible values: TRUE or FALSE. It was developed by George Boole in the 19th century and forms the mathematical basis of all modern digital circuits. In computer science, TRUE is typically represented by the binary digit 1, and FALSE by 0. Because electronic components can easily represent two states (on/off), Boolean algebra is the natural language for designing and analysing logic circuits and programming conditions.
布尔代数是代数的一个分支,其中的变量只能取两个可能值之一:真 (TRUE) 或假 (FALSE)。19世纪由乔治·布尔提出,构成了所有现代数字电路的数学基础。在计算机科学中,TRUE 通常用二进制数字 1 表示,FALSE 用 0 表示。由于电子元件可以轻松表示两种状态(开/关),布尔代数便成为设计和分析逻辑电路以及编程条件的自然语言。
2. Boolean Variables and Values | 布尔变量与值
In Boolean algebra we use letters such as A, B, C, and X to represent Boolean variables. Each variable can be assigned the value 0 (false) or 1 (true). These values are not numbers in the arithmetic sense; they represent logical states. An expression like A + B does not mean ordinary addition—it stands for the logical OR operation. You will often see a high voltage represented as 1 and a low voltage as 0 in circuit diagrams.
在布尔代数中,我们用 A、B、C、X 等字母表示布尔变量。每个变量可以被赋值为 0(假)或 1(真)。这些值并不是算术意义上的数字;它们代表逻辑状态。像 A + B 这样的表达式并不表示普通加法——它代表逻辑“或”运算。你经常会在电路图中看到高电平表示为 1,低电平表示为 0。
3. Basic Logic Operations: AND, OR, NOT | 基本逻辑运算:AND、OR、NOT
The three elementary operations are AND, OR and NOT. AND is denoted by a dot (·) or simply by writing variables next to each other; A · B is true only when both A and B are true. OR is denoted by a plus sign (+); A + B is true when at least one of A or B is true. NOT is a unary operation, often shown with a bar over the variable (Ā) or a negation symbol (¬A); it inverts the value—if A is 1, ¬A is 0. These operations match the behaviour of logic gates you will study later.
三种基本运算是 AND、OR 和 NOT。AND 用点(·)或直接将变量并写表示;A · B 仅在 A 和 B 都为真时结果为真。OR 用加号(+)表示;A + B 在 A 或 B 至少一个为真时结果为真。NOT 是一元运算,通常在变量上方加横线(Ā)或用否定符号(¬A)表示;它会反转值——如果 A 为 1,则 ¬A 为 0。这些运算与你稍后将学习的逻辑门行为完全一致。
Common alternative notations exist: AND can be written as A ∧ B, OR as A ∨ B, and NOT as A’. However, AQA exam papers predominantly use the dot, plus and overbar conventions, so it is safest to stick to A · B, A + B and ¬A (or A̅).
常见的替代记法也存在:AND 可写作 A ∧ B,OR 可写作 A ∨ B,NOT 可写作 A’。但 AQA 试卷主要使用点、加号和上划线记法,因此使用 A · B、A + B 和 ¬A(或 A̅)是最稳妥的。
4. Truth Tables | 真值表
A truth table lists every possible combination of input values and the corresponding output of a Boolean expression. For n inputs there are 2ⁿ rows. The table helps verify the behaviour of a logic circuit and is a common requirement in exam questions.
真值表列出了输入值每一种可能的组合以及布尔表达式对应的输出。对于 n 个输入,共有 2ⁿ 行。该表格有助于验证逻辑电路的行为,也是考试中常见的考查内容。
Below are the truth tables for AND, OR and NOT with two inputs A and B. NOT has only one input.
以下是针对两个输入 A 和 B 的 AND、OR 和 NOT 的真值表。NOT 只有一个输入。
| A | B | A · B (AND) | A + B (OR) | ¬A (NOT) |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 |
Notice that AND outputs 1 only when both inputs are 1; OR outputs 0 only when both inputs are 0; NOT simply flips the single input.
请注意,AND 仅在两个输入都为 1 时输出 1;OR 仅在两个输入都为 0 时输出 0;NOT 简单地翻转单一输入的值。
5. Boolean Expressions and Logic Diagrams | 布尔表达式与逻辑图
A Boolean expression can be drawn as a logic diagram using standard gate symbols. For instance, the expression Q = (A · B) + C means: A AND B first, then OR with C. The brackets are essential because without them, due to precedence rules, the AND would be evaluated before the OR anyway, but brackets make the intended order explicit.
布尔表达式可以用标准门符号画出逻辑图。例如,表达式 Q = (A · B) + C 表示:先计算 A AND B,然后再与 C 进行 OR 运算。括号至关重要,因为如果没有括号,根据优先级规则 AND 也会先于 OR 计算,但括号能使意图更加明确。
In the exam you may be asked to draw a logic circuit from an expression or to write the expression from a given diagram. Always check the number of inputs and the type of gates used: AND (D-shaped), OR (curved pointed shape), NOT (triangle with a bubble).
在考试中,你可能会被要求根据表达式画出逻辑电路,或根据给定图形写出表达式。一定要核对输入数量和所用门的类型:AND(D 形),OR(弧形尖头),NOT(带小圆圈的三角)。
6. Order of Precedence in Boolean Operations | 布尔运算的优先级
Just like in ordinary algebra, Boolean operations follow a strict hierarchy: NOT has the highest precedence, followed by AND, and finally OR. This means that in an expression like ¬A · B + C, the NOT is applied first to A, then the AND between ¬A and B, and lastly the OR with C. To override this order you must use brackets. Always evaluate brackets from the innermost outward.
就像普通代数一样,布尔运算遵循严格的层次:NOT 优先级最高,其次是 AND,最后是 OR。这意味着在表达式 ¬A · B + C 中,先对 A 进行 NOT 运算,然后将 ¬A 与 B 做 AND,最后再与 C 做 OR。若要改变此顺序,必须使用括号。计算时始终从最内层括号开始向外计算。
Exam tip: When simplifying, insert implied brackets according to precedence to avoid mistakes. For A + B · C, treat it as A + (B · C).
考试技巧:在化简时,根据优先级插入隐含的括号以避免错误。对于 A + B · C,应视为 A + (B · C)。
7. Boolean Identities and Laws | 布尔恒等式与定律
A set of fundamental laws allows you to manipulate and simplify Boolean expressions without changing the output. These laws are often examined in AQA papers. The most important ones include:
一组基本定律允许你变换和简化布尔表达式而不会改变输出结果。这些定律经常在 AQA 试卷中考查。最重要的定律包括:
Identity Law: A + 0 = A, A · 1 = A
Null Law: A + 1 = 1, A · 0 = 0
Idempotent Law: A + A = A, A · A = A
Inverse Law: A + ¬A = 1, A · ¬A = 0
Commutative Law: A + B = B + A, A · B = B · A
Associative Law: (A + B) + C = A + (B + C), (A · B) · C = A · (B · C)
Distributive Law: A · (B + C) = A·B + A·C, A + (B·C) = (A+B)·(A+C)
Absorption Law: A + (A·B) = A, A · (A+B) = A
De Morgan’s Laws: ¬(A·B) = ¬A + ¬B, ¬(A+B) = ¬A·¬B
同一律: 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 + 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
德摩根定律: ¬(A·B) = ¬A + ¬B,¬(A+B) = ¬A·¬B
De Morgan’s laws are particularly useful for converting NAND and NOR logic into AND, OR and NOT forms, and are guaranteed to appear in exams.
德摩根定律在将 NAND 和 NOR 逻辑转换为 AND、OR 和 NOT 形式时特别有用,也是考试中必考的内容。
8. Simplifying Boolean Expressions | 简化布尔表达式
Boolean expressions can often be written in a much simpler form that uses fewer logic gates. Algebraic simplification relies on applying the laws from the previous section. For example, consider the expression A·B + A·¬B. Using the distributive law, we factor A out: A·(B + ¬B). By the inverse law B + ¬B = 1, and applying the identity law A·1 = A. The expression therefore simplifies to just A.
布尔表达式通常可以写成更简单的形式,从而使用更少的逻辑门。代数化简依赖于应用上一节中的定律。例如,考虑表达式 A·B + A·¬B。使用分配律,提取公因子 A:A·(B + ¬B)。根据互补律 B + ¬B = 1,再应用同一律 A·1 = A。因此该表达式简化为 A。
Another powerful technique uses De Morgan to eliminate long negation bars. Suppose you have ¬(¬A + B). Apply De Morgan: ¬(¬A + B) = ¬(¬A) · ¬B = A·¬B (since ¬(¬A) = A). Always check your simplified expression by building a truth table to ensure equivalence.
另一种强大的技巧是使用德摩根定律消除长否定横线。假设你有 ¬(¬A + B)。应用德摩根定律:¬(¬A + B) = ¬(¬A) · ¬B = A·¬B(因为 ¬(¬A) = A)。简化后务必通过建立真值表来验证表达式是否等价。
In the exam you may also be asked to simplify using Karnaugh maps, but for AQA GCSE the algebraic method is the primary focus.
考试中也可能要求使用卡诺图进行化简,但 AQA GCSE 阶段主要侧重于代数方法。
9. From Truth Tables to Boolean Expressions | 从真值表到布尔表达式
Given a truth table, you can write a Boolean expression in Sum-of-Products (SOP) form. For each row where the output is 1, write the minterm: AND together all inputs, using the true variable if the input is 1 and the complemented variable if the input is 0. Then OR all these minterms together.
给定一个真值表,你可以写出“积之和”(SOP)形式的布尔表达式。对于每个输出为 1 的行,写出最小项:将所有输入用 AND 连接,若输入为 1 则用原变量,若输入为 0 则用反变量。然后将所有这些最小项用 OR 连接。
Example: a function F(A,B) with outputs 1 for input combinations A=0,B=1 and A=1,B=1. The SOP expression is F = ¬A·B + A·B. This can then be simplified to F = B·(¬A + A) = B·1 = B.
示例:函数 F(A,B) 在输入 A=0,B=1 和 A=1,B=1 时输出为 1。积之和表达式为 F = ¬A·B + A·B。进而可以化简为 F = B·(¬A + A) = B·1 = B。
This method guarantees you can derive a correct expression, which you can later minimise using algebra.
此方法能保证你推导出正确的表达式,之后可通过代数方法将其最小化。
10. Logic Gates and Universal Gates | 逻辑门与通用门
Logic gates are the physical implementations of Boolean operations. AQA GCSE candidates need to recognise the symbols for AND, OR, NOT, NAND, NOR and XOR gates and understand their truth tables.
逻辑门是布尔运算的物理实现。AQA GCSE 考生需要认识 AND、OR、NOT、NAND、NOR 和 XOR 门的符号,并理解它们的真值表。
- AND gate: output is 1 only if all inputs are 1.
- OR gate: output is 1 if at least one input is 1.
- NOT gate: single input inverter.
- NAND gate: opposite of AND; output is 0 only when all inputs are 1.
- NOR gate: opposite of OR; output is 1 only when all inputs are 0.
- XOR gate: output is 1 if an odd number of inputs are 1 (for two inputs, exactly one input is 1).
- AND 门:仅当所有输入为 1 时输出为 1。
- OR 门:至少一个输入为 1 时输出为 1。
- NOT 门:单输入反相器。
- NAND 门:与 AND 相反;仅在所有输入为 1 时输出为 0。
- NOR 门:与 OR 相反;仅在所有输入为 0 时输出为 1。
- XOR 门:当输入中 1 的个数为奇数时输出为 1(对于两个输入,恰好一个输入为 1)。
NAND and NOR are called universal gates because any other gate can be constructed solely from NAND gates or solely from NOR gates. For example, a NOT gate can be made by connecting both inputs of a NAND gate together. This concept is frequently tested in higher-tier questions.
NAND 和 NOR 被称为通用门,因为任何其他门都可以仅用 NAND 门或仅用 NOR 门构建。例如,将 NAND 门的两个输入端连接在一起就可构成一个 NOT 门。这一概念在高阶试题中经常考查。
11. Boolean Algebra in Programming | 布尔代数在编程中的应用
Boolean logic permeates programming. Conditional statements (if, while) rely on Boolean expressions. In Python, the operators and, or and not behave exactly like the Boolean operations you have learned. Short-circuit evaluation also follows Boolean rules: in A and B, if A is false, B is not evaluated because the whole expression is already false. Understanding Boolean algebra helps you write efficient and bug-free conditions.
布尔逻辑渗透到编程的方方面面。条件语句(if、while)依赖于布尔表达式。在 Python 中,and、or 和 not 操作符的行为与你所学过的布尔运算完全一致。短路求值同样遵循布尔规则:在 A and B 中,若 A 为假,则不会计算 B,因为整个表达式已经为假。理解布尔代数有助于你编写高效且无 bug 的条件语句。
Bitwise operations in low-level programming also use Boolean logic on each bit of binary numbers. Masking, toggling, and setting bits are direct applications of AND, OR and XOR.
底层编程中的按位运算同样对二进制数的每一位使用布尔逻辑。掩码运算、位翻转和置位操作都是 AND、OR 和 XOR 的直接应用。
12. Common Exam Mistakes and How to Avoid Them | 常见考试错误与规避方法
Many students lose marks by confusing the symbols: remember that + means OR, not arithmetic addition; the dot is AND, and a missing operator implies AND. Never write A + B = 1 + 0 = 1 as if doing decimal addition—always treat it logically.
许多学生因为混淆符号而失分:记住 + 代表 OR,而不是算术加法;点号代表 AND,省略操作符也隐含 AND。绝不要像做十进制加法那样写 A + B = 1 + 0 = 1——始终用逻辑方式看待。
Another common error is misapplying De Morgan’s laws. Students often forget to change the sign and negate both variables. Remind yourself: break the bar, change the sign. ¬(A·B) becomes ¬A + ¬B.
另一个常见错误是错误应用德摩根定律。同学们常常忘记改变运算符并对两个变量取反。提醒自己:断开横线,改变符号。¬(A·B) 变为 ¬A + ¬B。
Also, when constructing a truth table from an expression, be systematic: list all input combinations in binary order (00, 01, 10, 11) and work step by step. Check a few rows by substituting values directly into the original expression to verify your simplified result matches.
此外,在根据表达式构建真值表时,要有条理:按二进制顺序列出所有输入组合(00, 01, 10, 11),并分步计算。通过将值直接代入原始表达式来验证简化后的结果是否一致。
Finally, practice past-paper questions. AQA frequently asks you to simplify an expression and then draw the resulting logic circuit. Mark schemes often award marks for correct intermediate steps even if the final answer is wrong, so show your working clearly.
最后,多练习历年真题。AQA 经常要求你先化简表达式,然后画出相应的逻辑电路。评分方案通常会在中间步骤正确时给予分数,即使最终答案有误,因此务必清晰地展示你的推导过程。
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课程辅导,国外大学本科硕士研究生博士课程论文辅导