Inverting Binary

Hello,

Is there an easy way to invert input binary within a program on a 20M2?

eg, if I have inputs %01010101, is there a way to convert that to %10101010? - so 0 becomes 1, and 1 becomes 0?

Thanks
Jon
 

westaust55

Moderator
alternatively (after reading the pins):

b0 = b0 XOR %11111111

and if using and X1 or X2 part then

b0 = INV b0
 
Last edited:
Top