title: output not updating until next clock cycle
body: <p>I have the code module below</p>
  
  <pre><code>always @(posedge Clk) begin
  
  ForwardA = 0;
  ForwardB = 0;
  
  //EX Hazard
  if (EXMEMRegWrite == 1) begin
   if (EXMEMrd != 0)
      if (EXMEMrd == IDEXrs)
          ForwardA = 2'b10;
     if (EXMEMrd == IDEXrt &amp;&amp; IDEXTest == 0)
          ForwardB = 2'b10;
  end
  
  
  //MEM Hazard
  
  if (MEMWBRegWrite == 1) begin
   if (MEMWBrd != 0) begin
      if (!(EXMEMRegWrite == 1 &amp;&amp; EXMEMrd != 0 &amp;&amp; (EXMEMrd == IDEXrs)))
              if (MEMWBrd == IDEXrs)
                  ForwardA = 2'b01;
      if (IDEXTest == 0) begin
          if (!(EXMEMRegWrite == 1 &amp;&amp; EXMEMrd != 0 &amp;&amp; (EXMEMrd == IDEXrt)))
              if (MEMWBrd == IDEXrt)
                  ForwardB = 2'b01;
      end
   end
  end
  
  end
  </code></pre>
  
  <p>The problem is that the output, which is ForwardA and ForwardB is not updated not on the rising clock edge rather than on the next rising clock edge... why is this?? How do I resolve so that the output is updated on the same positive rising clock edge?</p>
  
  <p>Here's what I mean:
  <a href="http://img693.imageshack.us/img693/8660/timing.jpg" rel="nofollow noreferrer">alt text http://img693.imageshack.us/img693/8660/timing.jpg</a></p>
  
  <p>ForwardA is updated with 2 on the next rising clock edge and not on the same rising clock edge</p>