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.

verilog : conditional assign statement

Status
Not open for further replies.

ashishnetam

Newbie level 2
Joined
Nov 18, 2008
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,298
verilog assign

Hi All,

Can I use assign statement in verilog according to any active variable?

For example suppose I want to use assign statement if active( any reg ) is enable (say high active).

assign xyz = abc if (active ) other wise dont execute this statement at all.

Is it possible to do in verilog?


Thanks in advance
Ashish
 

verilog conditional assign

I think the clearest way is to use an if statement in a combinational always block. It infers an asynchronous latch.

Code:
always @(active, abc)
begin
  if (active) xyz <= abc;
end
The specification of all input signals is needed for correct simulation behaviour.

The below statement should work, too:
Code:
assign xyz = (active)?abc:xyz;
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top