[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
相关推荐
尤老师FPGA10 天前
使用DDR4控制器实现多通道数据读写(十六)
fpga开发·ddr4
HX科技10 天前
STM32给FPGA的外挂FLASH进行升级
stm32·嵌入式硬件·fpga开发·flash·fpga升级
sz66cm10 天前
FPGA基础 -- Verilog 驱动强度(drive strength)与电荷强度(charge strength)
fpga开发
海涛高软10 天前
FPGA深度和突发长度计算
fpga开发
hahaha601610 天前
vivado使用非自带的第三方编辑器
fpga开发
芝士不会写代码10 天前
【FPGA学习】DDS信号发生器设计
学习·fpga开发
9527华安11 天前
国产安路FPGA实现MIPI视频解码转HDMI输出,基于SC500摄像头,提供TD工程源码和技术支持
fpga开发·音视频·csi·mipi·dphy·安路fpga·sc500
可编程芯片开发11 天前
基于FPGA的白噪声信号发生器verilog实现,包含testbench和开发板硬件测试
fpga开发·白噪声·snr
风释雪FPGA11 天前
[XILINX]ZYNQ7010_7020_软件LVDS设计
fpga开发
XINVRY-FPGA11 天前
XCVU47P-2FSVH2892E Xilinx Virtex UltraScale+ FPGA AMD
c语言·c++·人工智能·嵌入式硬件·阿里云·fpga开发·fpga