answersLogoWhite

0

Signals updates a value after some "delta" time or at the

end of the process. But variable updates a value immediately.

below are the example in which a process is used to calculate the signal RESULT .

Example of a process using Variables

architecture VAR of EXAMPLE is

signal TRIGGER, RESULT: integer := 0;

begin

process

variable variable1: integer :=1;

variable variable2: integer :=2;

variable variable3: integer :=3;

begin

wait on TRIGGER;

variable1 := variable2;

variable2 := variable1 + variable3;

variable3 := variable2;

RESULT <= variable1 + variable2 + variable3;

end process;

end VAR

-------------------------------------------------------------

Example of a process using Signals

architecture SIGN of EXAMPLE is

signal TRIGGER, RESULT: integer := 0;

signal signal1: integer :=1;

signal signal2: integer :=2;

signal signal3: integer :=3;

begin

process

begin

wait on TRIGGER;

signal1 <= signal2;

signal2 <= signal1 + signal3;

signal3 <= signal2;

RESULT <= signal1 + signal2 + signal3;

end process;

end SIGN;

-------------------------------------------------------------------

In the first case, the variables "variable1, variable2 and variable3"

are computed sequentially and their values updated instantaneously after

the TRIGGER signal arrives. Next, the RESULT is computed using the new

values of the variables. This results in the following values (after a

time TRIGGER): variable1 = 2, variable2 = 5 (=2+3), variable3= 5. Since

RESULT is a signal it will be computed at the time TRIGGER and updated

at the time TRIGGER + Delta. Its value will be RESULT=12.

On the other hand, in the second example, the signals will be computed

at the time TRIGGER. All of these signals are computed at the same time,

using the old values of signal1, 2 and 3. All the signals will be

updated at Delta time after the TRIGGER has arrived. Thus the signals

will have these values: signal1= 2, signal2= 4 (=1+3), signal3=2 and

RESULT=7.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

What is the difference between a variable and a formula?

A variable is a single term that is free to change its value. A formula is a relationship between terms which describes one variable in terms of several others, which usually has 1 variable on the left hand side, and at least 1 on the other side. For example (if x and y are variables, then y = x&sup2; is a formula of y in terms of x).


What is the difference between bill and invoice?

What is the difference between Invoice &amp; Bill, in common terms. What is the difference between Invoice &amp; Bill, in common terms.


What does the equation 2n46 mean in terms of the relationship between the variable n and the number 46?

The equation 2n46 means that the variable n, when multiplied by 2, equals 46. This shows the relationship between the variable n and the number 46 in terms of multiplication.


What is the difference between dependent and independent events in terms of probability?

What is the difference between dependant and independent events in terms of probability


What is the difference between 'as on' and 'as at' in accounting?

There is no difference between both terms as both terms represents the date at which financial statements are prapared.


What is the basic difference between algebraic expression and polynomial?

A polynomial is a type of algebraic expression. They differ in the number of terms that contain variables. An algebraic expression has at least 1 variable, while a polynomial has multiple terms with variables in it.


Difference between variable and constant in terms of memory types?

constant means data item whose value cannot be altered or change. whereas variable is named storage location whose value can be manipulated during program run.


What is the difference between an amp and a speaker?

An amp, short for amplifier, is a device that increases the strength of an electrical signal, while a speaker is a device that converts electrical signals into sound waves. In simpler terms, an amp makes the signal stronger, while a speaker turns that signal into sound.


What is the difference between an explicit rule and a recursive rule?

An explicit rule defines the terms of a sequence in terms of some independent parameter. A recursive rule defines them in relation to values of the variable at some earlier stage(s) in the sequence.


What is the difference between succeeding terms called?

The difference between succeeding terms in a sequence is called the common difference in an arithmetic sequence, and the common ratio in a geometric sequence.


What difference between second name and surname?

There is no difference, the terms are synonymous.


What is the difference between a liqueur and a cordial?

There is no difference, the terms are used interchangeably.