AnsweredAssumed Answered

A dividing problem ADSP-2191

Question asked by volt on Oct 17, 2013
Latest reply on Oct 24, 2013 by SachinV


I got a problem with dividing. There is a number (65535 dec) I need to get each digit in separate bytes (byte1 = 6; byte2 = 5; byte3 = 5; byte4 = 3; byte5 = 5). I try to divide initial number (65535) in 10000 then in 1000 in 100 and so on. In result I get the following results:

byte1 = 6; byte2 = 0xFFFF; byte3 = 5; byte4 = 3; byte5 = 5. But when I try to debug the code I get correct results. I use just DIVQ commands and I have to execute it 17 times instead  of 16 according to "ADSP-219x DSP Instruction Set Reference" page 2-39 to get correct result.


Could someone explain to me what is the problem? First of all why do I get the wrong byte, and second of all why should I use 17 DIVQ commands to get correct result?


Thanks for help.