FPGA中常用的上升沿检测和下降沿检测代码,使用的verilog hdl语言
//上升沿检测 module pose_chk(clk, in, out); input clk, in; output out; reg curr, last; always@(posedge clk) begin curr <= in; last <= curr; end assign out = curr & (~last); endmodule //下降沿检测 module nege_chk(clk, in, out); input clk, in; output out; reg curr, last; always@(posedge clk) begin curr <= in; last <= curr; end assign out = ~curr & (last); endmodule标签:curr,clk,检测,Verilog,上升,out From: https://www.cnblogs.com/liylllove/p/17909220.html