11 Shift Regiters&More Circuits

【HDLBits刷题笔记】11 Shift Regiters&More Circuits

Shift4

异步复位同步置数和使能。

module top_module(
    input clk,
    input areset,  // async active-high reset to zero
    input load,
    input ena,
    input [3:0] data,
    output reg [3:0] q); 
    always@(posedge clk or posedge areset)
    begin
        if(areset)
            q <= "d0;
        else if(load)
            q <= data;
        else if(ena)
            q <= {1"b0,q[3:1]};
    end

endmodule
hmoban主题是根据ripro二开的主题,极致后台体验,无插件,集成会员系统
自学咖网 » 11 Shift Regiters&More Circuits