what is different signal and variable in vhdl?

Status
Not open for further replies.

u24c02

Advanced Member level 1
Joined
May 8, 2012
Messages
404
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Visit site
Activity points
4,101
Hi.

When i have trying to use these signal and variable in vhdl, i dont know exactly different each of them.

What they have pros and cons and how can handle to use? Would you let me know?
 

You can refer any material on the net for this. Basically signal is global(throughout the architecture) while variable is local to the process it is defined in.
 

Also in a process signal assignments are scheduled whereas variable assignments are dome immediately.

Regards
 

There are three major difference between a signal and a variable in the VHDL

Coverage wise –

Signals has coverage to whole architecture, it can be access from any place in a Architecture of entity

A variable is local to a procedure defined in the architecture

Behavior wise –

Signal assignments executes concurrently, It means, if we have 5 signals assignment, then it depends on the simulator to decide which signal to be assigned first

In case of variable, it takes the value immediately OR in other language, it executes sequentially

Synthesis Wise –

If we have 2 variable and two signals used in a process, the variables infer just a wire during synthesis, but the signals infer a Flop.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…