07-19-2010 08:22 PM - edited 07-19-2010 08:23 PM
Hi,
I'm currently using a NOT GATE to convert the value of 1 to 0 and vice versa. But my problem is, when the input is 0 instead of changing it to 1, the Not Gate changed it to -1. And when the Input is 1, it changed it to -2. I couldn't figure out what is the problem.
Could someone help me?
Solved! Go to Solution.
07-19-2010 08:38 PM
The function is supposed to work that way. It will invert each bit. So, b00000000 is inverted to b111111111.
You can do a =0 followed by a Boolean to 0,1.
07-20-2010 05:33 AM
Hey Tebu,
You could also add 2 to your output, though this will still allow you to pass invalid values into the not gate and get a non 0 or 1 output. If using this method it would be important to ensure your inputs are what you want them to be.
Regards,
Chris
07-20-2010 06:12 AM
Just use "subtract" function from numeric palette. Give constant "1" in terminal 'x' & connect your input value (0 or 1) into terminal 'y'. It will give you the invert values.
-Kumar.B
07-21-2010 04:43 PM
both method, you and the person above you could be used. Thanks mate!