from fxpmath import Fxp
c = Fxp(complex(3.2500+2.0625j), True, 8, 4) # (val, signed, n_word, n_frac)
print(c)
print((c).bin()) # binary representation
d = Fxp(complex(2.0625+5.2500j), True, 8, 4) # (val, signed, n_word, n_frac)
print(d)
print((d).bin()) # binary representation
y= Fxp(complex(c*d), True, 16,8)
print(y)
print((y).bin()) # binary representation**
This is the output I see-
(3.25+2.0625j)
00110100+00100001j
(2.0625+5.25j)
00100001+01010100j
(-4.125+21.31640625j)
1111101111100000+0001010101010001j
when I multiply these two numbers, the real part is -4.125 and the conversion to binary shows just the 1's complement of the answer, I need this to be shown in 2's complement, is this possible using the fxpmath function? The real part and the imaginary part again consists of integer and fraction bits each 8bit wide.