[HDLBits] Countslow

Build a decade counter that counts from 0 through 9, inclusive, with a period of 10. The reset input is synchronous, and should reset the counter to 0. We want to be able to pause the counter rather than always incrementing every clock cycle, so the slowena input indicates when the counter should increment.

复制代码
module top_module (
    input clk,
    input slowena,
    input reset,
    output [3:0] q);
	always@(posedge clk) begin
        if(reset||(slowena&&q>=9))
            q<=4'b0;
        else if(q<9&&slowena)
            q<=q+1;
        else;
    end
endmodule
相关推荐
GateWorld5 小时前
主流FPGA厂商对SystemVerilog的支持现状
fpga开发·system verilog
Smart-佀1 天前
FPGA入门:CAN总线原理与Verilog代码详解
单片机·嵌入式硬件·物联网·算法·fpga开发
丁劲犇1 天前
B205mini FPGA工程粗浅解析:从架构到Trae开发介绍
ai·fpga开发·架构·ise·trae·b210·b205mini
应用市场1 天前
无线充电器原理与电路设计详解——从电磁感应到完整实现
3d·fpga开发
ALINX技术博客2 天前
【ALINX选型】AMD Kintex UltraScale+ 系列 FPGA 开发板速选
fpga开发
碎碎思2 天前
从 HLS 到 RTL:高层次综合在 FPGA 设计中的价值与局限
fpga开发
s09071362 天前
FPGA视频编码器:H.264/H.265实现核心技术解析
图像处理·算法·fpga开发·音视频·h.264
156082072192 天前
在vivado中,国产CH347芯片实现USB转JTAG的操作
fpga开发
数字芯片实验室2 天前
IP验证最终回归到时序级建模
网络·网络协议·tcp/ip·fpga开发
雨洛lhw2 天前
三模冗余资源量对比
fpga开发·三模冗余技术