- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My thread is mainly on the remainder output from the lpm_divide.
I am using the lpm_divide megafunction for diving two 16 bit fixed point numbers and the denominator is always greater than or equal to the numerator. Meaning, the result of the division in my case would be less than 1 90% of the time. The quotient of the megafunction would give either a 0 or 1. But what about the remainder? For example, (0.25 / 0.50) * (2^15/2^15) = 8192/16384 using lpm_divide would give a quotient 0. But would the remainder be simply 8192? Thanks in advance for the help.Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's correct you should get that value as the remainder. As a result I would prescale the numerator more than the denominator so that you get a quotient that is beyond 0 or 1 (otherwise you don't really need a divider to figure out the answer....)
Reply
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