[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
相关推荐
Smart-佀19 小时前
FPGA入门:CAN总线原理与Verilog代码详解
单片机·嵌入式硬件·物联网·算法·fpga开发
丁劲犇21 小时前
B205mini FPGA工程粗浅解析:从架构到Trae开发介绍
ai·fpga开发·架构·ise·trae·b210·b205mini
应用市场1 天前
无线充电器原理与电路设计详解——从电磁感应到完整实现
3d·fpga开发
ALINX技术博客1 天前
【ALINX选型】AMD Kintex UltraScale+ 系列 FPGA 开发板速选
fpga开发
碎碎思1 天前
从 HLS 到 RTL:高层次综合在 FPGA 设计中的价值与局限
fpga开发
s09071361 天前
FPGA视频编码器:H.264/H.265实现核心技术解析
图像处理·算法·fpga开发·音视频·h.264
156082072191 天前
在vivado中,国产CH347芯片实现USB转JTAG的操作
fpga开发
数字芯片实验室2 天前
IP验证最终回归到时序级建模
网络·网络协议·tcp/ip·fpga开发
雨洛lhw2 天前
三模冗余资源量对比
fpga开发·三模冗余技术
XINVRY-FPGA2 天前
XC7VX690T-2FFG1761I Xilinx AMD FPGA Virtex-7
arm开发·嵌入式硬件·fpga开发·硬件工程·fpga