The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> VHDL-AMS >> real to int
https://designers-guide.org/forum/YaBB.pl?num=1095252233

Message started by markb on Sep 15th, 2004, 5:43am

Title: real to int
Post by markb on Sep 15th, 2004, 5:43am

???
Can anyone tell me f its possible to convert a real to an integer type in VHDL-AMS?  

I need to calculate the number of times for a for loop to execute and the answer comes out as a real, for loops only accept integers as you cant go round a loop 45.3 times say.

Any ideas?
Cheers
Mark

Title: Re: real to int
Post by Paul on Sep 15th, 2004, 12:15pm

Mark,

have a look at the math package, there's many conversion functions between the most common signal types in VHDL.

Paul

Title: Re: real to int
Post by Mark Burford on Sep 15th, 2004, 2:03pm

yeah, i kinda got that when I remembered VHDL-AMS was a superset of VHDL - 'feeling stupid right now'.
cheers!  it was signal = integer(real_number);
so simple.

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.