# @always position

**URL:** <https://verificationacademy.com/forums/t/always-position/38577>\
**Category:** SystemVerilog\
**Tags:** always, SystemVerilog, Verilog\
**Created:** [January 12, 2021, 12:46pm UTC](https://verificationacademy.com/forums/t/always-position/38577 "2021-01-12T12:46:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![likhith\_bommu](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/l/ac91a4/32.png) [@likhith\_bommu](https://verificationacademy.com/forums/u/likhith_bommu)\
**Post date:** [January 12, 2021, 12:46pm UTC](https://verificationacademy.com/forums/t/always-position/38577/1 "2021-01-12T12:46:55Z")

</div>

Can somebody explain the difference between these two code blocks?

1st block:

@always(posedge clock) begin  
b = c;  
a = d;  
e \<= f;  
g \<= h;

end

2nd block:

begin  
b = c;  
a = d;  
e \<= f;  
g \<= h;  
@always(posedge clock) end

Will the two blocks behave differently? If not in this case, is there any other case you can explain where they behave differently.

Thanks.

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [January 12, 2021, 7:55pm UTC](https://verificationacademy.com/forums/t/always-position/38577/2 "2021-01-12T19:55:12Z")

</div>

_In reply to [likhith bommu](https://verificationacademy.com/forums/t/always-position/38577):_

Both code blocks or not legal syntax. Please show complete examples to make sure the know the context of the question.

See [Asking better questions on the Verification Academy Forums with EDAPlayground - Verification Horizons](https://blogs.sw.siemens.com/verificationhorizons/2020/04/29/forums-with-edaplayground/)

---

<div class="post-metadata">

**Author:** ![likhith\_bommu](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/l/ac91a4/32.png) [@likhith\_bommu](https://verificationacademy.com/forums/u/likhith_bommu)\
**Post date:** [January 16, 2021, 3:06pm UTC](https://verificationacademy.com/forums/t/always-position/38577/3 "2021-01-16T15:06:09Z")

</div>

Hi Dave,

Sorry for not providing complete code. I tried to create 2 modules. Hope this will help you to understand my question.

module scene\_one (input clock,input a, input b, input c, input d, output reg o, output reg o\_d);  
always @ (posedge clock) begin  
o = ~((a & b) | (c^d));  
o\_d \<= o;  
end  
endmodule

module scene\_two (input clock,input a, input b, input c, input d, output reg o, output reg o\_d);  
begin  
o = ~((a & b) | (c^d));  
o\_d \<= o;  
always @ (posedge clock);  
end  
endmodule

Can you explain how each module samples the data and provides the output?
