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.

About Verilog syntax for parantheses

Status
Not open for further replies.

sun_ray

Advanced Member level 3
Joined
Oct 3, 2011
Messages
772
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,298
Activity points
6,828
Can we use this following in Verilog

y= ( a | ~b) where a and b are inputs and y is an output?

The reason I ask this question because we are using parantheses () here and in Verilog specification file I am not able to find where () is defined. In the list of operator I do not find () is defined. Is it an allowed construct in Veriliog? If, yes please let me know the section in Verilog Specification file where it is defined. Sometimes we use the following:

y = c | ({d, ( a | ~b)}) where a,b,c,d are inputs and y is an output.

Can anybody explain more on () ? Can this () be used to provide priority in evaluation as it is done in mathematics?
 

Parentheses can be used to change the operator precedence.
sold1.png
 

poluekt

The attached table which has been taken from Verilog IEEE Spec does not show that parantheses can be used to change the operator precedence. This table nowhere has listed parantheses.

Regards
 

That table is old. Please look at table 11-2 the 1800-2009 LRM which lists () as the highest operator precedence.
 

dave_59

I think Verilog do not have any 2009 specification as such. There is a system verilog LRM for 2009 and Verilog does not exist any more after 2009, it is sustem verilog now.
 

sun_ray,

The Verilog LRM has always had the sentence, Parentheses can be used to change the operator precedence, and the example
Code:
(A + B) / C // not the same as A + B / C
The parenthesis were just missing from the table.

You are correct to say there is no more stand-alone Verilog standard. The SystemVerilog IEEE 1800-2005 was created as an extension to the Verilog 1364-2005 standard. However, the SystemVerilog 1800-2009 standard merged the two standards together into one. Any updates to what was in the old Verilog standard goes into the new SystemVerilog standard.

Dave Rich
Co-Chair of the SystemVerilog IEEE 1800-2009 Technical Committee

P.S. SystemVerilog is spelled as one word. :|
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top