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.

Need help with VHDL Operators

Status
Not open for further replies.

wo_osama

Newbie level 1
Joined
Jan 1, 2013
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,292
I need to know what the difference between "=" and "<="
for example

architecture UPCOUNTER IS
begin
process(clk,rst)
begin
if rst='1' then cout <="000";
elseif rising_edge(clk) then cout <= cout +1;
end if;
end process;
end upcounter;


I need to know why is it we used "=" with if but "<=" with the rest, I usually pull it off by luck I don't give it a lot of thoght, but I have a lab exam tomorrow and I expect to be asked about these little things, so help needed, really appreciate it.
Thanks in advance.
 

if rst='1' then cout <="000";

This means if rst equals 1 then assign 000 to signal cout.

<= is the assignment operator for signals

Note that based on the context <= can also mean "less than or equal".
 

as alexan_e said,
you should look at <= as a signle symbol - instead of looking at it as < and = seperated
 

This means if rst equals 1 then assign 000 to signal cout.

<= is the assignment operator for signals

Note that based on the context <= can also mean "less than or equal".

Correct, I add that this aspect of VHDL is called OVERLOAD. This is a mechanism which permit to define more functions with the same name, the use of each function is based on the operand check (or "context" as alexan_e as mentioned). Then in VHDL exist more of one function called "<=". For example when "<=" work with two signals operands in a logic expression, it can make a comparison between their values, when it work with a signals but in a cuncurrent statement it perform an assigment action, the IDE resolve the functions in synthesis phase and will associate the right function to the operands.
 

Correct, I add that this aspect of VHDL is called OVERLOAD. This is a mechanism which permit to define more functions with the same name, the use of each function is based on the operand check (or "context" as alexan_e as mentioned). Then in VHDL exist more of one function called "<=". For example when "<=" work with two signals operands in a logic expression, it can make a comparison between their values, when it work with a signals but in a cuncurrent statement it perform an assigment action, the IDE resolve the functions in synthesis phase and will associate the right function to the operands.

That's not quite true. <= as the assignment cannot be overridden. No matter what, the assignment will occur as spelled out in the LRM. <= as the 'less than or equal to' function can be overridden as you indicate.

Kevin Jennings
 

That's not quite true. <= as the assignment cannot be overridden. No matter what, the assignment will occur as spelled out in the LRM. <= as the 'less than or equal to' function can be overridden as you indicate.

Kevin Jennings
Thanks for clarification!
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top