signal update problem

S

sohannin

I have a small part in my code like this (this is completely bogus but the
idea is the same):

process (ck)
....
internal_sum_2(0) <= internal_sum(0) XOR my_signal(0);
internal_sum_2(7 downto 1) <= internal_sum(7 downto 1) XOR "0000001";

sum <= internal_sum_2;
end process;
....

So this process is synchronous and signals update the sum which is
out-port. But why do they update the sum at both instances, i.e. the first
clause updating only the lowest bit of internal_sum_2 causes a change in
the output port "sum" immediately even though statements inside the
process should be sequential? My intention is to first construct the whole
8-bit vector and update the output port's all bits at the same time. What
am I doing wrong?
 
Joined
Jan 26, 2006
Messages
6
Reaction score
0
try using a variable inside the process block to do ur operations and then assign it back to out-port at the end of process block .... i think, use of a variable rather than a signal will solve ur problem
 
A

amitesh

you should put sum in a separate process with internal_sum_2(7) in the
sensitivity list.
 
A

anupam

Are you sure about the code written here is the same as code you are
running?
Because this happens when the internal_sum or the sum is a variable
.......
Shouldn't happen in this case ....
The signals are updated sequentially after a delta delay in a
process....

regards,
Anupam Jain
 
S

sohannin

Yes, quite sure. ;)

Internal sum wasn't a variable, but now it is. And now it works, for some
reason. I had to change all the internal signals to variables to cause the
sum to update only when the result is ready.
 
S

sohannin

you should put sum in a separate process with internal_sum_2(7) in the
sensitivity list.

Hmm, that's a good idea, thanks! Although it now works with variables.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top