I'd like to multiply to integer with modified fraction as following
(Multiplication by power series summation with negative terms)
I have done what to find the method the fraction convert to CSD form. But I want to know how can I apply to multiply to integer.
For example, I got this
0.46194 = 2^-1 - 2^-5 - 2^-7 + 2^-10.
then I can get like this as verilog rtl expression :
y= (x>>1) - (x>>5) - (x>>7) + (x>>10);
But the problem is that what if I got the input value is 3, then how can I calculate above code?
y= (3>>1) - (3>>5) - (3>>7) + (3>>10);
But As i know, It does impossible calculate. because 3>>1 is 1, (3>>5) is 0, (3>>7) is 0, (3>>10) is 0;
So I can't get the normal result. Also the reason of finding the modified fraction expression has gone away. Then this posting's question point is "how can I apply the modified fraction to the integer".
UPDATE : This should be like this. y= ((3<<1024)>>1) - ((3<<1024)>>5) - ((3<<1024)>>7) + ((3<<1024)>>10);