counter as function

Guest #3741709
we have state machine in the main function that has a clock . in the 
transition between two states we need to wait for a period of time (the 
time  varies from time to time and we need to calculate it seperatly) 
and then to move to the next state.
In order to implement this we want to use a counter as a function. but 
we can't use process (CLK) in a function. what can we do else?
Moderator (Company: Titel) #3741752
itay wrote:
> In order to implement this we want to use a counter as a function. but
> we can't use process (CLK) in a function.
I want to celebrate Christmas in summer! But summer is in July and 
Christmas in December.

> what can we do else?
I will have to celebrate Christmas in winter. And you will have to use a 
process for the counter...

Or the other way: because you obviously don't know what a function in 
VHDL is and what a functions capabilites are you should not use it at 
all.

A function in VHDL is much different from a function in C or BASIC.

Reply

A question of your own? This thread is over 12 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.