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.

help me with verilog code

Status
Not open for further replies.

ashishk

Junior Member level 2
Joined
Dec 29, 2010
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,419
Hi,

I am a verification guy and want to know if following verilog codes are valid or not:

1) always @( a & b)
2) always @(a || b)
3) always @(a && b)
4) always @(a | b)

Thanks
 

One clarification. I want to know if in sensitivity list we can do '&' and '|' operation? And when it will get triggered.
 

Hi Ashishk

you can use logical statements in sensitivity list. Sometimes it uses for combinational circuits, in which all of the inputs have the same role. in the other word, it must be triggered if one of it's input changes. In this case we use or between signals in sensitivity list: always @ (a or b or c)
I have not seen using of "and" in any case.
but in sequential circuits, edge variations of signals are important.
in synchronous circuit, there is one signal (clock) in sensitivity list:
always @ (posedge clock)
always @ (negedge clock)
but in asynchronous circuits, we have more than one signal in sensitivity list:
always @ (posede clock or negede reset)
always @ (posedge clock1 or posedge clock2 )
 

just do:
always @(a and b)
always @(a or b)
or use always_comb block in system verilog.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top