# Assign statement

**URL:** <https://verificationacademy.com/forums/t/assign-statement/42240>\
**Category:** SystemVerilog\
**Tags:** Dave-Rich, SystemVerilog, System-Verilog, Chris-Spear\
**Created:** [August 29, 2023, 10:23am UTC](https://verificationacademy.com/forums/t/assign-statement/42240 "2023-08-29T10:23:24Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![m\_v](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/a3d4f5/32.png) [@m\_v](https://verificationacademy.com/forums/u/m_v)\
**Post date:** [August 31, 2023, 4:51am UTC](https://verificationacademy.com/forums/t/assign-statement/42240/3 "2023-08-31T04:51:36Z")

</div>

_In reply to [cgales](https://verificationacademy.com/forums/t/assign-statement/42240/2):_

Hi, i also checked same question on verification academy :-[https://verificationacademy.com/forums/systemverilog/drive-reg-using-continuous-assign](https://verificationacademy.com/forums/systemverilog/drive-reg-using-continuous-assign), Problem here is that in **Verilog** we can not write **reg type** variable on the **L.H.S** of the **assign statement**.

**Verilog** there are 3 types of assignments 1.continuous assignment 2.procedral assignment 3. procedural continuous assignment, and for **continuous assignment** at the **L.H.S**  **must be a net** it **can not be a reg type** , but when it is **procedural continuous assignment** then it is **valid to have reg at L.H.S** but we **can not write net**.

**System Verilog** also has this 3 types but here with **continuous assignment** when we write **reg** at **L.H.S** it is **valid** and **net** type also **valid** , with the **procedural continuous** assignment the L.H.S must be **reg** , **wire** is **invalid.**

Also one observation is that in **system Verilog** when you drive net with assign statement then the display is executed first(out = x) and then the assignment to the net is done if i put #0 delay as per the code the display will be executed in inactive region and the new value will be displayed(out = 1) and with reg it is working fine no need to put #0 delay, i am not able to find out why this is happening?

```verilog
module test;
  reg a = 1'b1;
  wire out;
  
  assign out = a ? 1:0;
  
  initial begin
    #0 $display("out = %b",out);
  end
endmodule

```

Thank you.

---

_[View the full topic](https://verificationacademy.com/forums/t/assign-statement/42240)._
