[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
相关推荐
范纹杉想快点毕业1 小时前
《STM32深度100问:AI助教工程师的实战问答录》从入门到精通适用入门嵌入式软件初级工程师,筑牢基础,技术积累
arm开发·数据库·驱动开发·mongodb·fpga开发
FPGA_小田老师1 小时前
FPGA基础知识(十六):Xilinx Block Memory IP核完全指南(1)--核心定位与基础配置
fpga开发·存储·block ram·block rom
ShiMetaPi1 小时前
GM-3568JHF丨ARM+FPGA异构开发板系列教程:基础入门 06 查看信息
arm开发·fpga开发
szxinmai主板定制专家2 小时前
RK3588+zynq7045 ARM+FPGA+AI解决方案,支持复旦微全国产化,应用于智能机器人等领域
arm开发·人工智能·fpga开发
崇子嵘2 小时前
dcfifo跨时钟域处理
fpga开发
崇子嵘2 小时前
4个led呼吸不同步(野火升腾拓展)
fpga开发
hexiaoyan8272 小时前
FPGA硬件加速卡设计原理图:1-基于Xilinx XCKU115的半高PCIe x8 硬件加速卡 PCIe半高 XCKU115-3-FLVF1924-E芯片
图像处理·fpga开发·雷达信号处理·光纤采集卡·信号计算板·fpga硬件加速
FPGA_无线通信2 小时前
FPGA与AD9371的数据交互
fpga开发
崇子嵘14 小时前
4*4按键消抖(野火升腾拓展)
fpga开发
北京青翼科技21 小时前
【PCIE044】基于复旦微 JFM7VX690T 的全国产化 FPGA 开发套件
图像处理·人工智能·fpga开发·信号处理·智能硬件