1
0
mirror of https://github.com/olofk/serv.git synced 2026-01-18 16:56:55 +00:00
olofk.serv/rtl/ser_lt.v
2018-11-01 09:35:49 +01:00

20 lines
341 B
Verilog

`default_nettype none
module ser_lt
(
input i_clk,
input i_a,
input i_b,
input i_clr,
output reg o_q);
reg lt_r = 1'b0;
wire lt = (~i_a & i_b) | ((i_a == i_b) & lt_r);
always @(posedge i_clk) begin
lt_r <= lt & ~i_clr;
if (~i_clr)
o_q <= lt;
end
endmodule