others and aggregates...

Joined
Jan 10, 2008
Messages
5
Reaction score
0
If I have a signal called jim, which is a vector of, say, 7 downto 0 and in a clk'd process I make these assignments to this signal for a given a case condition :

when condition_true

-- set all bits to zero
jim <= (others => '0');
-- set bit 4 active to '1'
jim(4) <= '1';


...will jim have all bits set to '0' apart from bit 4. Jim is a signal.

I think it will and this works but in terms of synthese do you have to assign to others first and then assign the bits you want to change or does it not matter?
 
Joined
Feb 17, 2008
Messages
19
Reaction score
0
jim

Your code is making two assignments to jim at the same time. Your compiler should puke all over you. It assigns jim(4) to '0' and jim(4) to '1' concurrently since they're being clocked together.

This should work:

when condition_true

-- set all bits at same time
jim <= (4 => '1', others => '0')
 
Last edited:

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,011
Latest member
AjaUqq1950

Latest Threads

Top