A-Level OCR Computer Science: Boolean Algebra | 布尔代数考点精讲

📚 A-Level OCR Computer Science: Boolean Algebra | 布尔代数考点精讲

Boolean algebra is the mathematical foundation of digital circuit design. In the OCR A-Level Computer Science specification, you need to manipulate logical expressions using laws and theorems, simplify combinational logic, and convert seamlessly between truth tables, Boolean expressions, logic diagrams, and Karnaugh maps. This guide covers every essential sub-topic with worked examples, memorisation strategies, and exam-focused commentary.

布尔代数是数字电路设计的数学基础。在 OCR A-Level 计算机科学考试中,你需要使用定律和定理操作逻辑表达式、化简组合逻辑,并在真值表、布尔表达式、逻辑电路图和卡诺图之间自如转换。本文涵盖所有必考子专题,配有工作示例、记忆技巧和应试分析。


1. Boolean Variables, Constants and Basic Operators | 布尔变量、常量与基本运算符

Boolean algebra operates on binary variables that can only equal 0 or 1. The three fundamental operations are conjunction (AND), disjunction (OR), and negation (NOT). In OCR exams you will often see the dot (·) for AND, the plus (+) for OR, and an overbar or prime (‘) for NOT, e.g. A’ or ¬A. Expressions are evaluated with NOT first, then AND, then OR, unless parentheses change the order.

布尔代数处理只取 0 或 1 的二进制变量。三种基本运算是与(AND)、或(OR)和非(NOT)。在 OCR 考试中,与常用点号(·)表示,或用加号(+),非用上划线或撇号(’),如 A’ 或 ¬A。表达式求值优先顺序为 NOT、AND、OR,除非括号改变顺序。

  • A · B is true only when both A and B are true.
  • A · B 仅在 A 和 B 同时为真时为真。
  • A + B is true when at least one input is true.
  • A + B 在至少一个输入为真时为真。
  • A’ inverts the value: 1 becomes 0, 0 becomes 1.
  • A’ 反转取值:1 变 0,0 变 1。

2. Truth Tables and Expression Evaluation | 真值表与表达式求值

A truth table lists every possible combination of inputs and the corresponding output. For n variables there are 2ⁿ rows. Constructing a truth table from an expression involves creating columns for intermediate terms, applying precedence. You must be able to verify equivalence of two expressions by showing they produce identical output columns.

真值表列出所有可能的输入组合及其对应输出。n 个变量有 2ⁿ 行。从表达式构建真值表需为中间项建列,按优先级求值。你必须能够通过展示两个表达式产生相同输出列来验证它们等价。

Example expression: F = A · B + A’ · C. For three variables, you would list columns for A, B, C, then A’, A·B, A’·C, and finally F.

示例表达式:F = A · B + A’ · C。对于三个变量,先列出 A、B、C,再列出 A’、A·B、A’·C,最后求 F。


3. Basic Laws: Commutative, Associative, Distributive | 基本定律:交换律、结合律、分配律

These laws allow you to rearrange and expand Boolean expressions without changing their meaning.

这些定律使你能够重新排列和展开布尔表达式而不改变含义。

Commutative laws: A + B = B + A and A · B = B · A.

交换律:A + B = B + A,A · B = B · A。

Associative laws: (A + B) + C = A + (B + C) and (A · B) · C = A · (B · C).

结合律:(A + B) + C = A + (B + C),(A · B) · C = A · (B · C)。

Distributive laws: A · (B + C) = A·B + A·C; also the less intuitive A + B·C = (A + B) · (A + C).

分配律:A · (B + C) = A·B + A·C;还有不太直观的 A + B·C = (A + B) · (A + C)。

OCR often tests the second distributive law in simplifications. Memorise it by analogy with expanding brackets but remember the OR form.

OCR 常在化简中考察第二条分配律。可以类比展开括号来记忆,但要记住 OR 形式的规律。


4. Identity, Annihilator and Complement Laws | 恒等律、零律和补元律

These are fundamental simplifications you must apply instantly:

以下是必须瞬间应用的基本化简规则:

Law Expression 中文
Identity A + 0 = A; A · 1 = A A + 0 = A; A · 1 = A
Annihilator A + 1 = 1; A · 0 = 0 A + 1 = 1; A · 0 = 0
Complement A + A’ = 1; A · A’ = 0 A + A’ = 1; A · A’ = 0
Idempotent A + A = A; A · A = A A + A = A; A · A = A
Double negation (A’)’ = A (A’)’ = A

