03-23-2007 06:34 AM
03-23-2007 07:07 AM - edited 03-23-2007 07:07 AM
Message Edited by GerdW on 03-23-2007 02:09 PM
05-21-2010 08:19 PM
As an alternative, if you want a function that returns a true value only when one of the booleans in your array is true. Then that is the same as determining if an integer is power of 2.
A positive integer is a power of two if ( x AND (x-1) ) equals zero.
Note that this formula incorrectly indicates that 0 is a power of two, so we need to make sure that x is NOT 0.
(Tip: If you are using LabVIEW 2009 you can save this VI snippet in your computer and drag it into your code 😉 )
05-21-2010 08:34 PM
John007 wrote:I have wired three True Booleans to a compound arithmetic XOR, the result should be false, it is returning a true result!
Why would you expect 3 Trues XORed together to be False? What definition are you using?
My understanding of XOR with multiple inputs is that the result is True if there are an odd number of Trues, and the result is False if there are an odd number of Trues.