Blocking assignments in reverse order in a clocked block

Consider this Verilog block, in which r0, r1 and r2 are 1-bit registers:


Verilog
always @(posedge clk) begin
  r2 = r1;
  r1 = r0;
  r0 = din;
end


Just before a rising edge of clk, the signals are settled at din = 1, r0 = 0, r1 = 1 and r2 = 0. No other block assigns or reads these registers. What are the register values after this single rising edge?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Computer-Aided Design and Simulation Tools for Digital Design Questions: