- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In my program i want to calculate some floating datas , but i dont know much about the data type about Altera. whether I can define them just like I did in VC. i want some material about such field.
thanks a lot :) sunjieLink Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can go into the megawizard and select the altfp_add_sub, altfp_div, or altfp_mult megafunction to do your floating point. I believe they let you select the floating point format. For example, if your c/c++ was using float, choose single precision. If your c/c++ was using double, choose double precision.
Be careful with floating point. It produces MUCH larger and MUCH slower circuits than a fixed point. Most people go out of their way to avoid it. Good luck with your project.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- In my program i want to calculate some floating datas , but i dont know much about the data type about Altera. whether I can define them just like I did in VC. i want some material about such field. thanks a lot :) --- Quote End --- Wanting floating point "in your program" sounds as you you want it in C code running on the Nios processor. That should work just fine. The Nios compiler handles single and double precision FP. There's no floating point hardware, though, so it's all handled in library functions - if speed is an issue, you might need to check that it runs as fast as you want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Nios II compiler will provide you with IEEE754 floating point math for single and double precision. This means that round to nearest (floating point math isn't exact so this is the closest you can get) will be implemented and denormal support is not available (that's when a number becomes so small it might as well be zero). The floating point megawizard functions provide similar math support.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page