Searching \ for 'GPL'ed 32-bit division routine with BCD output for' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/method/math.htm?key=division
Search entire site for: 'GPL'ed 32-bit division routine with BCD output for'.

Truncated match.
PICList Thread
'GPL'ed 32-bit division routine with BCD output for'
1999\09\05@094351 by wzab

flavicon
picon face
Hi All!

I'm just preparing a simple, intelligent, PIC-based frequency meter.
I have a problem with a 32-bit division routine. It should take
two unsigned long integers, and provide the BCD-encoded floating point result
(at least 7-digit mantissa, and two digit exponent).
Is it possible to implement it with such a small uP as 16F84?
Is there such routine ready to use? (it should be licensed with GPL, or other
free license, because my design will be a free solution without restrictions
on its use).

Thanks in advance
----------------------------------------------------------------------------
Wojciech Zabolotny             | http://www.debian.org  Use Linux - save
spam_OUTwzabTakeThisOuTspamise.pw.edu.pl             |                        your data and time
http://www.ise.pw.edu.pl/~wzab |

1999\09\07@032712 by wzab

flavicon
picon face
On Sun, Sep 05, 1999 at 07:35:14PM +0200, w. v. ooijen / f. hanneman wrote:
> Do you really need to divide?
> I have a very simple frequency counter that just count the number of pulses
> in a fixed interval....
> Wouter

The division is essential for my design. It will count the number or
reference frequency pulses (RF) during a few periods of measured signal
(MS), following its rising slopes fitting in measurement time (MT).
See the diagram below:

MT    +------------------------------------------------------+
  ---+                                                      +------------

MS      +------+     +-----+     +------+     +-----+     +------+     +--
  -----+  1   +-----+ 2   +-----+ ...  +-----+ N-1 +-----+  N   +-----+

GATE    +--------------------------------------------------------------+
  -----+                                                              +--

RF  +--+  +--+  +--+  +--+  +--+  +--+  +--+  +--+  +--+  +--+  +--+  +--+
  -+  +--+  +--+  +--+  +--+  +--+  +--+  +--+  +--+  +--+  +--+  +--+  +

       |        M pulses of RF during the GATE signal                 |

The meassured frequency is equal to RF*N/M, so division is necessary.
The advantages of this method are:
 1) good resolution obtained for short measurement time.
 2) No need for selection of gate times. If you want to get 1 result per
    second, you can set MT=0.5 sec, and still get good resolution.

The disadvantage is that the measured signal should have sharp slopes and small
jitter (for low frequencies).

--
                             Wojciech M. Zabolotny
       http://www.ise.pw.edu.pl/~wzab  <--> .....wzabKILLspamspam@spam@ise.pw.edu.pl

http://www.debian.org  Use Linux - save your data and time

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...