Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

assignment comparison in verilog

eda_student

Newbie
Joined
Jul 5, 2023
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
23
Hi,

what is difference between following 2 assignments?


Code:
always @(*)
    begin
     out_data = in_data;
     end

Code:
assign out_data = in_data;
 
the physical hardware generated by both statements will be the same.

there is only one verilog conceptual difference that the assigned inside the always block can only be done to a *reg* datatype. the assignment using the assign keyword can only be done to a *wire* datatype.
 
Synthesis treats the the two construct the same here. But one significant simulation difference is the always @* waits for a change on the RHS first before executing the assignment. If the RHS is a constant, it won't work.

The continuous assign statement executes once at time 0. The SystemVerilog always_comb statement does that too.
 

LaTeX Commands Quick-Menu:

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top