1
votes

So I am working with 64 bit floating point numbers in Verilog for synthesis, ideally I would like to do -A*B, where A and B are the two numbers. I have got past doing A*B, so is it okay now if I just change the value of the first bit 0 to 1 or 1 to 0 to make it represent -A*B.

kinda like,

A[0]=~A[0];

Thanks in advance for any suggestion.

1

1 Answers

3
votes

Yes! That's all there is to it.

Keep in mind that negating 0 will give you -0. (They're different floating-point bit patterns.) Whether this matters to you will depend on your application.