Hazards in Practice
This final article of Module 2 examines practical hardware failures caused by combinational hazards in commercial integrated circuits. We analyze industrial failure mechanisms, formalize the Synchronous Design Principle, and outline verification flows using Electronic Design Automation (EDA) tools. The article concludes with a comprehensive review of combinational datapath circuits before advancing to sequential logic.
Four Industrial Failure Case Studies
1. Spurious Asynchronous Reset Assertions
A finite state machine (FSM) incorporates an active-low asynchronous reset line ($\overline{\text{RESET}}$). A combinational decoder monitors input bus conditions to assert reset (Figure 1).
During normal operation, an input signal transitions between two states where the reset should remain inactive. Because the decoder contains an unbridged static-0 hazard, the output momentarily drops to logic 0 for several nanoseconds. The asynchronous reset triggers immediately, clearing all state flip-flops and corrupting in-flight transactions.
Remedies:
- Add consensus bridging terms to make the decoder hazard-free.
- Recommended: Register the reset signal through a D flip-flop (Figure 2). The flip-flop samples the signal after combinational glitches have settled, distributing a glitch-free synchronous reset.
2. Gated Clock Spurious Edges
In low-power designs, clock-gating circuits disable clock distribution to idle registers using an AND gate. If the enable signal originates from combinational logic, a transient glitch while the clock is high creates a falling and rising edge on the gated clock line. Downstream registers register a false clock edge, clocking corrupted data into the state registers.
Remedies: Never use a bare AND gate to gate a clock signal. Deploy a dedicated Integrated Clock Gating (ICG) cell from the ASIC standard-cell library (Figure 3):
The ICG cell places a negative-level-sensitive transparent latch before the AND gate. The enable signal can switch only while the clock is low, blocking glitches during the high clock phase.
3. Tri-State Bus Contention
Multiple functional units connect to a shared data bus using tri-state buffers with active-high Output Enable ($OE$) lines. If the $OE$ decoder logic contains static-1 hazards, an outgoing driver may turn on momentarily while the incoming driver asserts data. Both drivers conduct simultaneously with opposing logic values, creating a direct short circuit between power supply and ground. This causes voltage droop, high current spikes, and eventual transistor damage.
Remedy: Drive tri-state output enables exclusively from registered flip-flop outputs, and enforce break-before-make dead-time margins between bus handovers.
4. FPGA Dedicated Carry Chains Versus LUT Interconnect Skew
On FPGAs, dedicated silicon carry chains route carry signals at speeds exceeding 30 ps per bit, while general Look-Up Table (LUT) routing requires 300 ps to 600 ps. When a logic gate combines an output from a dedicated carry chain with an output from a LUT path, the two signals arrive with significant delay skew (Figure 4):
This skew generates transient output pulses. On an FPGA, register all external chip outputs and clock domain crossings using flip-flops to prevent glitches from escaping the fabric.
The Synchronous Design Principle
The primary defense against combinational timing hazards is the Synchronous Design Principle:
In a fully synchronous digital system, if every flip-flop data input ($D$) satisfies setup time ($t_{\text{setup}}$) and hold time ($t_{\text{hold}}$) constraints around active clock edges, all combinational glitches occurring between clock edges are completely harmless.
Flip-flops sample data exclusively at discrete clock edges (Figure 5):
Static Timing Analysis (STA) enforces:
$$T_{\text{clk}} \ge t_{\text{CQ}} + t_{\text{comb, worst}} + t_{\text{setup}}$$
If the maximum combinational delay $t_{\text{comb, worst}}$ accounts for all path settling times, intermediate glitches stabilize before the setup sampling window opens. The glitches are safely filtered.
Boundary Conditions Beyond Synchronous Protection
Synchronous clocking does not protect circuits that operate outside register clock domains:
- Asynchronous Reset/Preset Inputs: Level-sensitive inputs trigger regardless of clock timing.
- Clock-Gating Enable Networks: Glitches trigger illegal clock transitions.
- Chip I/O Boundary Pins: Glitches radiate electromagnetic interference (EMI) and falsely trigger external chips.
- Asynchronous FIFO Pointers: Combinational glitches on empty/full flag comparators corrupt FIFO state logic.
These boundary paths require manual consensus term insertion or output register isolation.
EDA Tool Verification Methodology
Table 1 details the role of EDA software tools in hazard verification:
| EDA Verification Tool | Operating Mechanism | Capability Regarding Hazards |
|---|---|---|
| RTL Functional Simulation | Zero-delay event scheduling | Cannot detect hazards or glitches |
| Gate-Level Simulation (GLS) | Back-annotated Standard Delay Format (SDF) timing | Displays physical glitches and timing violations |
| Static Timing Analysis (STA) | Topological path enumeration (PrimeTime, Tempus) | Proves setup/hold compliance for synchronous paths |
| Structural RTL Lint (SpyGlass) | Static syntax and design rule inspection | Flags combinational logic driving resets and clock gates |
Comprehensive Review of Module 2
Module 2 advanced from fundamental logic gates to complex arithmetic datapath circuits:
- Section 2.1 (Adder Circuits):
- Half adders and full adders derived from truth tables.
- Ripple-Carry Adders (linear $O(N)$ delay scaling).
- Carry-Lookahead Adders (generate/propagate logic, $O(\log N)$ delay scaling).
- Carry-Select and Carry-Skip Adders ($O(\sqrt{N})$ delay scaling).
- Parallel-prefix trees (Kogge-Stone, Brent-Kung) and dedicated FPGA carry chains.
- Section 2.2 (Subtractors and the ALU):
- Two’s complement subtraction using XOR gating ($A + \overline{B} + 1$).
- Condition flag generation ($Z, N, C, V$) and signed overflow evaluation ($c_{N-2} \oplus C_{\text{out}}$).
- 4-bit 8-operation ALU using parallel compute-and-select multiplexer routing.
- Microprocessor condition code translation (ARM CPSR and x86 EFLAGS).
- Section 2.3 (Multipliers and Shifters):
- Partial product matrix generation using 2-input AND gates.
- Combinational Array Multipliers ($O(N)$ carry-save delay).
- Wallace Tree and Dadda reduction networks ($O(\log N)$ CSA trees).
- Logical, arithmetic, and circular shift operations.
- Logarithmic Barrel Shifters ($O(\log N)$ multiplexer stages).
- Section 2.4 (Combinational Hazards):
- Asymmetric path delays and transient output glitches.
- Identification of static-1 and static-0 hazards on Karnaugh maps.
- Elimination of static hazards using redundant consensus terms.
- Multi-level dynamic hazards and synchronous register filtering.
Core Knowledge and Competency Checklist
Verify your mastery of Module 2 concepts using the following checklist:
- Adder Design: Derive full adder logic from truth tables. Calculate worst-case ripple-carry delays. Formulate CLA generate ($G$) and propagate ($P$) equations.
- Subtractor & Flag Architecture: Explain two’s complement hardware subtraction. Formulate Boolean equations for flags $Z, N, C, V$. Derive signed and unsigned branch conditions.
- ALU Implementation: Construct a multi-operation ALU using parallel functional blocks and multiplexer selection.
- Multiplication & Shifting: Calculate partial products for an $N \times N$ multiplication. Construct Carry-Save Adder (CSA) reduction trees. Design logarithmic barrel shifter stages.
- Hazard Mitigation: Identify static hazards on Karnaugh maps and insert consensus terms. Explain why dynamic hazards require three logic levels. Apply the Synchronous Design Principle.
Practice Exercises
Problem 1: A combinational circuit has a static-1 hazard on one specific input transition. Its output connects simultaneously to three loads:
- The $D$ input of a flip-flop clocked at 100 MHz (glitch duration: 500 ps; setup time: 200 ps).
- A 2-input AND gate gating a 50 MHz clock signal.
- The Output Enable ($OE$) pin of an external bus driver.
Analyze whether each load causes a functional system failure, and specify the required engineering remedy.
View Solution
- Flip-Flop $D$ Input:
- The clock period is $T_{\text{clk}} = 10\text{ ns}$.
- The 500 ps glitch occurs immediately after inputs switch, settling more than 8 ns before the setup window opens.
- Evaluation: Safe. No functional failure occurs. Normal static timing analysis guarantees margin.
- Clock-Gating AND Gate:
- A transient low glitch while the clock is high creates an illegal falling and rising edge on the clock line.
- Evaluation: Critical Failure. Triggers spurious clocking of downstream registers.
- Remedy: Replace the bare AND gate with an Integrated Clock Gating (ICG) standard cell.
- Bus Driver Output Enable ($OE$):
- A transient low glitch briefly disables the driver, floating the bus and introducing signal reflections.
- During bus handovers, it can cause driver overlap.
- Evaluation: Critical Failure.
- Remedy: Register the output enable line through a D flip-flop and enforce non-overlapping dead-time margins.
Problem 2: Write the canonical Boolean expressions for the following fundamental arithmetic components from memory:
- Full Adder Sum ($S$) and Carry-out ($C_{\text{out}}$).
- Carry-Lookahead Generate ($G_i$) and Propagate ($P_i$).
- Signed Arithmetic Overflow flag ($V$) in an $N$-bit adder.
- The hazard-free consensus formulation of $F = AC + B\overline{C}$.
View Solution
- Full Adder: $$S = A \oplus B \oplus C_{\text{in}}$$ $$C_{\text{out}} = AB + BC_{\text{in}} + AC_{\text{in}} = AB + (A \oplus B)C_{\text{in}}$$
- CLA Signals: $$G_i = A_i \cdot B_i$$ $$P_i = A_i \oplus B_i \quad (\text{or } A_i + B_i)$$
- Signed Overflow Flag: $$V = c_{N-2} \oplus C_{\text{out}} = A_{N-1} B_{N-1} \overline{S_{N-1}} + \overline{A_{N-1}},\overline{B_{N-1}} S_{N-1}$$
- Hazard-Free Formulation: $$F = AC + B\overline{C} + AB$$
This concludes Module 2 on combinational circuit design. In Module 3, we introduce memory elements, beginning with SR latches, D latches, and edge-triggered D flip-flops.