移位寄存器模型TOTONGqlq3g2clk移位寄存器电路2025/12/3
7 2025/12/3 移位寄存器模型 q1 q2 q3 d clk 移位寄存器电路
阻塞赋值实现移位寄存器模型1909XTOTONGmodulepipeb1(q3,d,clk);modulepipeb2(q3,d,clk):output[7:o]q3;output[7:0]q3;input [7:0] d;input [7:0] d;inputclk;inputclk;reg[7:0]q3,q2,q1;reg[7:0]q3, q2, q1;always@(posedgeclk)always@(posedgeclk)beginbeginq1=d;q3=q2;q2=q1;q2= q1;Xq1= d;q3=q2;endend综合结果endmoduleendmodule02025/12/3
8 2025/12/3 阻塞赋值实现移位寄存器模型 module pipeb1 (q3, d, clk); output [7:0] q3; input [7:0] d; input clk; reg [7:0] q3, q2, q1; always @(posedge clk) begin q1 = d; q2 = q1; q3 = q2; end endmodule module pipeb2 (q3, d, clk); output [7:0] q3; input [7:0] d; input clk; reg [7:0] q3, q2, q1; always @(posedge clk) begin q3 = q2; q2 = q1; q1 = d; end 综合结果 endmodule × √
大TOTONGq3Cclk实际综合的结果92025/12/3
9 2025/12/3 q3 d clk 实际综合的结果
阻塞赋值实现移位寄存器模型1909大T支OTONGmodulepipeb4 (q3,d,clk);modulepipeb3(q3,d,clk);output[7:0]q3;output[7:0]q3;input [7:0] d;input [7:0] d;inputclk;inputclk;reg[7:0]q3,q2,q1;reg[7:0] q3, q2, q1;always@(posedgeclk)q1=d;always@(posedgeclk)q2=q1;always@(posedgeclk)q2=q1;always@(posedgeclk)q3=q2;always@(posedgeclk)q3=q2;always@(posedgeclk)q1=d;endmoduleendmodulenot goodnotgood102025/12/3
10 2025/12/3 阻塞赋值实现移位寄存器模型 module pipeb3 (q3, d, clk); output [7:0] q3; input [7:0] d; input clk; reg [7:0] q3, q2, q1; always @(posedge clk) q1 = d; always @(posedge clk) q2 = q1; always @(posedge clk) q3 = q2; endmodule module pipeb4 (q3, d, clk); output [7:0] q3; input [7:0] d; input clk; reg [7:0] q3, q2, q1; always @(posedge clk) q2 = q1; always @(posedge clk) q3 = q2; always @(posedge clk) q1 = d; endmodule not good not good
非阻塞赋值实现移位寄存器模型1909"ALIS大TOTONGmodulepipen2 (q3, d,clk);modulepipen1(q3,d,clk);output[7:0]q3;output[7:0]q3;input [7:0] d;input[7:0]d;clk;inputclk;inputreg[7:0] q3, q2, q1;reg[7:0]q3,q2,q1;always@(posedgeclk)always@(posedgeclk)beginbeginq1<=d;q3<= q2;q2<=q1;q2<=q1;q3 <= q2;q1<= d;endendendmoduleendmodule112025/12/3
11 2025/12/3 非阻塞赋值实现移位寄存器模型 module pipen1 (q3, d, clk); output [7:0] q3; input [7:0] d; input clk; reg [7:0] q3, q2, q1; always @(posedge clk) begin q1 <= d; q2 <= q1; q3 <= q2; end endmodule module pipen2 (q3, d, clk); output [7:0] q3; input [7:0] d; input clk; reg [7:0] q3, q2, q1; always @(posedge clk) begin q3 <= q2; q2 <= q1; q1 <= d; end endmodule √ √