Module 2: Combinational Circuit Design · 2.4 Hazards in Combinational Logic

A Procedure for Hazard-Free Design

In previous articles, we established that physical path delay skews create combinational glitches. Eliminating hazards does not require trial-and-error simulation. For two-level Sum-of-Products (SOP) and Product-of-Sums (POS) circuits, a deterministic 4-step procedure identifies and eliminates all static hazards. This procedure ensures that asynchronous signals, write enables, and reset networks operate without glitching.

The Four-Step Hazard-Free Design Procedure

Apply these sequential steps to design a hazard-free combinational circuit:

  1. Step 1: Enumerate Adjacent Candidate Pairs: Static hazards occur exclusively during single-variable transitions between adjacent states with identical output values.
    • For static-1 hazards: Identify every pair of geometrically adjacent 1-cells on the Karnaugh map.
    • For static-0 hazards: Identify every pair of geometrically adjacent 0-cells on the Karnaugh map.
  2. Step 2: Verify Group Coverage: For each adjacent pair, verify whether at least one product term (or sum term) in the logic cover encloses both cells simultaneously.
    • If both cells share a common group: The transition is glitch-free.
    • If the cells belong to separate groups: A static hazard exists along that transition.
  3. Step 3: Insert Consensus Bridging Implicants: For each uncovered adjacent pair, add a redundant consensus term that covers both cells. The bridging term must depend only on the invariant variables, remaining independent of the switching variable.
  4. Step 4: Re-Verify the Complete Map: Re-examine all adjacent pairs to ensure complete overlap. Adding an implicant increases coverage and never introduces new static hazards.

Comprehensive Verification Example

Analyze the function:

$$F(A, B, C) = \sum m(0, 2, 4, 6, 7)$$

Figure 1 illustrates the Karnaugh map:

Worked example
Figure 1: Karnaugh map for F = Σm(0,2,4,6,7) showing complete hazard-free coverage

The algebraically minimal cover requires two prime implicants:

  • Group 1 (cells 0, 2, 4, 6): $\overline{C}$
  • Group 2 (cells 6, 7): $AB$

$$F = \overline{C} + AB$$

Now execute Step 2 by enumerating all adjacent 1-pairs (Table 1):

Adjacent Minterm Pair Differing Variable Shared Common Group Term Hazard Evaluation Status
(0, 2) $B$ $\overline{C}$ Glitch-free
(0, 4) $A$ $\overline{C}$ Glitch-free
(2, 6) $A$ $\overline{C}$ Glitch-free
(4, 6) $B$ $\overline{C}$ Glitch-free
(6, 7) $C$ $AB$ Glitch-free

Every adjacent pair shares a common group term. Therefore, the minimal cover $F = \overline{C} + AB$ is inherently hazard-free without adding redundant gates.

Hazard Elimination in Product-of-Sums (POS) Circuits

To eliminate static-0 hazards in Product-of-Sums logic, apply the dual procedure to adjacent 0-cells. Consider the minimal POS expression:

$$F = (A + \overline{C})(\overline{B} + C)$$

  • Sum term $(\overline{B} + C)$ evaluates to 0 when $B = 1$ and $C = 0$ (minterms 2 and 6).
  • Sum term $(A + \overline{C})$ evaluates to 0 when $A = 0$ and $C = 1$ (minterms 1 and 3).
  • The 0-cells are 1, 2, 3, and 6.

Minterms 2 ($010_2$) and 3 ($011_2$) are adjacent (differ only in $C$) and belong to separate sum terms. Switching $C$ when $A = 0$ and $B = 1$ produces a static-0 hazard. Minterms 2 and 3 share common values $A = 0$ and $B = 1$. Add the consensus sum term $(A + \overline{B})$:

$$F_{\text{hazard-free}} = (A + \overline{C})(\overline{B} + C)(A + \overline{B})$$

The added term holds the POS output at 0 during transitions on signal $C$.

Interaction Between Don’t-Care Conditions and Hazards

Don’t-care conditions ($d$) interact with hazard elimination in two ways:

  1. Hazard Reduction: Assigning a don’t-care to 1 can expand an implicant to cover two previously separated cells, eliminating a hazard without redundant gates.
  2. Hazard Creation: Treating a don’t-care as 1 creates a new active 1-cell that must be verified for adjacency against neighboring 1-cells.

