Integer theoretic problem

Dr. Slack, Fri Apr 28 2006, 09:34AM

Not sure whether this should go into general science, computing or chatting as we don't have a maths category, but I figure this is the closest.

I get pi44ed off with DDS chips that provide only 2^N resolution, so I've built a synthesiser which has an Arbitrary Modulus Accumulator. This leads to my problem, I can't get my head round how to specify an exact resolution that can be obtained with it. I suspect there are some useful integer theorems which would allow me to generalise rather than to examine every one of the 2^46 possible settings, unfortunately the only one I know about is modulus arithmetic (which is helpful in working out any given setting).

The accumulator I'm using is 2^22 long, this is then augmented with another acumulator (m) which can be any integer up to 2^24 long. The total length of this composite accumulator is therefore m.2^22, where m<= 2^24. I accumulate an integer R, where for reasons I won't go into, m.2^22 < R < 2.m.2^22, (that is R/(m.2^22) is between 1.000 and 1.9999) so that my output frequency is given by fout = (clock*m*2^22)/R, which is somewhere between 50% and 100% of clock, where clock has lots of factors of 2 and 5 in it.

Now the problem is not given some required output frequency, to find the R and m that generates it exactly, or the best R and m for the smallest error, those are fairly straightforward. The problem is not to find an expression that will give all exact output frequencies. The problem is to find a simple expression that gives a nice subset of the exact output frequencies that can be generated by this setup, and a proof for that.

For instance with a clock frequency of 108.38MHz, I know that there are frequencies specified to 0.1Hz which cannot be generated exactly. However I have not yet found any frequencies which are multiples of 10Hz, or 10Hz/3, which I cannot make exactly. Which leads me to suspect that all frequencies of the form N.10Hz/Q, where N is an integer, Q is a small integer, and N and Q are chosen such that R ends up in the right range, can be generated exactly. But I don't want to do an exhaustive search through all zillions of possible settings and don't see a way to prove it theoretically.

Does anybody have any ideas?
Re: Integer theoretic problem
Carbon_Rod, Fri Apr 28 2006, 10:07AM

The theories state any number is a compound of several primes of exponent n that can generate all members of set Z. If two given numbers are decomposed into a given set of primes describing the numbers there are several operations may be performed in component form. For instance, if one was to take the ceiling of the n exponents of each prime component the least common multiple is generated (the floor would yield the greatest common factor.) If what your asking for is a discrete solution in Z not R it sounds like a discreet non-homogeneous weak inductive solution.

One cannot be specific and vague at the same time can they? There may be some complications with discussing related subject matter in this area – please clarify your exact problem in pseudo-code or commented notation for easier reading.

Cheers,
Re: Integer theoretic problem
Dr. Slack, Fri Apr 28 2006, 10:08AM

Ha! the teddy-bear effect strikes again! Just describing the problem clearly enough to post it got me shaken out of my thinking rut and to the solution. Sorry to have bothered you.

and it turned out 10Hz/3 was wrong.

How do I lock this thread, or do I need to pm a mod?
Re: Integer theoretic problem
Steve Conner, Fri Apr 28 2006, 11:08AM

If you can't figure out the answer, I don't see anyone else here having much luck either. :P If you did find a proof, can you post it please?