[HDLBits] Countslow

Build a decade counter that counts from 0 through 9, inclusive, with a period of 10. The reset input is synchronous, and should reset the counter to 0. We want to be able to pause the counter rather than always incrementing every clock cycle, so the slowena input indicates when the counter should increment.

复制代码
module top_module (
    input clk,
    input slowena,
    input reset,
    output [3:0] q);
	always@(posedge clk) begin
        if(reset||(slowena&&q>=9))
            q<=4'b0;
        else if(q<9&&slowena)
            q<=q+1;
        else;
    end
endmodule
相关推荐
博览鸿蒙9 小时前
FPGA会用到UVM吗?
fpga开发
ThreeYear_s18 小时前
基于FPGA实现数字QAM调制系统
fpga开发
小飞侠学FPGA19 小时前
VIVADO的IP核 DDS快速使用——生成正弦波,线性调频波
fpga开发·vivado·dds
博览鸿蒙1 天前
成为一个年薪30W+的FPGA工程师是一种什么体验?
fpga开发
喜欢丸子头2 天前
xilinx vivado fir ip(FIR Compiler)核 ADC高采样率,FPGA工作时钟为采样率的1/4,同一个时钟周期来四个数据。
fpga开发
璞致电子2 天前
【PZ-AU15P】璞致fpga开发板 Aritx UltraScalePlus PZ-AU15P 核心板与开发板用户手册
嵌入式硬件·fpga开发·fpga·fpga开发板·xilinx开发板
红糖果仁沙琪玛2 天前
fpga iic协议
fpga开发
嵌入式-老费2 天前
Zynq开发实践(FPGA之pwm输出)
fpga开发
hexiaoyan8272 天前
光纤加速的板卡设计原理图:基于6U VPX XCVU9P+XCZU7EV的双FMC信号处理板卡
嵌入式硬件·fpga开发·光纤加速板卡·国产化板卡·xcvu9p板卡·xcvu9p
XiaoChaoZhiNeng2 天前
Altera Quartus17.1 Modelsim 库编译与仿真
fpga开发