Introduction to Digital Logic

Chapter 4
Logic Simplification and Optimization

Bachelors Program in IT
Introduction to Digital Logic   •   Bachelor

Logic Simplification and Optimization

Introduction

Digital systems are built from logic gates, but a Boolean function can usually be implemented in more than one way. Two circuits may produce identical outputs while differing substantially in gate count, propagation delay, power consumption, cost, reliability, and ease of testing. Logic simplification is therefore not merely an algebraic exercise; it is a design activity that translates a functional specification into an efficient hardware implementation.

This chapter develops four complementary approaches: Boolean-algebraic simplification, Karnaugh maps, the use of don't-care conditions, and introductory tabulation using the Quine–McCluskey method. It also considers practical optimization trade-offs. The objective is not always to produce the expression with the fewest literals. A good implementation must satisfy technological, timing, power, verification, and maintenance constraints.

Learning Objectives

After studying this chapter, you should be able to:

  1. Apply Boolean identities and theorems to simplify logic functions.
  2. Convert between minterm, maxterm, and algebraic representations.
  3. Minimize two-, three-, and four-variable functions using Karnaugh maps.
  4. Use don't-care conditions safely and explain their limitations.
  5. Identify prime implicants and essential prime implicants.
  6. Apply the main stages of the Quine–McCluskey tabulation method.
  7. Compare alternative implementations using gate count, delay, power, cost, and complexity.
  8. Select an implementation appropriate to a practical digital-system requirement.

1. Boolean Functions and Their Implementation

A Boolean variable takes one of two values, 0 or 1. A Boolean function maps one or more Boolean variables to an output. For example,

F(A,B,C) = A B + A'C + BC

uses juxtaposition for AND, + for OR, and a prime (′) for NOT. Thus, A B means A AND B, while A' means NOT A.

A literal is a variable or its complement, such as A or A′. A product term is an AND of literals, and a sum term is an OR of literals. A sum-of-products (SOP) expression is an OR of product terms; a product-of-sums (POS) expression is an AND of sum terms.

A minterm contains every variable exactly once and is 1 for exactly one input combination. For variables A, B, and C, the minterm corresponding to 101 is A B' C. A maxterm is a sum containing every variable exactly once and is 0 for exactly one input combination.

A function may be specified canonically as

F(A,B,C) = Σm(1,3,5,7)

where Σm lists the input-row numbers for which F = 1. Alternatively, the zero rows may be listed as

F(A,B,C) = ΠM(0,2,4,6)

The variables are assumed to be ordered A, B, C, with A as the most significant position. This convention must be stated or understood before interpreting indices.

2. Essential Boolean-Algebraic Identities

The following identities are the principal tools for symbolic simplification. They apply to Boolean variables and expressions.

IdentityExpression
IdentityA + 0 = A; A·1 = A
Null or dominationA + 1 = 1; A·0 = 0
IdempotentA + A = A; A·A = A
ComplementA + A′ = 1; A·A′ = 0
Involution(A′)′ = A
CommutativeA + B = B + A; AB = BA
AssociativeA + (B + C) = (A + B) + C; A(BC) = (AB)C
DistributiveA(B + C) = AB + AC; A + BC = (A + B)(A + C)
AbsorptionA + AB = A; A(A + B) = A
ConsensusAB + A′C + BC = AB + A′C
De Morgan(A + B)′ = A′B′; (AB)′ = A′ + B′

The second distributive identity is especially important because it differs from ordinary algebra. In Boolean algebra, OR distributes over AND as well as AND over OR.

2.1 Algebraic Simplification Examples

Consider

F = AB + AB'.

Factoring gives

