I'm designing an ALU in Verilog with a combinational always
block and cases for every opcode
. In the case of NOOP
, nothing should happen, so I'm just setting result = result
. I understand why this infers a latch. My question is: is there a better way or is an inferred latch the correct decision in this case?
always@(Rdest, Rsrc, opcode, reset) begin
case(opcode)
...
default:
NOOP: result = result; // Infers a latch
endcase
end