Which of the following practices in an always @(*) block will result in u…
Which of the following practices in an always @(*) block will result in unintended latch inference during logic synthesis? *(Select all that apply)*
- Omitting the default statement in a case construct when not all input combinations are explicitly enumerated.
- Assigning an output variable in the if branch without specifying an assignment to it in an else branch.
- Reading an input variable inside the block that was not listed in the sensitivity list when using always @(*) .
- Writing to the same reg variable in two independent always blocks.
Correct answer
A. Omitting the default statement in a case construct when not all input combinations are explicitly enumerated.; B. Assigning an output variable in the if branch without specifying an assignment to it in an else branch.
Explanation
* **A is correct:** If not all branch combinations are covered and no default is provided, the synthesis tool must preserve the variable's previous value under the unhandled conditions, creating a level-sensitive latch. * **B is correct:** Incomplete conditional branches ( if without else ) mean the output retains its previous value in the absent branch, causing latch synthesis. * **C is incorrect:** The wildcard @(*) or @* automatically constructs a complete sensitivity list of all evaluated signals, preventing sensitivity mismatches. * **D is incorrect:** Driving the same variable from two separate always blocks is an illegal multi-driver conflict that triggers compilation or synthesis errors, not latches.