V
valtih1978
What is the conceptual difference between function an operator? Do tools
treat differently or supposed to be treated differently?
treat differently or supposed to be treated differently?
What is the conceptual difference between function an operator? Do tools treat differently or supposed to be treated differently?
Tools are supposed to treat an operator and the equivalent function the same. I haven't run into any issues defining a function to use an operator but I also don't have a need to do this very often.
The biggest difference is that while you can come up with arbitrarily named functions with a whole bunch of parameters, the operators and the parameters for those operators are all pre-defined (i.e. +, -, 'and' 'or' ...)
Kevin Jennings
Additional operators cannot be defined by the user in VHDL. Existing operators can be redefined (overloaded) for additional data types, etc.
Off the top of my head, the only difference between an operator and an equivalent function are the infix vs postfix notation of the arguments.
A side effect of expression evaluation also provides a difference in the way operators and functions are executed. Operators in expressions can be executed in different orders based on rules defined in the standard. For instance, the expression: A+B+C can be evalutated in any order, but the expression: "+"(a, "+"(b, c)) must be evaluated in the order written. Note that synthesis may re-order the operations during optimization anyway.
Andy
What is the conceptual difference between function an operator? Do tools treat differently or supposed to be treated differently?
Is there a point to your questions or do you just want to argue?
You asked about differences between functions and operators. I gave you some differences within the scope of VHDL (what this group is about). There are differences between them. They are not the same. I will leave it up to you to determine whether those differences meet your definition of significance.
This is a vhdl group. I doubt you will find here many experts on, or many people who care about, the esoteric qualities of programming languages in which you appear interested.
Have a good day,
Andy
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.