Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20778 Discussions

how to define a float data,in nios ide

Altera_Forum
Honored Contributor II
1,330 Views

i need to define a float data , which it is 16 bits , how can i define it , when i try float a; then my results usually be odd. too big or too small , not the data i want to get . so i think there may be fixed definition for float just like the interay data in altera we define them alt_16.:)  

 

thanks a lot
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
577 Views

Why would you want to do that?

0 Kudos
Altera_Forum
Honored Contributor II
577 Views

because i have a fft code that run on int data , but i want to operat with floating data ,so i must change the data type , the int data it defined by alt_16, but in C, if i define a data in float ,it is 32 bit , so the number of bit is different ,, ........when i do so , the result of floating data is not what i want , so i thought the problem may be come from the definition .. whether i am wrong.

0 Kudos
Altera_Forum
Honored Contributor II
577 Views

Sunjie, 

 

I missed the part about the NIOS IDE interface. 

Sorry about that. 

 

I would think that this type question would be better answered in the NIOS Forum section, rather then in the "Hardware" type sections that are mostly in here. 

 

Good luck, 

Avatar
0 Kudos
Altera_Forum
Honored Contributor II
577 Views

ok ,thanks anyway , best wishes for you:)

0 Kudos
Altera_Forum
Honored Contributor II
577 Views

I think you're on your own with this problem. Some GPUs have a 16-bit floating point data type, but the C compiler for Nios does not. 

 

I'm sure that, if you built a C++ library for 16-bit floating point, other people would be interested in it too.
0 Kudos
Reply