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.

Difference between signals and variables

Status
Not open for further replies.

sachin maheshwari

Newbie level 4
Joined
May 22, 2007
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,321
hi .....
can anyone tell me wat is the difference between signals and variables in VHDL
 

look at this like in mathematics : f(x)
F is the function following some rule and x is the parameter values
 

A Signal in VHDL is a wire. A signal will be synthesized into a wire or a flip-flop/latch depending on how you use it. Signals are global, they are visible to the entire module/ entity.

A variable is a temporary storage element. Variables are local, i.e, they are only visible inside the process where you declare them. Variables are mostly synthesized into latches or FFs. Variables can only be declared and used inside a PROCESS.

Refer VDHL synthesis primer by J.Bhasker for more info.
 

sachin maheshwari said:
hi .....
can anyone tell me wat is the difference between signals and variables in VHDL

hello friend
U see here is adifference b/w variable and signal precisely

VARIABLE Vs Signals:

Variables tak less memory , while signals need more information to allow for scheduling and signal attributes.

* Variables are assigned values immediately while signals tak some time to be assigned a value i.e signals are not updated Immediately

*Signals hav the history but variables dont hav.

*variables are for temporary storage and hav no hardware significance.
 

Hi
as far as iam concerned:
signal is a wire in VHDL where as variable is a temporary storage element(no HW synthesized);

if we want the value to change in the same cycle declare variable otherwise signal(in the next clock).
 

Moreover, variables can also be synthezied to FF if reading was done b4 writing(assign). It is advantageous to use variable instead of signal in same process.
 

in VHDL for the signals the driver is created which assign the values at the scheduled time
but for the variables no such drivers are created.

the values to the variable are assigned without any delta delay but for the signals the values are always assigned after the delta delay if no delay is specified in assignment statement.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top