Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

32bit multiplication using 16bit dspic

Status
Not open for further replies.

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
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top