I was under the impression that, unlike multiplication, it's not easy to break (for example) a 32 bit divide operation into multiple 16 bit ones. To do this with multiplication is relatively easy: C =3D A * B C =3D AL * BL + AL * BH + AH * BL + AH * BH David. On Wed, Oct 17, 2012 at 7:56 PM, Joe Mickley wrote= : > I am using a dsPIC30F3012 (writing in ASM, not C) on a project with very > fast loop execution (<20 uSec in some cases) > and need an effecient 32 bit by 32 bit unsigned divide algorithm. The > dsPIC30F family has organic 16 by 16 divide > instruction (DIV.U and DIV.UD) and I would like to create a 32 by 32 usin= g > that instruction set. > > The traditional 32 by 32 divide using a shift/subtract (restoring) > algorithms is slow (about 400 instruction cycles nominal). It > should be possible to break the 32 by 32 into a set of 16 by 16 operation= s, > then combine the partials back into a 32 by 32 > result, but I lack the knowledge of how to do or drive this. The dsPIC30= F > divide routine is fast (18 cycles, so > any use of itshould have a marked improvement) > > I need an unsigned divide, but could live with a signed divide as the > magnitude of numbers I am working with are less than > 2^30. Remainder or lack of is not critical. If I need it I could derive= a > remainder externally to the routine. > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .