[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
相关推荐
QYR-分析1 小时前
FPGA视觉处理板行业发展现状、机遇与未来趋势分析
fpga开发
XMAIPC_Robot8 小时前
180FPS AI相机模组,轻巧大算力, 高性能双目同步摄像模组+搭配RK3588
人工智能·嵌入式硬件·深度学习·数码相机·fpga开发
人设定义中...8 小时前
电脑上的图片传输到VGA上显示 (设计作业)
fpga开发
XMAIPC_Robot8 小时前
基于RK3588 高算力,小尺寸,轻重量6T算力无人机AI模块,可接两路同步相机模组
运维·人工智能·深度学习·fpga开发·无人机·边缘计算
一口一口吃成大V8 小时前
多bit同步的处理
fpga开发
ALINX技术博客1 天前
【黑金云课堂】FPGA技术教程Vitis开发:PS端UART与CAN通信
fpga开发·fpga
FPGA小迷弟2 天前
FPGA工程师常见面试问题,有参考答案,必学!!!
fpga开发·面试·职场和发展·verilog·fpga·modelsim
followless2 天前
linux server中搭建questasim 10.6c & ise14.7
linux·fpga开发
乌恩大侠2 天前
【AI-RAN】WNC O-RU 配置、英伟达 AI-RAN、
fpga开发·o-ru
小麦嵌入式4 天前
FPGA入门(一):手把手教你用 Vivado 创建工程并仿真
stm32·单片机·嵌入式硬件·mcu·fpga开发·硬件架构·硬件工程