wire clk,rstn;
wire din;
reg din_delay;
wire pulse;
assign pulse = din & (!din_dly);
always @(posedge clk or negedge rstn)
if(!rstn)
din_dly <= 1'b0;
else
din_dly <= din;
计数器
module counter(
input wire en,
output reg [3:0] cnt,
input wire clk,
input wire rstn
);
always @(posedge clk or negedge rstn)
if(!rstn)
cnt <= 0;
else if(en)
cnt <= cnr + 1;
endmodule
移位寄存器
reg [3:0] sf;
always @(posedge clk) begin
sf <= {sf[2:0],din};
end
最后
以上就是冷艳飞鸟最近收集整理的关于数字IC学习笔记(7)边沿检测,计数器,移位寄存器的全部内容,更多相关数字IC学习笔记(7)边沿检测内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复