边沿检测实例
module edge_check (clk, rst_n, signal_a, pose_out);input clk, rst_n;
input signal_a;
output pose_out;
reg buffer1;
reg buffer2;
always @ (posedge clk, negedge rst_n)
begin
if(!rst_n)
begin
buffer1 <= 0;
buffer2 <= 0;
end
else
begin
buffer1 <= signal_a;
buffer2 <= buffer1;
end
end
assign pose_out = (~buffer2) & buffer1;
endmodule
页:
[1]