HDL & Verification

assign a = b & c;
assign b = a | d;

What is a structure like the code above, where a combinational output feeds back to its own input without passing through a flip-flop, called, and why should it be avoided?

  1. AIt is a combinational loop; it can oscillate or never settle, and timing analysis cannot handle it as is
  2. BIt is a pipeline, and the circuit becomes too fast
  3. CIt is a shift register, and data is lost
Show answer and explanation

Answer: A. It is a combinational loop; it can oscillate or never settle, and timing analysis cannot handle it as is

With a determining b and b determining a and no flip-flop in between, values depend on delay differences. If the loop contains an inversion, values circulate with every gate delay and oscillate. Without an inversion, as in this example, a and b hold their previous values when c=1 and d=0, unintentionally forming latch-like memory. Static timing analysis cannot handle paths that form a loop as they are. When feedback is needed, a flip-flop must be inserted so the value updates once per clock.

  • A. Correct. Many tools issue errors or warnings.
  • B. A pipeline is divided by flip-flops.
  • C. A shift register is built from flip-flops.

Related calculators

Books on HDL & Verification Ad

As an Amazon Associate I earn from qualifying purchases.

More HDL & Verification questions

  1. When the code above is synthesized for an FPGA, how is it generally implemented?
  2. In combinational logic, how does a long if/else-if chain compare with a case statement whose conditions are mutually exclusive?
  3. What is the difference between Verilog's equality operators "==" and "==="?
  4. The code above was written intending an accumulator that keeps adding the input in. Which pair correctly states the problem with this code and how to fix it?
  5. What is a major difference between a description written in an HDL such as Verilog and a software program in a language such as C?

Comparisons in this topic