mirror of
https://github.com/olofk/serv.git
synced 2026-01-13 23:25:57 +00:00
20 lines
341 B
Verilog
20 lines
341 B
Verilog
`default_nettype none
|
|
module ser_lt
|
|
(
|
|
input wire i_clk,
|
|
input wire i_a,
|
|
input wire i_b,
|
|
input wire 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
|