Dead Hackers Society
Other BBSes »
 
 
Demoscene  Coding  CT60  Buy/sell

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]

Topic Posted by  Date 
DSP DIV question Thadoss Jun,21.2013-23:27
  Re: DSP DIV question dml Jun,22.2013-05:28
    Re: DSP DIV question dml Jun,22.2013-05:31
      Re: DSP DIV question sqward Jun,22.2013-17:50
    Re: DSP DIV question Thadoss Jun,22.2013-18:10
      Re: DSP DIV question dml Jun,22.2013-20:02
      Re: DSP DIV question Patrice Mandin Jun,25.2013-20:24
        Re: DSP DIV question Thadoss Jul,01.2013-18:48


Reply to this message
Name:
Topic:
Anti-troll code:

Message:

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.
© 1994-2024 Dead Hackers Society Contact: Anders Eriksson