patan.gova
Full Member level 3
- Joined
- Dec 19, 2011
- Messages
- 172
- Helped
- 4
- Reputation
- 8
- Reaction score
- 0
- Trophy points
- 1,296
- Activity points
- 2,776
Hello,
I am new to the microcontrollers and want to know the working of the below two functions for the mutliplication of two 16bit numbers, if the 16bit microcontroller is used
I am new to the microcontrollers and want to know the working of the below two functions for the mutliplication of two 16bit numbers, if the 16bit microcontroller is used
Code:
Multilication function1
int32_t z;
z=mutliplication ( 0x1234, 0x5678);
return z >> 15;
Multilication function2
signed long z;
RESLO and RESHI =mutliplication ( 0x1234, 0x5678); //if results are stored in two different variables of 16bits(RESLO=lower,RESHI=higher)
z = RESHI;
z = (result<<16)|RESLO;
Can someone explain me thw working of above lines.
thanks.