mod6_cnt.v
来自「一个用VerilogHDL语言编写的模6的二进制计数器」· Verilog 代码 · 共 22 行
V
22 行
module mod6_cnt(
//input
clk,
rst_n,
//output
cnt_out,
);
input clk;
input rst_n;
output[2:0] cnt_out;
reg[2:0] cnt_out;
always@(posedge clk or negedge rst_n)
begin
if(rst_n==1'b0)
cnt_out<=3'b0;
else if(cnt_out==3'b101)
cnt_out<=3'b0;
else
cnt_out<=cnt_out+1;
end
endmodule
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?