Re: Fixed-point Math help
From: CBFalconer (cbfalconer_at_yahoo.com)
Date: 12/15/04
- Next message: John Woodgate: "Re: Circuit that produces a tingling sensation in the fingers."
- Previous message: Roger Johansson: "Re: Circuit that produces a tingling sensation in the fingers."
- In reply to: Jonathan Kirwan: "Re: Fixed-point Math help"
- Next in thread: Jonathan Kirwan: "Re: Fixed-point Math help"
- Reply: Jonathan Kirwan: "Re: Fixed-point Math help"
- Reply: Nicholas O. Lindan: "Re: Fixed-point Math help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 15 Dec 2004 15:51:38 GMT
Jonathan Kirwan wrote:
>
... snip ...
>
> I don't have a convenient web site in mind, but Tim Wescott's
> suggestion of using google is probably a good one. Use "floating
> point" and "normalization" and "denormalization" and "exponent"
> and "mantissa" and "hidden bit" and perhaps the four common
> operations to help track something down. This is more your 'do
> diligence,' until you've done this yourself and can explain why
> it's not getting you there.
>
> The basic idea is that you have an exponent (signed,
> twos-complement) and an unsigned mantissa (with a possible
> hidden bit for non-zero values) and a separate sign bit. These
> can be packed in any format you like or is convenient to you.
> Each of these is an integer. There is no explicit radix (decimal)
> point, but it is usually assumed for the mantissa at any convenient
> place and the exponent then adjusts this, left or right, for - or +
> values of the exponent. The mantissa is usually stored 'normalized'
> which means that it is shifted until the leading bit is always a '1'
> (which is always possible unless the value is actually zero, but
> that is easily detected.) Some formats simply throw away the
> leading bit, because it is always '1', and put it back when needed
> in order to add one apparent bit of precision.
>
> The rest is just software. Try a paper exercise and see where it
> takes you. That's a good start, if you plan to try and implement
> something yourself. Another choice would be to examine library
> code -- again, search google.
You can find a complete example in the Dr. Dobbs Journal archives.
I published a complete system for the 8080 there about 25 years
ago. It's purpose was to supply dynamic range, and used a 16 bit
significand with an 8 bit exponent. The result was much faster
than anything else available at the time, because it could all be
done in registers, and in addition was re-entrant. The system
included i/o procedures, transcendentals, etc. and had
over/underflow detection. The system underwent minor revisions and
continuous use in the ten years or so since publication, and
processed the majority of tests in a 1000 bed hospital for much
longer. I.E. it was reliable and accurate.
-- Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net) Available for consulting/temporary embedded and systems. <http://cbfalconer.home.att.net> USE worldnet address!
- Next message: John Woodgate: "Re: Circuit that produces a tingling sensation in the fingers."
- Previous message: Roger Johansson: "Re: Circuit that produces a tingling sensation in the fingers."
- In reply to: Jonathan Kirwan: "Re: Fixed-point Math help"
- Next in thread: Jonathan Kirwan: "Re: Fixed-point Math help"
- Reply: Jonathan Kirwan: "Re: Fixed-point Math help"
- Reply: Nicholas O. Lindan: "Re: Fixed-point Math help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|