[HDLBits] Sim/circuit9

[HDLBits] Sim/circuit9

码农世界 2024-05-23 前端 58 次浏览 0个评论

Sim/circuit9

This is a sequential circuit. Read the simulation waveforms to determine what the circuit does, then implement it.

module top_module (
    input clk,
    input a,
    output [3:0] q );
    always @(posedge clk) begin
        if(a) q<=4'd4;
        else if(q<6) begin
            q<=q+4'b1;
        end
        else q<=4'b0;
    end
endmodule

转载请注明来自码农世界,本文标题:《[HDLBits] Sim/circuit9》

百度分享代码,如果开启HTTPS请参考李洋个人博客
每一天,每一秒,你所做的决定都会改变你的人生!

发表评论

快捷回复:

评论列表 (暂无评论,58人围观)参与讨论

还没有评论,来说两句吧...

Top