Skip to content
BetterDL

Hazard

Also called: logic hazard, timing hazard

A circuit's potential to produce a glitch for some input change, because of unequal path delays. Can be static-1, static-0 or dynamic.

A hazard is a property of a circuit's structure: for some single input change, unequal path delays could make the output glitch. Whether a glitch actually appears depends on the real gate delays, so a hazard is a possibility, not a certainty.

There are three kinds:

The usual cause is a hand-over. In a sum of products circuit, while one input changes, the job of holding the output at 1 passes from one product term to another. If the old term turns off before the new one turns on, the output drops briefly.

You can spot this on a karnaugh map: two adjacent 1s covered by different groups, with no group covering both. The fix is to add a hazard cover term, usually the consensus term, which stays 1 through the hand-over. It doesn't change the function, so the minimal expression and the hazard-free one can differ.

A\BC00011110
0
0m0
0m1
1m3
0m2
1
1m4
0m5
1m7
1m6

Worked example

Example

Finding a hazard on a K-map

F = . The K-map above shows its two groups, (cells 4, 6) and (cells 3, 7), plus a third group drawn in to fix the hazard.

  1. 1.

    Look for adjacent 1s that sit in different groups. Cell 6 (110) and cell 7 (111) are adjacent: they differ only in C.

  2. 2.

    Cell 6 is covered only by and cell 7 only by . No group covers both.

  3. 3.

    So with A = B = 1, a change in C hands the output from one term to the other: a static-1 hazard.

  4. 4.

    Fix: add the group covering cells 6 and 7, which is . Then F = , the same function with no hazard for that change.

Common mistakes

  • Treating a hazard as a guaranteed glitch. It's a possibility that depends on the actual delays and on which way the input moves.

  • Removing the extra cover term while minimizing. It's logically redundant on purpose.

  • Looking for hazards between cells that aren't adjacent. A single-input change only moves between adjacent cells.

Practice Hazard

Interactive questions with instant feedback and a worked solution for every wrong answer.

Timing and Sequential Logic lesson full course

Learn it step by step

Hazard is taught in Timing and Sequential Logic and Karnaugh Maps.