Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Variables Vs signals

 
Thread Tools Search this Thread
Old 01-18-2005, 05:54 AM   #1
Default Variables Vs signals


I was wondering what are the advantages and drawbacks on using
variables as compared to signals in vhdl. I know what they are used to
model, but are there any specific reasons say as regards to simulation
etc?



zingafriend@yahoo.com
  Reply With Quote
Old 01-18-2005, 07:22 AM   #2
Paul Uiterlinden
 
Posts: n/a
Default Re: Variables Vs signals
wrote:
> I was wondering what are the advantages and drawbacks on using
> variables as compared to signals in vhdl. I know what they are used to
> model, but are there any specific reasons say as regards to simulation
> etc?


For communication between processes, only signals can be used (not
considering shared variables here).

If a signal is only used within a process and not read by any other
process, it can be replaced by a variable. The advantage is that the
scope is limited (localized), which in general is a good thing.

In contrast to signals, the order of reading/assigning variables is
important. Remember: the value assigned to a signal can be read back
only after at least a delta cycle. Another way of looking at it (in case
of a flip-flop): a signal only allows acces to the Q output of a
flipflop, a variable also makes it possible to read the D input of a
flipflop.

Variables allow for a more sequential style of "programming", which can
be an advantage.

Finally, when modeling memory (RAM), it is better to use a variable.
Because variables do not have an event queue associated, their space
requirement (memory footprint on your workstation/PC) is about ten times
smaller than the equivalent signal. For large RAMs this could make the
difference between being able to run, or just thrashing your disk caused
by swapping.

Paul.


Paul Uiterlinden
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding variables to HREF shareptmike Software 0 09-11-2009 10:23 AM
VB.net (using session variables) susan_1516 Software 0 09-26-2008 08:01 AM
VHDL assign multiple concatenated signals veevee1 VHDL 0 03-07-2007 11:26 AM
SCSI Long Cables, High Voltage Differential Signals and Data Skew? Will Hay A+ Certification 1 03-04-2004 06:44 PM
SCSI Long Cables, High Voltage Differential Signals and Data Skew? Will Hay A+ Certification 0 03-04-2004 06:29 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46