integer to std_logic_vector if width not known apriori?

Joined
Sep 30, 2007
Messages
1
Reaction score
0
In the case of attempting to write reusable code for a watchdog timer, can an integer be converted to a std_logic_vector without providing the desired width?

I have a generic counter function; I'd like to define only the timeout value and clock frequency and have the appropriate counter parameters be calculated.
So,
timeout / (1/freq) = real
real => integer
integer => std_logic_vector (of calculated width)

... escentually this would be a 'RANGE on an integer

This seems a very common need but isn't covered in the VDHL guides I have.

Thanks for any available help.
 
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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top