Using these laws you can collapse large sub-expressions to a single constant or variable, saving time in K-map and algebraic simplification.

利用这些定律可以将大型子表达式坍缩为单个常量或变量,在卡诺图与代数化简中节省大量时间。


5. De Morgan’s Theorems | 德摩根定理

De Morgan’s laws are central to logic simplification, gate conversion, and NAND/NOR implementations. They state:

德摩根定律是逻辑化简、门电路转换及 NAND/NOR 实现的核心。其表述为:

(A + B)’ = A’ · B’   and   (A · B)’ = A’ + B’

Break the bar and change the sign: when you push the complement over a product or sum, the operator flips from AND to OR and vice versa. In OCR exams you often need to prove De Morgan using truth tables or apply the law to remove complements from complex sub-expressions.

断杠换号:当你将补运算推到乘积或和上时,操作符从 AND 变为 OR,反之亦然。OCR 考试常要求用真值表证明德摩根定理,或应用该法则从复杂子表达式中消去补运算。

Example: (A + B’ · C)’ = A’ · (B’ · C)’ = A’ · (B + C’). Always apply step by step.

示例:(A + B’ · C)’ = A’ · (B’ · C)’ = A’ · (B + C’)。务必逐步应用。


6. Absorption and Advanced Reduction Laws | 吸收律及高级化简定律

Absorption laws let you eliminate redundant terms. The two most tested forms are:

吸收律允许你消除冗余项。最常考的两个形式为:

A + A·B = A

A · (A + B) = A

The logic is that if A is true, the entire OR expression is true regardless of B; if A is true in the AND, the outcome depends only on A. There is also a third valuable form: A + A’·B = A + B, because A’·B can only be true when A = 0, making it equivalent to B once A is removed.

逻辑在于:如果 A 为真,无论 B 如何整个 OR 表达式为真;在 AND 形式中,如果 A 为真结果仅取决于 A。还有第三种实用形式:A + A’·B = A + B,因为 A’·B 只有在 A = 0 时才可能为真,消去 A 后等价于 B。

OCR might ask you to prove absorption via truth table or algebraic derivation. Always reference the justification.

OCR 可能要求通过真值表或代数推导证明吸收律。始终要给出依据。


7. Algebraic Simplification Workflow | 代数化简工作流程

To simplify a Boolean expression using laws, follow this systematic method:

使用定律化简布尔表达式,应遵循这套系统方法:

  • Remove any double negation and apply De Morgan to move complements inward.
  • 消除双重非号,应用德摩根定理将补运算内移。
  • Expand using distributive law where helpful, then apply absorption, idempotent and complement laws.
  • 在必要时用分配律展开,然后应用吸收律、幂等律和补元律。
  • Group terms to reveal common factors: e.g. A·B + A·C = A·(B + C).
  • 将项分组以提取公因式,例如 A·B + A·C = A·(B + C)。
  • Check if any term and its complement reduce to constant. Finally, rewrite in sum-of-products (SOP) form if required.
  • 检查是否有项及其补可约简为常量。最后,如需要改写为积之和(SOP)形式。

Example: F = A·B + A·B’ = A·(B + B’) = A·1 = A. Recognise such patterns quickly to score full marks.

例题:F = A·B + A·B’ = A·(B + B’) = A·1 = A。迅速识别这种模式即可全分到手。


8. Karnaugh Maps: Structure and Construction | 卡诺图:结构与构建

A K-map provides a visual method to minimise Boolean expressions. For 2, 3, or 4 variables, it uses a Gray-coded grid where adjacent cells differ by exactly one variable. In OCR you must be able to draw a 3-variable or 4-variable K-map from an expression or truth table, place 1s in the correct cells, and optionally handle don’t-care conditions (X).

卡诺图提供了化简布尔表达式的可视化方法。对于 2、3 或 4 个变量,它使用格雷码网格,相邻格仅有一个变量不同。在 OCR 考试中,你必须能从表达式或真值表画出三变量或四变量卡诺图,在正确格子中填入 1,并可处理无关项(X)。

A 3-variable map is often ordered: AB (rows) 00, 01, 11, 10; C (columns) 0,1. Always label so that only one bit changes between adjacent rows/columns.

三变量图通常按顺序:行 AB 取 00、01、11、10;列 C 取 0、1。务必使相邻行/列只有一位变化。


9. Simplification Using K-maps: Prime Implicants and Minimum SOP | 使用卡诺图化简:质蕴含项与最小 SOP

