1 Verilog描述

module shift_s2p(
    input     din,
    input     clk,
    input     clr,
    output reg [7:0] q
);
//串入并出移位寄存器
/* 该寄存器由8个同步D触发器组成 */
    [email protected](posedge clk or negedge clr)begin
        if(clr == 1'b0)
            q <= 8'b0000_0000;
        else 
            //q <= {q[6:0],din};   //非阻塞赋值
            begin
                q[0] = din;        //阻塞赋值
                q     = q << 1;   //阻塞赋值
            end
    end

endmodule

2 RTL视图

8位串入并出移位寄存器的Verilog描述

3 功能仿真

8位串入并出移位寄存器的Verilog描述

相关文章:

  • 2021-11-28
  • 2021-11-28
  • 2021-10-07
  • 2021-09-13
  • 2022-12-23
  • 2021-06-05
猜你喜欢
  • 2021-07-12
  • 2021-08-29
  • 2022-12-23
  • 2021-10-15
  • 2021-08-29
  • 2021-11-28
  • 2021-07-02
相关资源
相似解决方案