Topic: Digital Circuits / VHDL & Verilog
Consider following HDL code snippets in Verilog as well as same code in VHDL. What architecture does synthesizer typically infer for output 'd'?
- A. Multiplexer
- B. Flip-flop
- C. A straight interconnect
- D. Latch
Answer: D. Latch
Explanation: In both Verilog (`always @(*) if (enable) d = din;`) and VHDL (`if enable = '1' then d <= din;`), the assignment lacks an `else` branch. In combinational logic modeling, failing to assign a variable under all possible conditions dictates that the signal must retain its previous state when the condition is false. The synthesizer will automatically infer a level-sensitive latch to hold this value.