thomasPlam
Member
hi all,
I’m doing 32 bit multiplication using 16-bit dsPIC33F microcontroller. I’m storing the 32–bit value using two W registers. From the final 64 bit value I’m taking only the 32-bit MSB of the result. This result I’ve to divide it by two. This I’m doing by right shifting the accumulator.
Suppose, the result before division in the accumulator is 000124D57AC9. When I shift it, the result becomes 926ABD64 which is a negative number, which gives a different (distorted) sine wave. I want the same value but a positive number. I can’t make the entire thing unsigned, because it makes the entire wave a positive one. Please advice.
regards
thomasplam
I’m doing 32 bit multiplication using 16-bit dsPIC33F microcontroller. I’m storing the 32–bit value using two W registers. From the final 64 bit value I’m taking only the 32-bit MSB of the result. This result I’ve to divide it by two. This I’m doing by right shifting the accumulator.
Suppose, the result before division in the accumulator is 000124D57AC9. When I shift it, the result becomes 926ABD64 which is a negative number, which gives a different (distorted) sine wave. I want the same value but a positive number. I can’t make the entire thing unsigned, because it makes the entire wave a positive one. Please advice.
regards
thomasplam
Last edited: