[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
相关推荐
hong_fpgaer1 小时前
XILINX ZYNQ FPGA PS端DMA握手流程
fpga开发·vivado
北城笑笑2 小时前
FPGA 50 ,Xilinx Vivado 2020 版本安装流程,以及常见问题解析,附中文翻译( Vivado 2020 版本安装教程 )
fpga开发·fpga
GateWorld17 小时前
主流FPGA厂商对SystemVerilog的支持现状
fpga开发·system verilog
Smart-佀2 天前
FPGA入门:CAN总线原理与Verilog代码详解
单片机·嵌入式硬件·物联网·算法·fpga开发
丁劲犇2 天前
B205mini FPGA工程粗浅解析:从架构到Trae开发介绍
ai·fpga开发·架构·ise·trae·b210·b205mini
应用市场2 天前
无线充电器原理与电路设计详解——从电磁感应到完整实现
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开发