Search code examples
simulinkfixed-point

Flip sign of fixed point signal without using gain block Simulink


I have an incoming signal and I want to change it's sign. I can easily add a gain block (=-1) and flip the sign or multiply the signal by -1. However, I want to avoid this because the incoming signal is fixdt(1,24,39) which is very small. Consequently a gain block causes an overflow.

Is there a way I can manually flip the signed bit of the incoming signal instead?

Thanks :)


Solution

  • Figured it out. I need to use a Unary Minus block:

    https://au.mathworks.com/help/simulink/slref/unaryminus.html