Example Analysis

Consider $F = \sum m(0, 1, 5, 7)$ with a don’t-care at minterm 3 ($d_3$):

  • Case 1: Don’t-Care Ignored ($d_3 = 0$): The minimal cover is $F = \overline{A},\overline{B} + AC$ (Figure 2). Minterms 1 and 5 are adjacent, but belong to separate groups. A static-1 hazard exists. Eliminating the hazard requires adding consensus term $\overline{B}C$: $$F = \overline{A},\overline{B} + AC + \overline{B}C$$

Without the don’t-care
Figure 2: Karnaugh map without don't-care showing static hazard between cells 1 and 5

  • Case 2: Don’t-Care Included ($d_3 = 1$): Assigning $d_3 = 1$ allows minterms 1, 3, 5, and 7 to merge into a single 4-cell group: $C$ (Figure 3). The minimal cover becomes: $$F = \overline{A},\overline{B} + C$$ Minterms 0 and 1 share $\overline{A},\overline{B}$. Minterms 1, 3, 5, and 7 all share term $C$. All adjacent pairs are covered. The circuit is hazard-free and requires fewer gates than Case 1.

With the don’t-care
Figure 3: Karnaugh map with don't-care cell 3 eliminating hazard via single 4-cell group C

Engineering Decision Criteria

Table 2 guides when to implement hazard-free logic:

Circuit Environment Hazard Mitigation Requirement Rationale
Synchronous Pipeline Datapath Do Not Implement Setup timing ensures all logic settles before the clock edge. Redundant gates increase area and power.
Asynchronous FIFO Pointer Flags Mandatory Glitches on empty/full status flags corrupt FIFO pointers and cause intermittent data loss.
Clock-Gating Enable Logic Mandatory Spurious pulses create illegal clock edges that corrupt register contents.
External Memory Control ($\overline{CS}, \overline{WE}$) Mandatory Glitches trigger unauthorized bus transfers and memory corruption.
FPGA Internal Soft Logic Do Not Implement FPGA synthesis tools restructure LUT networks unpredictably. Use synchronous registers instead.

Hardware Implementation Overhead

In standard cell libraries using NAND-NAND topologies, adding a consensus product term requires:

  • One additional 2-input or 3-input NAND gate at logic level 1.
  • One additional input pin on the output NAND gate at logic level 2.

The hardware overhead typically represents one to three gates per protected signal.

Practice Exercise

Given $F(A, B, C) = \sum m(0, 1, 5, 7)$ with a don’t-care condition at minterm 3:

  1. Derive the minimal SOP expression assuming $d_3 = 0$, identify the hazard, and write the hazard-free equation.
  2. Derive the minimal SOP expression assuming $d_3 = 1$, verify its hazard status, and compare gate counts.
View Solution
  1. Analysis with $d_3 = 0$:
    • Prime implicants: $\overline{A},\overline{B}$ (cells 0, 1) and $AC$ (cells 5, 7).
    • Minimal cover: $F = \overline{A},\overline{B} + AC$.
    • Hazard: Cells 1 ($001_2$) and 5 ($101_2$) are adjacent (differ in $A$) and belong to separate groups.
    • Consensus term: $\overline{B}C$.
    • Hazard-free form: $F = \overline{A},\overline{B} + AC + \overline{B}C$ (requires 3 AND gates + 1 OR gate).
  2. Analysis with $d_3 = 1$:
    • Prime implicants: $\overline{A},\overline{B}$ (cells 0, 1) and $C$ (cells 1, 3, 5, 7).
    • Minimal cover: $F = \overline{A},\overline{B} + C$.
    • Verification:
      • Cells (0, 1) share $\overline{A},\overline{B}$.
      • Cells (1, 3), (1, 5), (3, 7), (5, 7) all share group $C$.
    • The circuit is completely hazard-free.
    • Hardware requirements: 1 AND gate + 1 OR gate.

Assigning the don’t-care to 1 reduces gate count and eliminates the static hazard simultaneously.

In the final article of Module 2, we review practical hazard failure modes in commercial hardware and summarize combinational datapath design principles.

← Dynamic Hazards Hazards in Practice →