Why does an If statement cause a latch in verilog?
问题 I am trying to code a controller/data-path implementation in Verilog, and I am confused on what will cause an unwanted latch. Essentially, I have a state machine updating on the negedge clock. This state machine sends 5 control signals (loadSquare, loadDelta, addDelta, etc.) to the data-path based on what state the machine is in. The code for the data-path and controller is shown below. Data-path //Control lines reg addSquare, addDelta, decDelta; reg loadSquare, loadDelta; //Input lines reg