real to time

A

Attila Csosz

Hi,

Is there a simple conversion routine in vhdl to convert real type time
data to time type data? For example: "0.001" -> "1 ms"

Thanks
Attila
 
R

Reiner Huober

Is there a simple conversion routine in vhdl >to convert real type time
data to time type data? For >example: "0.001" -> "1 ms"

Just multiply with the physical unit (1 sec):

variable f: real:=0.001;
variable t: time;
....

t:=f*1 sec;

(I only tried this with integers until now, but accoring to the LRM,
this should work)
Hubble.
 
B

Brian Drummond

Hi,

Is there a simple conversion routine in vhdl to convert real type time
data to time type data? For example: "0.001" -> "1 ms"

Thanks
Attila

Just multiply by the appropriate time unit (in your example, 1 second).

- Brian
 

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,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top