DEAR TO ALL, I AM DEALING WITH C8051F120 MICROCONTROLLER.UTILIZING 16 X 16 MAC ENGINE OPERATION.I AM DOING ASSEMBLY LANGUAGE PROGRAMMING USING THIS MICROCONTROLLER FOR MULTIPLICATION. IS IT POSSIBLE TO MULTIPLY TWO UNSIGNED 16 BIT INPUTS? IF YES, THEN HOW ?
Your shift key seems to be stuck. All of your letters are capitals ! Can you try and see if you can fix that somehow ?
IS IT POSSIBLE TO MULTIPLY TWO UNSIGNED 16 BIT INPUTS?
Yes, why shouldn't it be possible ?
IF YES, THEN HOW ?
Just like you would perform a multiplication by hand, on paper (you know, just like in school):
Each of the input values consists of MSB and an LSB. Let's call them MSBa, LSBa, MSBb and LSBb.
So you need to do the following:
1. Multiply MSBa and MSBb. Place the 16-bit result in the upper 16 bit of your 32-bit end result. 2. Multiply MSBa and LSBb. Add the 16-bit result to the upper 24 bits of your 32-bit end result. 3. Multiply LSBa and MSBa. Add the 16-bit result to the upper 24 bits of your 32-bit end result. 4. Multiply LSBa and LSBb. Add the 16-bit result to your 32-bit end result.
And that's it. As long as you know how to add variables that are longer than one byte.
Oops. I didn't read the part about the device in question. In that case, follow Erik's advice.
No, SHOUTING people who also thinks their problems are more urgent than other peoples should expect their problems to receive a minimum of interest.