34. Procedural Constructs

Question.3

If the intent of the below code is to build a two-stage pipeline (a shift register where q2 gets the previous clock cycle's value of q1), what is the outcome?

module shift_reg(input clk, input d, output reg q1, output reg q2);
    always @(posedge clk) begin
        q1 = d;
        q2 = q1;
    end
endmodule

 

Need Help? Refer to the Quick Guide below

Select Answer