Hello, I'm trying to use 2s complement fractional format in XC 167 a and I have following problem with multiplication:
/*2s complement fractional format - multiplication test*/ #include <XC167.h> #include <intrins.h> signed short int a = 1024; // = 0.03125 signed short int b = 1024; // = 0.03125 signed short int c, x; void main (void) { MCW = 0x0400; //MP = 1, automatic shift 1 bit left x = b * a; c = MDH; }