我是靠谱客的博主 冷艳飞鸟,这篇文章主要介绍数字IC学习笔记(7)边沿检测,计数器,移位寄存器,现在分享给大家,希望可以做个参考。

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)边沿检测内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(153)

评论列表共有 0 条评论

立即
投稿
返回
顶部