Worked examples — Hazards (static and dynamic) in combinational logic
Before anything else, let us pin down the vocabulary in plain words so no symbol sneaks in undefined.
The scenario matrix
Every hazard problem you will ever be handed falls into one of these cells. Our job is to hit all of them.
| Cell | Case class | What makes it tricky |
|---|---|---|
| A | Static-1 hazard (SOP) | output holds , dips to |
| B | Static-0 hazard (POS) | output holds , spikes to |
| C | No hazard (degenerate) | adjacent cells already share a term — nothing to fix |
| D | Two hazards in one function | more than one adjacency needs covering |
| E | Dynamic hazard | one input change, output flips |
| F | Timing / limiting values | glitch width shrinks to zero as delays match |
| G | Real-world word problem | glitch feeds an asynchronous load |
| H | Exam twist | "the redundant term is redundant, delete it" trap |
Cell C is the one students forget: not every adjacency glitches. We prove it too.
Cell A — Static-1 hazard in SOP
-
Evaluate both endpoints. Why this step? A hazard needs the initial and final values equal — otherwise the change is a legitimate transition, not a glitch.
- : .
- : . Both are ⇒ static-1 candidate. ✔
-
Find the reconvergent paths of the changing input . Why? The glitch source is always one input, two delays.
- Path 1: AND gate (direct, fast).
- Path 2: inverter AND gate (slow by one gate delay).
-
Trace the bad window. Why? We want the exact instant both product terms read .
- falls: drops to immediately.
- has not risen yet, so is still for one inverter-delay.
- Both terms ⇒ momentarily . Glitch . See figure.
-
Cure with the consensus term. Why? We need a term that stays through the change so the output never depends on the handoff. Consensus of and (drop the variable that appears true in one, complemented in the other) is .
See Karnaugh Maps and Prime Implicants and Consensus Theorem and Redundancy for the algebra behind .
Cell B — Static-0 hazard in POS
- Evaluate endpoints. Why? Same reasoning — need equal ends.
- : .
- : . Both ⇒ static-0 candidate. ✔
- Reconvergent paths of . enters factor 1 directly; enters factor 2 through an inverter (slow).
- Bad window. As rises: factor 1 becomes immediately; factor 2 is still, because hasn't fallen yet. Briefly both factors are ⇒ spikes to . Glitch .
- Cure with consensus sum. Why a sum? In POS the output is a product of factors; to pin it to we need one factor that is during the change. Consensus of and is .
Cell C — The degenerate "no hazard" case
- Endpoints. : . : . Equal ⇒ candidate.
- Paths of . enters only one term, . There is no inverter on and no second -path. So is not reconvergent through unequal delays here.
- Trace. As falls, , but never moved — it holds the whole time.
- Conclusion. No handoff, no window, no glitch. The term already plays the covering role that played as a fix in Cell A.
Cell D — Two hazards, one function
- List the pairwise consensus terms. Why? Each adjacent 1-pair sitting in different prime implicants is a potential glitch, and consensus of that pair covers it.
- Consensus of and (variable ) .
- Consensus of and (variable ) .
- Consensus of and (variable ) .
- Check each is a real transition point. Why? Only add a term if the pair are genuinely adjacent 1s handed off between terms. Here all three pairs are adjacent (each pair differs in exactly the eliminated variable with the other two literals compatible), so all three consensus terms are needed.
- Hazard-free cover.
Cell E — A dynamic hazard
-
Sequence the arrivals. Why? Each unequal-delay arrival of the same logical change flips the output as it lands.
- : flips (1st).
- : flips (2nd).
- : flips (3rd).
-
Count. changes 3 times — e.g. . Expected changes , actual ⇒ dynamic hazard. ✔
-
Net change / parity. is odd, so the final value differs from the initial — the true single transition did happen; the extra flips are a spurious spike pair. See figure.
-
Cure. Why not consensus? A single consensus term cannot force monotonic switching across three paths. You must redesign to a two-level network (or a provably hazard-free multi-level one) covering every adjacency — see the parent's dynamic-hazard note.
Cell F — Limiting / timing values
- Compute the width. . Why? The output is wrong exactly while the slow path lags the fast path.
- Limiting case . Then : the glitch shrinks to zero width and effectively vanishes. Why care? This is why perfectly balanced delays seem hazard-free — but you can never guarantee balance across temperature and voltage, so you still design in the consensus term.
- Degenerate zero case. If (impossible for direct-vs-inverter, but possible in general routing), ⇒ no glitch, or the roles swap.
Cell G — Real-world word problem
- Identify the load type. Why? Synchronous vs Asynchronous Circuits: asynchronous inputs act the instant they see a level — they do not wait for a clock edge, so they cannot "sample after settling".
- Trace the glitch. Each time falls, dips for (Cell F). That momentary hits the clear pin.
- Consequence. Every cycle the counter is spuriously reset — it never counts past its first step. A logically "correct" circuit that fails completely in hardware.
- Fix. Add the consensus : with , stays , the clear line never dips, the counter counts. This is the parent's mistake "registering the output removes the hazard" laid bare — here there is no register to hide behind.
Cell H — The exam twist
- Minimise algebraically. By the consensus theorem, is redundant: . Why? Consensus terms are always logically implied by the others — that is the definition of redundancy (see Consensus Theorem and Redundancy).
- Spot the trap. Why this step? Removing gives the minimum-gate SOP — but it is exactly Cell A's glitchy circuit. Minimising re-introduces the static-1 hazard.
- Answer both readings.
- If the question wants minimum cost: .
- If the question wants hazard-free: keep — the "redundant" term is mandatory.
Recall
Recall Which cure form goes with which hazard?
Static-1 (SOP) needs a redundant product term; static-0 (POS) needs a redundant sum factor. ::: Product for SOP (stays 1), sum for POS (stays 0).
Recall Does every adjacency glitch?
No. ::: If a single existing term already covers both adjacent cells (Cell C), there is no handoff and no glitch.
Recall Why can't consensus fix a dynamic hazard?
Because ≥3 reconvergent unequal paths need monotonic switching. ::: One extra term can't guarantee the output changes only once; redesign to a hazard-free network instead.
Recall Glitch width formula?
. ::: It shrinks to as the delays match, but you never rely on that.