double signal affectation

T

titi

Is this an issue that count be affected with two distinct values in the
same rising_edge?

What does happen in such a case?

Illustration:

Signal count : std_logic_vector (7 downto 0);
p_clocks : process (clock,Reset)
begin
if Reset='1' then
count <= x"77";
elsif rising_edge(clock) then
count <= count - '1';
if count = x"00" then
count <= x"77";
....
 
M

Mike Treseler

titi said:
What does happen in such a case?

The best way to find out is to
learn vhdl simulation.
Signal count : std_logic_vector (7 downto 0);
p_clocks : process (clock,Reset)
begin
if Reset='1' then
count <= x"77";
elsif rising_edge(clock) then
count <= count - '1';

That '1' would have to be 1 or x"01"
if count = x"00" then

Note that "count" refers the value from
last time, that is, before the decrement,
so that may not do what you expect.

If you prefer to have values follow the code,
as I do, consider using variables rather than
signals for such computations and comparisons.
Some examples:
http://home.comcast.net/~mike_treseler/

-- Mike Treseler
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top