# What is the exact difference between static tasks/functions and automatic tasks/functions ? please explain with a clear example

**URL:** <https://verificationacademy.com/forums/t/what-is-the-exact-difference-between-static-tasks-functions-and-automatic-tasks-functions-please-explain-with-a-clear-example/31014>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog\
**Created:** [September 9, 2015, 10:45am UTC](https://verificationacademy.com/forums/t/what-is-the-exact-difference-between-static-tasks-functions-and-automatic-tasks-functions-please-explain-with-a-clear-example/31014 "2015-09-09T10:45:53Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![tejal\_vernekar](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/t/a8b319/32.png) [@tejal\_vernekar](https://verificationacademy.com/forums/u/tejal_vernekar)\
**Post date:** [January 8, 2018, 2:10pm UTC](https://verificationacademy.com/forums/t/what-is-the-exact-difference-between-static-tasks-functions-and-automatic-tasks-functions-please-explain-with-a-clear-example/31014/15 "2018-01-08T14:10:02Z")

</div>

_In reply to [puttasatish](https://verificationacademy.com/forums/t/what-is-the-exact-difference-between-static-tasks-functions-and-automatic-tasks-functions-please-explain-with-a-clear-example/31014/14):_

Can anyone please explain me

```verilog
module test();
 
task add(int a, int b);
	#2;
	$display("the sum is %0d", a+b);
endtask
 
initial
	fork
		begin
			add(2,3);
		end
		begin
			#1;
			add(3,4);
		end
	join
endmodule

```

How do we get sum is 7  
Sum is 7  
According to me, it should be 5 and 7, but for what reason the sum 7 and 7

---

_[View the full topic](https://verificationacademy.com/forums/t/what-is-the-exact-difference-between-static-tasks-functions-and-automatic-tasks-functions-please-explain-with-a-clear-example/31014)._
