On 11/11/2013 9:32 PM,
ramya.m...@gmail.com wrote:
> ""In VHDL, variable assignments (:=) take effect immediately, the way they
> would in a software language like C, such that subsequent lines see the
> changed value. ""
> What if the subsequent line is a signal assignment like in Assignment 1?
What line follows does not matter. A variable is updated immediately,
period, end of sentence. In example 1 v1 is updated by the assignment
before the next line is executed. So v1 takes the value '1' + S1
although I'm not sure what that means. S1 is an SLV and I don't know of
a library that defines the '+' operator for a character and an SLV. But
then I get rusty in VHDL between projects and I may just be forgetting
this one.
When the next line is executed s1 will be given the value of v1 so that
after the process exits s1 will be updated to the value that was in v1.
In example 2 the signal assignment is first so although s2 is assigned
the value of v2, it is not actually updated until the process exits,
long after v2 is updated by the subsequent statement. The assignment of
v2 happens immediately, but since s2 has not been updated v2 gets the
old value of s2.
> Also, in Assignment 1, is s1 a register? If yes, is setup time applicable to v1?
In example 1 s1 is indeed the output of a register. v1 is not the
output of a register, rather it is the output of the logic feeding
register s1, or you can think of it as the input to the register s1.
In the second example v2 is the output of a register because it is used
*before* it is assigned. That implies it must remember its value from
the last iteration of the code i.e. a register. So both s2 and v2 are
the outputs of registers.
Rick