Altera_Forum
Honored Contributor
11 years agoLatch Inferred Help
Hi everyone.
I have a code in Verilog, wich must be combinational, but I can't figure out how to make it without creating a latch. The logic is correct, and simulates fine, but I'd like to remove the latch.module locker
(
input wire INPUT,
output reg lock
);
localparam high_low_threshold = 16'b00000001_10011001;
localparam low_high_threshold = 16'b00000100_00000000;
always @ ( * )
begin
lock = 1'b0;
if (INPUT >= low_high_threshold)
lock = 1'b1;
else if (INPUT < high_low_threshold)
lock = 1'b0;
end
endmodule Thank You!!