|
发表于 2016-5-8 14:35:19
|
显示全部楼层
本帖最后由 jemmyplus 于 2016-5-8 14:38 编辑
`timescale 1ns/1ps
module pos_det(clk , rst_n,in,out);input clk,rst,in);
input clk; // system clock
input rst_n; // system reset active low
input in; // input signal
output out; // pulse output
reg in_1d,in_2d;
always@(posedge clk or negedge rst_n)
begin
if(rst_n == 1'b0)
begin
in_1d <= #1 1'b0;
in_2d <= #1 1'b0;
end
else
begin
in_2d <= #1 in_1d;
in_1d <= #1 in;
end
end
assign out = in_1d && (~in_2d);
endmodule |
|