[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
相关推荐
Joshua-a6 小时前
FPGA基于计数器的分频器时序违例的解决方法
嵌入式硬件·fpga开发·fpga
尤老师FPGA6 小时前
LVDS系列38:Xilinx 7系 AD9253 LVDS接口设计仿真(五)
fpga开发
史蒂芬_丁7 小时前
PG分频_CLB
fpga开发
北方孤寂的灵魂8 小时前
systemverilog中随机std::randomize的用法
verilog·systemverilog·sv·数字验证
博览鸿蒙9 小时前
嵌入式是否如传说中那么简单?
fpga开发
Aaron158810 小时前
全频段SDR干扰源模块设计
人工智能·嵌入式硬件·算法·fpga开发·硬件架构·信息与通信·基带工程
洋洋Young1 天前
【Xilinx FPGA】DDR3 SDRAM 控制器
fpga开发·xilinx
碎碎思1 天前
在 FPGA 里跑 SDR 和 FT8:一个 32 MHz 全频谱无线电的硬核实现
fpga开发
EVERSPIN1 天前
USB3.0接口转换高性能图像传感和数据采集方案
fpga开发·usb3.0·接口转换·usb3.0接口转换
Macbethad1 天前
串口服务器技术报告:从RS232/485到MODBUS TCP的工业通信演进
fpga开发