Group adjacent 1s into rectangles of size 1, 2, 4, 8 (powers of two). Each group corresponds to a product term where variables that change within the group are eliminated. OCR expects you to find the essential prime implicants and cover all 1s with the fewest groups. Write the final minimal sum-of-products (SOP) expression.

将相邻的 1 圈成大小为 1、2、4、8(2 的幂)的矩形。每个圈对应一个乘积项,其中在组内变化的变量被消去。OCR 期望你找出基本质蕴含项,并用最少的圈覆盖所有 1。写出最终最小积之和表达式。

Example: a 4-variable K-map with 1s in cells 0,1,4,5 yields A’·C’ after grouping. Always check for wraparound adjacency (top-bottom, left-right).

示例:一个四变量卡诺图中 0,1,4,5 格为 1,圈成一组后得到 A’·C’。始终检查上下、左右的循环相邻性。


10. Converting Between Logic Circuits, Expressions and Truth Tables | 逻辑电路、表达式与真值表互转

OCR exam questions frequently ask you to move between these three representations:

OCR 试题常要求在这三种表示间转换:

  • Circuit to expression: trace from inputs to output, writing the Boolean sub-expression at each gate.
  • 电路到表达式:从输入端追踪到输出端,在每个门处写出布尔子表达式。
  • Expression to circuit: draw AND gates for product terms, OR gate to combine them, add inverters for complemented variables.
  • 表达式到电路:为乘积项画与门,用或门将其组合,为取反变量添加非门。
  • Truth table to expression: write a sum-of-products where each row with output 1 becomes a minterm (e.g. A’·B·C).
  • 真值表到表达式:写出积之和,其中输出为 1 的每一行成为一个最小项(如 A’·B·C)。
  • Expression to truth table: evaluate for all input combinations.
  • 表达式到真值表:对所有输入组合求值。

Being fluent in these transformations is essential because OCR often embeds such tasks inside a larger simplification problem.

熟练这些转换至关重要,因为 OCR 常将此类任务嵌入更大的化简问题中。


11. XOR, XNOR and NAND/NOR Universality | 异或、同或与 NAND/NOR 的通用性

The XOR (exclusive-OR) gate outputs 1 when inputs differ: A ⊕ B = A·B’ + A’·B. The XNOR (equivalence) outputs 1 when inputs are equal. NAND and NOR are called universal gates because any Boolean function can be implemented using only NAND gates, or only NOR gates. OCR may ask you to convert a logic diagram into NAND-only form, which typically involves adding bubble pairs and applying De Morgan.

异或门在输入不同时输出 1:A ⊕ B = A·B’ + A’·B。同或门(等价)在输入相同时输出 1。NAND 和 NOR 被称为通用门,因为任何布尔函数都可用全 NAND 门或全 NOR 门实现。OCR 可能要求你将逻辑图转换为仅含 NAND 门的形式,通常需要添加气泡对并应用德摩根定理。

NAND-only conversion rule: replace AND-OR structure with NAND-NAND; add an inverter to single variable if needed using a NAND with tied inputs.

全 NAND 转换规则:用 NAND-NAND 结构替换 AND-OR 结构;若需要,可用输入端短接的 NAND 实现非门。


12. Exam Technique and Common Pitfalls | 应试技巧与常见陷阱

Always show your working step by step; OCR marks process as well as final answer. When simplifying with laws, quote the law used. In K-maps, draw maps neatly and label axis variables with clarity. Avoid creating groups that are not rectangular or that are not powers of two. Never leave a 1 isolated if it can be combined with adjacent cells – check all wraparounds. For De Morgan, break the bar gradually and flip the operator correctly; a misplaced AND/OR flip costs marks. Finally, double-check your final expression by testing a few input combinations against the original truth table.

始终逐步展示解题过程;OCR 既给过程分也给结果分。用定律化简时,注明所用的定律。画卡诺图时,请整洁清晰,标注坐标变量。切勿创建非矩形或大小非 2 的幂次的组。如果某个 1 可以与相邻格组合,绝不要将其孤立——检查所有循环相邻。处理德摩根时,逐步“断杠”,正确翻转操作符;一次 AND/OR 翻转错误就会失分。最后,用几个输入组合对照原始真值表检验最终表达式。

Common error: forgetting that A + A’B simplifies to A + B, or trying to group 1s in a K-map diagonally. Practice past paper questions under timed conditions to build speed.

常见错误:忘记 A + A’B 化简为 A + B,或在卡诺图中尝试沿对角线分组。在限时条件下练习往年真题以提升速度。

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

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

Comments

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

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