VerilogCPU/edge_detector.sv

9 lines
172 B
Systemverilog
Raw Normal View History

2018-06-05 22:57:01 -07:00
module edge_detector(input logic in, clk,
output logic out);
logic old_in;
always_ff@(posedge clk)
old_in <= in;
assign out = in & ~old_in;
endmodule