|
Atari coding BBS
Re: DSP DIV question |
Posted by: dml
|
Jun,22.2013-05:28
|
Hi Laurent,
B is a 48bit dividend, and Y1 a 24bit divisor. However on the DSP56K, divide result (quotient) can only be 24bit, in the lower 24bits of the accumulator. The upper 24bit is always the remainder.
The operation you are trying:
$01e000:000000 / $000100 = $0001e0:000000
...produces a 48bit result so you're getting overflow.
If your dividend only needs to be 24bit, assign the value in B0 not B1 (clearing B first) and it should work.
If your dividend needs to be 48bit, generate a reciprocal (r=1.0/d) and use a 48bit multiply to adjust the accumulator (this takes 7 operations on top of the divide itself). There are some other tricks for this but that's probably the most general.
Hope that helps!
|
[All messages in this thread] [Start new thread]
What's the anti-troll code? That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
|