I have these decimal values:
x1=-43.00488
x4=11.5048
y1=-11.5048
y4=-43.004
I converted them to their equal binary values, in the format Q7.10
So, these are the binary values:
% All of the binary values are signed and in Q7.10 format.
x1=1010100_1111111011
x4=0001011_1000000101
y1=1110100_0111111011
y4=1010100_1111111011
I want to do this operation with binary values in matlab :
% This line is equal to multiplying "((x1-x4) / (y1-y4))" with 2^10;
x1x4_div_y1y4 = ((x1-x4) / (y1-y4)) << 10
While trying to do this operation I had some difficulties,
firstly, I couldn't declare the negative binary values in Matlab. secondly, are we allowed to do math operations with binary values or should I do the operations with decimal values then convert them to binary values?
But what I need is to do this operation with binary operations so I can implement it in verilog hdl.
a= ((-43.00488-11.5048) / (-11.5048+43.00488))*(2^10)
a =
-1.7720e+03
I am not sure if these statements are given the true answer. Should I multiply it with 2^10 or so...
I want to do the same operation using binary values. Can I do that in Matlab? And how to do that?
Thank you in advance.