Is it possible to invert a hex number in VisSim?

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

Submitted by Viswanathan on Wed, 07/08/2009 - 19:58 

Is it possible to literally invert a hex number in VisSim

eg. If I have 0x1234 (0001001000110100), can I get it as 0x2C48 using any simple operation?

Can I write my own C-code / assembly code and create a VisSim block out of it. A value should be passed into the block for proces.

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited June 2016

    Submitted by pete on Thu, 07/09/2009 - 10:29.

    Hi Viswanathan,
    You can use the '~' ones complement operator as a prefix to your number in a const block, hexNum-complement.png
    or you can use it in an expression block.

    Regards,
    Pete