VHDL bit_vector overload problem

#2576590
Sorry for the german ...

Ok you wrote

when 0 =>
  if input = "0000000001" then
  next_state <= 1;
  else
        next_state <= 0;
  end if;

so it depends on the input - how ist the input connected? How long is 
the input provided? I mean, if the input is only for a very short time 
not 0, then it is most of the time 0. And then your next_state = 2 and 
also current_state, because current_state is updated every clock.

Edit:
The process depends on current_state and input.

So if we step along, say current_state=0 and input= "0000000001" then 
the process assigns next_state to 1.
BUT: in the next clockcycle, current_state is updated to next_state, in 
this case to 1.
Because current_state ist updated, the process runs again and now with 
input still "0000000001" it goes to

when 1 =>
and because input is not "0000000000" the next_state = 0.

And so on. Now current_state is updated to 0 and it begins again even if 
the input doesn't change.

I don't know if it helps, but i would test if it works woth only input 
in the sensitivity list

process(input)

Reply

A question of your own? This thread is over 14 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.