3.3.14 · D2Combinational Circuits

Visual walkthrough — Hazards (static and dynamic) in combinational logic

2,358 words11 min readBack to topic

Before we start, three plain words we will use constantly:

We only need three kinds of gate:


Step 1 — Draw the function as real wires and gates

WHAT. We take the formula and turn it into an actual circuit made of the three gates above.

WHY. A formula pretends everything happens at once. A drawing forces us to see the separate paths a signal takes — and paths are where delays hide. We cannot talk about "unequal delays" until we can point at the two roads.

PICTURE. Look at the figure. Read it left to right:

  • Inputs , , enter on the left.
  • splits: one copy goes straight up into the top AND gate; another copy dives into the inverter (the triangle with a bubble) to become .
  • The top AND computes — call its output the term (blue wire).
  • The bottom AND computes — call its output the term (yellow wire).
  • The final OR combines them: .

Figure — Hazards (static and dynamic) in combinational logic

Step 2 — Freeze the "before" picture:

WHAT. We hold and high forever and set to start. We read off every wire.

WHY. A hazard only counts if the output is supposed to be the same before and after (see the [!definition] of static hazard in the parent). So we must nail down the starting value first, then the ending value in Step 3, and check they match.

PICTURE. With :

Term-by-term on the drawing:

  • — the inverter's output is low (yellow wire dark).
  • — top AND is high (blue wire lit): this is what holds up.
  • — bottom AND is low.
  • — the OR sees one high input, so it lights.

The output is currently held up entirely by the blue term . The yellow term contributes nothing. Keep your eye on who is "holding the output" — that is about to change hands.

Figure — Hazards (static and dynamic) in combinational logic

Step 3 — Freeze the "after" picture:

WHAT. Same held inputs, but now . Read every wire again.

WHY. To confirm this is a genuine static-1 situation: the final value must also be . If it were we'd have an ordinary transition, not a hazard.

PICTURE. With :

  • — inverter output now high (yellow wire lit).
  • — top AND low (blue wire dark) because went to .
  • — bottom AND now high: this is what holds up.
  • again.
Figure — Hazards (static and dynamic) in combinational logic

Step 4 — The slow-motion handoff: catch the glitch

WHAT. We zoom into the instant falls and play it in slow motion, tracking , , , and on a timeline.

WHY. This is the heart of the derivation. The two roads have different lengths, so the two terms don't switch at the same moment. We must see the gap.

PICTURE — read the timeline top to bottom:

At time , starts falling. Two things now race:

  1. Blue drops fast. feeds off directly (Road 1). The moment hits , one AND-delay later .
  2. Yellow rises late. needs , which comes out of the inverter (Road 2). The inverter must first flip , then the AND reacts. So arrives one extra gate-delay later.

Between those two events lies the bad window (shaded red on the figure):

For that one inverter-delay, both terms are 0 at the same time — nobody is holding the output up — so dips to . Then finally rises, climbs back to .

That is the static-1 hazard.

Figure — Hazards (static and dynamic) in combinational logic

Step 5 — WHY the K-map warned us in advance

WHAT. We plot on a Karnaugh map and mark the two cells involved in our transition.

WHY. The timeline showed the glitch happens; the map shows why it was inevitable and how to design it away. A K-map is just a grid where physically adjacent cells differ by one input bit — so a single input change = a step to a neighbouring cell. (See Karnaugh Maps and Prime Implicants.)

PICTURE. The map has rows/columns for . Two cells matter, both with :

  • Cell → covered by the blue loop .
  • Cell → covered by the yellow loop .

These two cells are adjacent (only differs — exactly our transition). But they sit in two different loops, and no single loop covers both. On the map, moving between them means stepping out of the blue loop and into the yellow loop — a handoff. That handoff is the same handoff we watched glitch in Step 4.

Figure — Hazards (static and dynamic) in combinational logic

Step 6 — The cure: bridge the gap with a redundant loop

WHAT. We add one more loop to the map — one that covers both cells at once — and translate it back into an extra AND gate.

WHY. If a single term already covers both cells, there is no handoff: while blue drops and yellow rises, this bridging term stays high the whole time and never lets go of the output. We need the term that spans regardless of — that is exactly the consensus term. (See Consensus Theorem and Redundancy.)

PICTURE — the bridging loop. Draw a green loop covering both cells (both values of ). That loop drops entirely:

New hazard-free cover:

Now replay Step 4 with : the green term stays the entire time, independent of . So even in the bad window when blue and yellow are both , the OR still sees the green :

Figure — Hazards (static and dynamic) in combinational logic

Step 7 — The degenerate cases (so you never hit an unshown scenario)

WHAT. We check the corners where the hazard cannot fire, so you know the danger is specific.

WHY. The glitch only appears under exact conditions. Knowing when it can't happen is as important as knowing when it can — otherwise you'll fear glitches everywhere.

PICTURE — a small case table:

Held inputs change Blue Yellow Bad window?
drops early rises late YES — glitch
drops early stays () No — yellow never rises
stays () rises late No — blue was never
No — throughout, ordinary

Only the first row has both a term that falls and a term that must rise to replace it — the two conditions for a handoff. Everywhere else, one of the terms is pinned by or , so there is nothing to hand off. This is exactly why the consensus is : the hazard lives precisely where both and are .

Figure — Hazards (static and dynamic) in combinational logic

The one-picture summary

WHAT. One figure compressing the whole story: the two-road circuit, the glitchy timeline, the K-map handoff, and the green bridge that fixes it — side by side.

Figure — Hazards (static and dynamic) in combinational logic
Recall Feynman retelling — say it in plain words

A wire called has to reach the output by two roads. One road is short (straight into an AND). The other goes through an inverter, so it's one step longer. When drops, the short road's answer collapses right away, but the long road's replacement answer hasn't arrived yet. For that tiny gap, both roads say "0", and the output — which should have stayed "1" — briefly blinks to "0". That blink is the static-1 hazard.

The K-map explains it visually: the two output-1 squares sit in different rings, and stepping from one ring to the other is the handoff where the output can drop. To fix it, we draw one extra ring that covers both squares at once. In gates, that ring is the term : whenever and are both 1, is 1 no matter what does, so it keeps holding the output up straight through the gap. No gap, no blink. The logic value was never wrong at the ends — only the timing in the middle — and one redundant gate patches the timing.

Recall Quick self-check

Why does the glitch only happen when and ? ::: Because you need one term () that falls and another term () that rises to replace it. needs ; can rise only if . If either is , one term is pinned and there is no handoff. What single term cures it and why? ::: — it covers both adjacent 1-cells (independent of ), so it holds the OR output high through the entire transition, filling the bad window. Could a Boolean simplifier find this cure by itself? ::: No — is logically redundant, so simplification removes it. You must add it deliberately for glitch-free timing.


Related: Sum of Products and Product of Sums Forms · Synchronous vs Asynchronous Circuits · Metastability and Setup-Hold Time · 3.3.14 Hazards (static and dynamic) in combinational logic (Hinglish)