//四位计数器
module cy4(input clk,
input rst_n,
output reg[3:0] Q);
always @(posedge clk or negedge rst_n)
if(!rst_n) Q <= 4’b0;
else Q <= Q + 1;
endmodule
简单的四位计数器
最新推荐文章于 2024-05-21 14:45:00 发布
//四位计数器
module cy4(input clk,
input rst_n,
output reg[3:0] Q);
always @(posedge clk or negedge rst_n)
if(!rst_n) Q <= 4’b0;
else Q <= Q + 1;
endmodule