F = A(B + B') = A(1) = A.

The original implementation requires two AND operations and one OR operation, whereas the simplified implementation can be a direct connection from A.

As a second example,

F = A + A'B.

Using the identity X + X'Y = X + Y,

F = A + B.

This result can also be derived by inserting 1 as A + A', distributing, and applying absorption. The identity is useful in control logic because a condition B is needed only when A is absent.

The consensus theorem gives

AB + A'C + BC = AB + A'C.

The term BC is redundant: whenever BC = 1, either A = 1, making AB = 1, or A = 0, making A′C = 1. Removing a redundant term can reduce hardware without changing the truth table.

Algebraic manipulation requires care. Terms should not be removed merely because they appear similar. Every deletion must follow from a valid identity or from an equivalent truth-table argument.

3. Two-Level SOP and POS Forms

A two-level SOP circuit consists conceptually of an AND plane followed by an OR plane. For example,

F = A'B + CD + A E'

has three product terms feeding an OR gate. A two-level POS circuit has an OR plane followed by an AND plane, as in

F = (A + B')(C + D)(A' + E).

Minimizing the number of product terms and literals often reduces area and cost in a two-level implementation. However, the physically fastest circuit is not always the expression with the fewest literals. Fan-in limits, unequal gate delays, available library cells, and the use of complemented signals can change the result.

A complemented input may be obtained from an inverter, or it may already be available elsewhere in a larger circuit. Consequently, optimization must consider the complete design rather than one isolated expression.

4. Karnaugh Maps

A Karnaugh map (K-map) is a visual representation of a truth table arranged so that adjacent cells differ in exactly one variable. The map uses Gray-code ordering, such as 00, 01, 11, 10, rather than ordinary binary order. This arrangement makes algebraic adjacency visible.

For an SOP minimization, place 1s in cells corresponding to the function's minterms. Groups may contain 1, 2, 4, 8, or another power of two cells. Groups must be rectangular, and cells may wrap around map edges. Diagonal cells are not adjacent. A group should be as large as possible because each doubled group eliminates one literal.

For a POS minimization, group 0s instead. The resulting groups produce sum terms rather than product terms.

4.1 Reading a Group

Suppose a four-variable group contains cells in which A = 1 and B = 0 while C and D vary. The corresponding product term is A B'. Variables that change within a group disappear; variables that remain constant are retained.

A valid cover must include every required 1 at least once. Overlapping groups are permitted and often necessary. A group is prime if it cannot be enlarged without including a 0 or an unavailable cell. It is essential if it covers at least one required 1 that no other prime implicant covers.

4.2 Worked K-Map Example

Minimize

F(A,B,C,D) = Σm(0,2,3,6,7,8,10,11,14,15)

Group the eight cells with B = 1? The listed cells show a simpler pattern when grouped systematically:

  • The group (2, 3, 6, 7, 10, 11, 14, 15) has C = 1 and consists of all combinations of A, B, and D, producing C.
  • The remaining cells 0 and 8 can be grouped using wraparound with 2 and 10, giving B′D′.

Therefore,

F = C + B'D'

Verification is useful. If C = 1, the function is 1 for every A, B, D, accounting for eight minterms. When C = 0, the function is 1 only when B = 0 and D = 0, accounting for minterms 0 and 8. The expression therefore matches the specified set.

4.3 K-Map Procedure

A reliable procedure is:

  1. Draw the correctly labelled map using Gray-code order.
  2. Enter 1s, 0s, and, where applicable, Xs.
  3. Identify essential prime groups first.
  4. Cover all remaining required 1s with the fewest and largest groups.
  5. Write the term for each group by retaining only constant variables.
  6. Check the result against the original minterm list.

K-maps are highly effective for up to four variables and remain possible, though less convenient, for five or six variables. For larger functions, algorithmic methods or computer-aided synthesis are preferable.

5. Don't-Care Conditions

A don't-care condition is an input combination for which the output is irrelevant, unspecified, or unreachable in the intended system. It is commonly denoted X. During minimization, an X may be treated as either 0 or 1, whichever produces a better implementation. It need not be covered.

For example,

F(A,B,C) = Σm(1,3,7) + d(5)

means that F must be 1 at minterms 1, 3, and 7; its value at minterm 5 is irrelevant. If the X at 5 allows a larger group, it may be included. The resulting circuit is valid only if input 5 genuinely cannot affect system correctness, or if either output value is acceptable there.

Don't-cares must never be used casually. An input described as “unused” may become reachable after a software update, a fault, a reset event, or a change in interface assumptions. The specification should document why the condition is unavailable and what future behavior is permitted.

Don't-cares can also occur in arithmetic circuits. For example, a binary-coded decimal digit uses only 0000 through 1001; codes 1010 through 1111 may be treated as don't-cares if invalid codes are guaranteed not to reach the decoder.

6. Quine–McCluskey Tabulation Method

The Quine–McCluskey method is a systematic alternative to K-maps. It is particularly useful when the number of variables makes a map difficult to read and provides a foundation for computer-based minimization.

The principal stages are:

  1. Express each minterm as a binary pattern.
  2. Group minterms by the number of 1s in their binary representation.
  3. Compare terms in adjacent groups. If two terms differ in exactly one bit, combine them by replacing that bit with a dash (–).
  4. Repeat combinations until no further combination is possible.
  5. Terms that were not combined in a stage are prime implicants.
  6. Construct a prime-implicant chart with required minterms as columns.
  7. Select essential prime implicants, then cover remaining columns with a minimal set.

For example, minterms 4 (0100) and 6 (0110) combine to 01–0 because they differ only in the third bit. A dash means that the corresponding variable is eliminated.

The method separates the search for valid implicants from the selection of a final cover. In larger problems, selecting the smallest cover may itself require a secondary procedure such as Petrick's method or an optimization algorithm. Thus, tabulation is systematic but can become computationally expensive as the number of variables increases.

7. Hazards and Practical Correctness

Algebraically equivalent expressions can behave differently during transitions because real gates have nonzero and unequal propagation delays. A static hazard is a temporary incorrect pulse when the output should remain constant. For example, in a function represented by adjacent product terms, changing an input may cause one term to turn off before another turns on.

A consensus term that is redundant in steady-state Boolean algebra can sometimes be added to eliminate a hazard. For example, although BC is redundant in

F = AB + A'C + BC,

it can provide an overlapping conduction path during a transition between AB and A′C. Consequently, minimum literal count and hazard-free design are not always the same objective.

Hazards are particularly important in asynchronous circuits, clock-gating logic, reset signals, and control paths. Synchronous systems are more tolerant when signals settle before the active clock edge, but timing analysis remains necessary.

8. Optimization Trade-offs

Logic optimization is a multi-objective engineering problem. Common criteria include:

CriterionTypical concernPossible optimization effect
Gate count and areaSilicon or board spaceFewer gates usually reduce area
Propagation delayTime from input change to valid outputAdded levels often increase delay
PowerDynamic switching and leakageFewer transitions and smaller capacitance can reduce power
CostComponents, design, testing, and manufacturingStandard library cells may lower total cost
Fan-in/fan-outElectrical loading and drive capabilityVery large gates may be slow or unavailable
ReliabilityFault exposure and operating marginSimpler circuits may be easier to verify
TestabilityAbility to observe and control internal behaviorHighly factored logic may complicate diagnosis
MaintainabilityEase of modification and reviewReadable structure may be preferable to absolute minimum

A rough conceptual relationship for dynamic CMOS power is

Pdynamic ≈ α CL V² f

where α is the activity factor, C_L is switched load capacitance in farads, V is supply voltage in volts, and f is switching frequency in hertz. This is an engineering approximation; it excludes leakage and short-circuit components and assumes that the relevant switching activity and load are represented by α and C_L. The equation shows why reducing unnecessary transitions, capacitance, or voltage can reduce dynamic power.

Propagation delay depends on technology, loading, fan-out, threshold behavior, and the number of logic levels. Therefore, minimizing literals is not a universal substitute for timing analysis. A factored expression may use fewer gates but create a longer serial path. Conversely, duplicated logic may reduce delay by allowing parallel evaluation, at the cost of area and power.

9. Applied Case: A Conveyor Safety Controller

Background

The following is an illustrative case. A conveyor controller has three inputs: E indicates an emergency-stop condition is clear, G indicates that a protective guard is closed, and S indicates a start request. The motor-enable output M should be 1 only when the guard is closed, the emergency stop is clear, and a start request is present:

M = E G S.

A later requirement adds an automatic restart mode R. In that mode, the motor may run when R = 1 and the safety conditions are satisfied, even if S = 0:

M = EG(S + R).

Analysis

Expanding gives

M = EGS + EGR.

The factored form uses the common safety condition EG once, followed by an OR operation. The expanded form may be convenient if the two enable paths are physically located in different parts of a design, but it duplicates E and G.

Engineering Decision

If the safety signals are stable and the circuit technology supports the required fan-in, the factored implementation generally reduces duplicated logic. However, safety design cannot rely solely on Boolean minimization. The controller should use fail-safe signal conventions, independent monitoring, suitable emergency-stop hardware, and documented behavior for broken wires and invalid states. A mathematically minimal expression is not automatically a safe control system.

Learning Points

  1. Factoring can reduce duplicated hardware.
  2. Safety requirements constrain permissible don't-care assumptions.
  3. Hazard, fault, diagnostic, and certification requirements may justify additional circuitry.
  4. Functional equivalence must be checked against both normal and abnormal operating conditions.

10. Best Practices and Limitations

Use a truth table or formal specification before simplifying. State variable order explicitly when using minterm numbers. Prefer large valid K-map groups, but do not include a don't-care unless its assumption is documented. Verify a minimized expression by substitution, simulation, or formal equivalence checking.

Avoid relying on visual intuition when maps contain wraparound groups. Do not assume that fewer gates always means lower delay or power. Check fan-in limits and whether complemented signals are available. In safety-critical, medical, automotive, or industrial systems, optimization must be subordinate to validated requirements, hazard analysis, redundancy, and applicable standards.

Modern synthesis tools perform Boolean minimization, factoring, technology mapping, timing optimization, and power estimation. Designers still need the underlying theory to constrain tools correctly, recognize unsuitable assumptions, interpret reports, and detect a mismatch between a formal function and the actual system specification. AI-assisted design may suggest simplifications, but every result requires independent verification because an apparently valid simplification can silently exploit an invalid don't-care assumption or omit a required operating state.

Chapter Summary

Logic simplification transforms a Boolean specification into a more economical or better-performing implementation. Boolean identities provide symbolic methods, while Karnaugh maps offer a visual method based on adjacency and grouping. SOP minimization groups 1s; POS minimization groups 0s. Prime implicants are maximal valid groups, and essential prime implicants cover required minterms that no alternative prime implicant covers.

Don't-care conditions can produce substantially simpler circuits, but only when the associated input combinations are genuinely irrelevant or unreachable. The Quine–McCluskey method provides a systematic tabulation approach suitable for larger functions and computer implementation. Finally, optimization must balance area, delay, power, cost, fan-in, reliability, testability, and maintainability. Algebraic minimality is therefore one design objective among several, not the definition of a successful digital system.

Key Terms

Boolean function: A mapping from Boolean inputs to a Boolean output.

Literal: A variable or its complement.

Minterm: A product term containing every variable exactly once.

Maxterm: A sum term containing every variable exactly once.

SOP: Sum-of-products form.

POS: Product-of-sums form.

Truth table: A complete listing of input combinations and corresponding outputs.

Karnaugh map: A Gray-code-organized visual representation of a Boolean function.

Adjacency: A relationship between map cells differing in one variable.

Implicant: A product term that never produces 1 where the function is 0.

Prime implicant: An implicant that cannot be enlarged further.

Essential prime implicant: A prime implicant covering a required minterm covered by no other prime implicant.

Don't-care condition: An input combination whose output may be assigned 0 or 1 for optimization.

Consensus term: A logically redundant term that may assist hazard elimination.

Static hazard: A temporary output glitch caused by unequal propagation delays.

Propagation delay: The time between an input transition and the corresponding valid output transition.

Fan-in: The number of inputs accepted by a gate.

Fan-out: The number of loads driven by a gate output.

Quine–McCluskey method: A tabulation-based Boolean minimization procedure.

Technology mapping: Conversion of logic into cells or gates available in a target technology.

Review Questions

Short Answer Questions

  1. Distinguish between a minterm and a maxterm.
  2. Why are Karnaugh-map columns and rows arranged in Gray-code order?
  3. What is an essential prime implicant?
  4. Under what condition may a don't-care cell be included in a K-map group?
  5. State two practical reasons why a minimum-literal expression may not be the best implementation.

Long Answer Questions

  1. Explain the major Boolean identities used in algebraic simplification and illustrate at least four with examples.
  2. Describe a complete procedure for minimizing a four-variable SOP function using a Karnaugh map.
  3. Explain the Quine–McCluskey method, including combination, prime-implicant identification, and chart selection.
  4. Discuss how gate count, propagation delay, fan-in, power, and testability can conflict during optimization.
  5. Explain hazards and why a redundant consensus term may be deliberately retained.

Analytical / Application Questions

  1. Minimize F(A,B,C,D) = Σm(0,1,4,5,8,9,12,13) using a Karnaugh map and verify the result against the minterm list.
  2. A controller is specified as F = AB + A'C + BC. Simplify it algebraically, then discuss whether retaining BC could be justified in a real circuit.
  3. A four-bit decimal decoder treats codes 1010–1111 as invalid. Explain how these states may be used as don't-cares and identify one safety or maintenance risk of doing so.

Multiple Choice Questions with Answers

Question 1

Which Boolean identity simplifies AB + AB' to A?

A. Complement and factoring

B. Absorption only

C. De Morgan's theorem

D. Consensus theorem

Correct Answer: A. Complement and factoring

Question 2

In a Karnaugh map for SOP minimization, which cells are grouped?

A. Only 0-cells

B. Required 1-cells, optionally including valid don't-cares

C. Diagonal cells only

D. All cells regardless of value

Correct Answer: B. Required 1-cells, optionally including valid don't-cares

Question 3

What is the correct Gray-code order for two variables?

A. 00, 01, 10, 11

B. 00, 10, 01, 11

C. 00, 01, 11, 10

D. 11, 00, 10, 01

Correct Answer: C. 00, 01, 11, 10

Question 4

What happens to a variable that changes within a valid K-map group?

A. It appears complemented in the result

B. It is eliminated from the resulting term

C. It must be repeated twice

D. It determines the group number

Correct Answer: B. It is eliminated from the resulting term

Question 5

A don't-care condition may be treated as 0 or 1 when:

A. The designer prefers either value without specification

B. The input is guaranteed irrelevant or unreachable

C. The output is connected to an inverter

D. The map contains no required 1s

Correct Answer: B. The input is guaranteed irrelevant or unreachable

Question 6

Which expression is obtained from the consensus theorem applied to AB + A'C + BC?

A. AB + A'C

B. AB + BC

C. A'C + BC

D. ABC

Correct Answer: A. AB + A'C

Question 7

In the Quine–McCluskey method, two binary terms can be combined when they:

A. Have the same number of 1s

B. Differ in exactly one bit position

C. Contain no complemented variables

D. Represent adjacent decimal numbers only

Correct Answer: B. Differ in exactly one bit position

Question 8

In Pdynamic ≈ α CL V² f, what does CL represent?

A. Logic activity factor

B. Supply voltage

C. Switched load capacitance

D. Clock frequency

Correct Answer: C. Switched load capacitance

Question 9

Which design feature can reduce delay but increase area and power?

A. Duplicating logic for parallel evaluation

B. Removing all input paths

C. Replacing every gate with an inverter

D. Ignoring fan-out

Correct Answer: A. Duplicating logic for parallel evaluation

Question 10

Why might a redundant Boolean term be retained in a practical circuit?

A. To create a static hazard

B. To eliminate every inverter automatically

C. To provide hazard protection during transitions

D. To change the truth table at steady state

Correct Answer: C. To provide hazard protection during transitions

Introduction to Digital Logic
Chapter 4 of 15