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

Static Hazards

Module 1 taught that the minimal expression is the goal. In this article we see when it is not. Sometimes a circuit needs a term that is algebraically pointless in order to be physically correct, and a minimal circuit can glitch where a slightly larger one never will. It sounds odd that adding a redundant gate makes a circuit more correct. The reason is that the extra gate is an extra path to the output that does not depend on the signal that is changing, and it holds the output steady while the other paths sort themselves out.

The static-1 hazard again

$F = AC + BC’$, two AND gates and an OR, with the inverter on $C$ feeding the second AND (Figure 1).

The circuit
Figure 1: F = AC + BC' as a two-level circuit

With $A = B = 1$ and $C$ falling from 1 to 0, both before and after the output should be 1. But the path from $C$ to the first AND gate is one gate, and the path to the second is an inverter plus a gate. For one inverter delay after the first AND has turned off, the second has not yet turned on, and $F$ dips to 0.

A common confusion here: people say the inverter is fast, so the inverted signal should arrive first. The inverter is on the longer path, because $C’$ has to go through it and then through the AND gate. It is the short path’s arrival that causes the glitch and the long path’s arrival that ends it.

Seeing it on the map

$F = AC + BC’$ is $\sum m(2, 5, 6, 7)$. Figure 2 shows the map with the two groups of the minimal cover.

K-map with the hazard
Figure 2: The two groups of F = AC + BC'. Cells 6 and 7 are adjacent but in different groups

The transition we traced, $A = 1$, $B = 1$, $C$ from 1 to 0, is a move from cell 7 to cell 6. Cell 7 is covered by $AC$ and cell 6 by $BC’$, and no single group covers both. That gap is the hazard.

The rule: a static-1 hazard exists exactly when two adjacent 1-cells are not both inside one group of the cover. The hazardous transition is the one that moves between those two cells. So the detection procedure is: draw the map, draw the groups, and look at every pair of adjacent 1s. Any pair that does not share a group is a hazard.

Removing it

If cells 6 and 7 are not covered together, add a group that covers them. The smallest is the pair itself, which reads $AB$:

$$F = AC + BC’ + AB$$

$AB$ is redundant by the consensus theorem from Module 1: $AC + BC’$ already implies it, and the truth table is unchanged. What changes is the timing. The $AB$ gate does not depend on $C$ at all, so with $A = B = 1$ it holds the OR gate’s output at 1 throughout the transition (Figure 3).

Timing with the bridge term
Figure 3: With AB in the sum, the output no longer dips when C changes

K-map with the bridge
Figure 4: The added group AB covers cells 6 and 7 together

The cost is one 2-input AND gate.

Static-0 hazards

The static-0 hazard is the dual: an output that should stay at 0 rises briefly. It appears in product-of-sums circuits for the same reason, two sum terms whose 0-cells are adjacent but not covered by a common term. The detection is the same with 0s instead of 1s, and the fix is a redundant sum term covering both 0-cells. Most hand analysis is on sum-of-products circuits, where the static-1 form is what you meet; the POS analysis is needed for NOR-based or POS-synthesised logic, and the next-but-one article works an example.

A second example

$F = \sum m(0, 1, 2, 6)$. The minimal cover is $A’B’$ (cells 0 and 1) and $BC’$ (cells 2 and 6). Check the adjacent 1-pairs: 0 and 1 share $A’B’$; 2 and 6 share $BC’$; but 0 and 2 are adjacent (they differ in $B$) and are in different groups. That transition, $A = 0$, $C = 0$, $B$ changing, is a hazard. Cells 0 and 2 have $A = 0$ and $C = 0$ in common, so the bridge is $A’C’$:

$$F = A’B’ + BC’ + A’C’$$

Second example
Figure 5: F = Σm(0,1,2,6) with the bridging group A'C' added

When you do this check, go through every adjacent pair, not just the one you spotted first. A 3-variable function can have up to twelve adjacent pairs and a 4-variable one up to thirty-two. The next article makes the enumeration systematic.

Practice Exercise

Problem 1. Find and remove the static-1 hazards in $F = AB + B’C$.

Solution

$F = \sum m(1, 5, 6, 7)$. $B’C$ covers cells 1 and 5; $AB$ covers 6 and 7. Pairs: 1 and 5 share $B’C$; 6 and 7 share $AB$; 5 and 7 differ only in $B$ and are in different groups. That is the hazard, at $A = 1$, $C = 1$, $B$ changing. Both cells have $A = 1$ and $C = 1$, so add $AC$:

$$F = AB + B’C + AC$$

Problem 1
Figure 6: F = AB + B'C with AC added

Problem 2. A colleague has $F = AC + BC’ + AB$ and asks whether $AB$ can be dropped to save a gate.

Solution

It depends what $F$ drives. $AB$ is logically redundant, so the function is unchanged without it, but it is the term that removes the static-1 hazard on the $C$ transition with $A = B = 1$. If $F$ goes to the D input of a flip-flop in a synchronous design with timing met, drop it. If it drives a latch enable, a memory write enable, a reset, or a pin, keep it.

The next article looks at the rarer dynamic hazard, where an output that should change once changes three times, and why it needs three levels of logic.

← What a Hazard Is Dynamic Hazards →