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.

or in Verilog for coding flipflop

Status
Not open for further replies.

sun_ray

Advanced Member level 3
Advanced Member level 3
Joined
Oct 3, 2011
Messages
772
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,298
Visit site
Activity points
6,828
What is this or when we use this or as shown below in Verilog? Verilog has a || operator for OR.

always @ (posedge clock or negedge reset)
 

In Verilog "or" is not an operator; It is an operand namely Identifier, Please refer to the below links **broken link removed** , **broken link removed**
 

Both the or operator and comma , operator mean either event. It the same as writing @(posedge clock, negedge reset), which can be read as "wait for either a positive edge of clock, or a negative edge of reset". You cannot logically OR these two events together.
Note that @(A || B) is very different from @(A or B). The former means "wait for the result of the expression A||B to change", whereas the latter means "wait for a change on either A or B".
 
  • Like
Reactions: no_mad

    no_mad

    Points: 2
    Helpful Answer Positive Rating
Both the or operator and comma , operator mean either event. It the same as writing @(posedge clock, negedge reset), which can be read as "wait for either a positive edge of clock, or a negative edge of reset". You cannot logically OR these two events together.
Note that @(A || B) is very different from @(A or B). The former means "wait for the result of the expression A||B to change", whereas the latter means "wait for a change on either A or B".
I agree with the reply.......
 

Both the or operator and comma , operator mean either event. It the same as writing @(posedge clock, negedge reset), which can be read as "wait for either a positive edge of clock, or a negative edge of reset". You cannot logically OR these two events together.
Note that @(A || B) is very different from @(A or B). The former means "wait for the result of the expression A||B to change", whereas the latter means "wait for a change on either A or B".

Do you want to mean that the following tow conditions are equivalent?

@(posedge clock, negedge reset)

@(posedge clock or negedge reset)
 

It's all about reading
9.4.2.1 Event OR operator

The logical OR of any number of events can be expressed so that the occurrence of any one of the events
triggers the execution of the procedural statement that follows it. The keyword or or a comma character (,)
is used as an event logical OR operator. A combination of these can be used in the same event expression.
Comma-separated sensitivity lists shall be synonymous to or-separated sensitivity lists.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top