[HDLBits] Count15

Build a 4-bit binary counter that counts from 0 through 15, inclusive, with a period of 16. The reset input is synchronous, and should reset the counter to 0.

复制代码
module top_module (
    input clk,
    input reset,      // Synchronous active-high reset
    output [3:0] q);
    always@(posedge clk) begin
        if(reset)
            q<=4'b0;
        else if(q<15)
            q<=q+1;
        else
            q<=4'b0;
    end
endmodule
相关推荐
Terasic友晶科技1 小时前
2-DE10-Nano的HDMI彩条显示案例(分辨率可切换)—— VGA显示控制器模块设计
fpga开发·de10-nano·hdmi彩条显示·vga显示控制·terasic开发板
kanhao1001 小时前
电平交叉采样 (Level-Crossing Sampling)
算法·fpga开发·fpga
忙什么果13 小时前
上位机、下位机、FPGA、算法放在哪层合适?
算法·fpga开发
环能jvav大师16 小时前
在Proteus中仿真PLD元器件(WinCupl及WinSim基础使用)
硬件架构·proteus·fpga
博览鸿蒙18 小时前
从迷茫自学到稳定入行:我的 FPGA 上岸全过程
fpga开发
芯门1 天前
FPGA商用级ISP(二):镜头阴影校正(LSC)的网格增益插值与并行硬件架构实现
图像处理·fpga开发·isp
Felven1 天前
corundum 40G开源网卡测试结果
fpga开发·性能测试·dds·开源网卡·mqnic
顾知行1 天前
ABB PC D230 3BHE022291R0101 励磁CCM测量板
fpga开发·abb·abb励磁
芯门1 天前
FPGA商用级ISP:动态坏点校正(DPCC)的滑窗架构与并行判决实现
图像处理·fpga开发·isp
碎碎思2 天前
双管齐下筑优势 AMD 扩容中端 FPGA 阵营并延至 2045 + 长期供货
fpga开发