四位二进制计数器和真值表:

代码如下:
module jishuqi(clk,rst,en,rset,co,d,q);
input clk;
input rst;
input rset;
input en;
input[3:0] d;
output[3:0] q;
output co;
reg[3:0] q;
reg co;
always@(posedge clk)
if(rst)
begin
q <= 4'd0;
end
else
begin
if(rset)
begin
q <= d;
end
else
begin
if(en)
begin
q <= q+4'b1;
if(q==4'b1111)
begin
co <= 1;
end
else
begin
co <= 0;
end
end
else
begin
q <= q;
end
end
end
endmodule
功能仿真:

转载于:https://www.cnblogs.com/Sagoo/p/3180163.html
最后
以上就是甜蜜自行车最近收集整理的关于FPGA_四位二进制计数器的全部内容,更多相关FPGA_四位二进制计数器内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复