Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch.embedded > #30246

Re: Fixed Point Calculations

From David Brown <david.brown@hesbynett.no>
Newsgroups comp.arch.embedded
Subject Re: Fixed Point Calculations
Date 2021-01-03 15:38 +0100
Organization A noiseless patient Spider
Message-ID <rsskse$423$1@dont-email.me> (permalink)
References <671ff803-ba6f-40df-8c65-57ddf689473cn@googlegroups.com> <071uuf1cjq04rqvog7tmhn0c12aflmdget@4ax.com> <8441a69e-f16d-4ff7-8e62-12c75a253f69n@googlegroups.com>

Show all headers | View raw


On 03/01/2021 10:45, Rick C wrote:

> I might do the division in a lookup table by multiplying by the
> inverse.  The trouble with that is the poor accuracy when the value
> is large and the inverse is small.  But then that is simply the
> natural result of the division, no?  Not sure I will actually have
> that problem.  I need to plan out the calculations better.
> 

"Multiply by reciprocal" is a very common way of doing division.  It is
particularly popular if you have several numbers to be divided by the
same divisor, or if the divisor is a fixed known value.  You need some
care to get the scaling right, and to get the LSB's precisely correct,
but it is entirely doable.

A lookup table for reciprocals is going to get impractical quite quickly
for large ranges.  Certainly it would take up a lot more space in an
FPGA than putting in a Cortex M1 or RISC-V soft processor and doing the
sane thing - implement your maths in software.

Back to comp.arch.embedded | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Fixed Point Calculations Rick C <gnuarm.deletethisbit@gmail.com> - 2021-01-01 02:18 -0800
  Re: Fixed Point Calculations upsidedown@downunder.com - 2021-01-01 13:33 +0200
    Re: Fixed Point Calculations Rick C <gnuarm.deletethisbit@gmail.com> - 2021-01-03 01:45 -0800
      Re: Fixed Point Calculations Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2021-01-03 12:18 +0200
        Re: Fixed Point Calculations Rick C <gnuarm.deletethisbit@gmail.com> - 2021-01-03 05:33 -0800
      Re: Fixed Point Calculations upsidedown@downunder.com - 2021-01-03 14:48 +0200
      Re: Fixed Point Calculations David Brown <david.brown@hesbynett.no> - 2021-01-03 15:38 +0100
        Re: Fixed Point Calculations Rick C <gnuarm.deletethisbit@gmail.com> - 2021-01-03 18:55 -0800
          Re: Fixed Point Calculations David Brown <david.brown@hesbynett.no> - 2021-01-04 09:26 +0100
            Re: Fixed Point Calculations Rick C <gnuarm.deletethisbit@gmail.com> - 2021-01-17 22:11 -0800
              Re: Fixed Point Calculations David Brown <david.brown@hesbynett.no> - 2021-01-18 08:53 +0100
                Re: Fixed Point Calculations Rick C <gnuarm.deletethisbit@gmail.com> - 2021-01-18 00:42 -0800
                Re: Fixed Point Calculations Anssi Saari <as@sci.fi> - 2021-01-18 22:00 +0200
                Re: Fixed Point Calculations Rick C <gnuarm.deletethisbit@gmail.com> - 2021-01-18 13:46 -0800
                Re: Fixed Point Calculations upsidedown@downunder.com - 2021-01-19 10:44 +0200
                Re: Fixed Point Calculations Rick C <gnuarm.deletethisbit@gmail.com> - 2021-01-19 01:14 -0800
                Re: Fixed Point Calculations Anssi Saari <as@sci.fi> - 2021-01-20 09:50 +0200

csiph-web