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.

Question on Verilog operator ++

Status
Not open for further replies.

feel_on_on

Full Member level 5
Joined
Apr 29, 2005
Messages
283
Helped
6
Reputation
12
Reaction score
4
Trophy points
1,298
Activity points
3,208
example: y = a+b++c++d++x;

who can tell me what operator is ++ ?

"++" means what on verilog ?


Thanks
 

Question on verilog

That's a syntax error in Verilog. It doesn't have any ++ operator.

SystemVerilog and C provide the ++ increment operator, but it's a unary operator, so the example would still be a syntax error.
 

Question on verilog

does verilog-A use "++"? then...simulated with nc-verilog . no error was reported!
 

Question on verilog

Oh wait! Verilog could be interpreting it like this, which is legal:
y = a+b++c++d++x;
y = a + b + +c + +d + +x;
y = a + b + (+c) + (+d) + (+x);
y = a + b + c + d + x;

ModelSim (possibly incorrectly) rejects a+b++c++d++x, but the Xilinx XST compiler accepts it as a+b+c+d+x.

Unary '+' is rarely used, and it seems suspicious here. This could be one of those sneaky interview questions. It caught me! :oops:
 

Question on verilog

anybody can explain this for me?
y = a+b++c++d++x;
 

Re: Question on verilog

++ operator in verilog is error, it does not have any such operator

++ supports in C and system verilog
 

Re: Question on verilog

i am agree with echo47,
"+" can also work as unary operator in verilog
And as this unary operator has higher precedence over the binary "+" operator, your expression will work as explained by echo47.

Good question...
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top