B
Bigyellow
Guest
Hi
which one is correct
1)
if reset = '0' then
..
elsif clk'event and clk = '1' then
current_state <= next_state;
case current_state
when ....
when ....
end case
end if;
or
2)
if reset = '0' then
..
elsif clk'event and clk = '1' then
current_state <= next_state;
case next_state
when ....
when ....
end case
end if;
The fisrt looks reseanable. but I am afraid that when the current_state
is a signal, I can not read the current_state immediately in the case
statement, when the current_state is changed. is it right?
which one is correct
1)
if reset = '0' then
..
elsif clk'event and clk = '1' then
current_state <= next_state;
case current_state
when ....
when ....
end case
end if;
or
2)
if reset = '0' then
..
elsif clk'event and clk = '1' then
current_state <= next_state;
case next_state
when ....
when ....
end case
end if;
The fisrt looks reseanable. but I am afraid that when the current_state
is a signal, I can not read the current_state immediately in the case
statement, when the current_state is changed. is it right?