Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- FPGAs and Programmable Solutions
- FPGA Intellectual Property
- decimal fraction

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

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-14-2012
11:56 AM

1,793 Views

decimal fraction

Hi,

How can I convert the decimal fraction to the mantissa format (IEEE). The MegaWizard function demands the decimal number in binary form (3 = 0011, for example). So how can I convert 0.3 to mantissa without multipling on 10 or 100 etc? Other way, if i starting to multiply so i don't net to use mantissa, am i wright? My final target is to apply the next math function y = 0.201x + 7.899 I supplying the "x" values. Can anybody help me with this question, please?Link Copied

5 Replies

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-14-2012
12:46 PM

46 Views

the input is an integer, which will always be binary. But in fixed point, the integer and fractional parts are just normal integers offset by 2^n. Have a read up on fixed point number formats.

Are you sure you want to use flooating point?
Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-15-2012
04:07 AM

46 Views

I am not sure :)

Are u talkin about the fixed point of MegaWizard? As i remember, it's posibble when i am choosing to use ALTFP_CONVERT.
Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-15-2012
06:46 AM

46 Views

I suggest you read up on fixed point arithmatic

http://en.wikipedia.org/wiki/fixed-point_arithmetic All integers are in 2s compliment - there is no decimal representation in any electronics.
Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-15-2012
07:01 AM

46 Views

thanks :)

I have already read about the fixed point. But i'll do it one more time.
Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-15-2012
08:36 AM

46 Views

Topic Options

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

For more complete information about compiler optimizations, see our Optimization Notice.