08-21-2010 07:32 PM
I need to check if there is an easier way of doing this than the one I'm thinking.
If I have an input of 8 binary bits (i.e. 10111001), I need to check if each individual bits are high "1" or low "0". My initial thought was to start masking individual bits but its becomming messy to start masking individual bits (i'm ending up with 8 "AND's") and a rather big Case Structure.
Would anyone have a better (CLEANER) idea?
Thanks
Kas
Solved! Go to Solution.
08-21-2010 09:03 PM - edited 08-21-2010 09:07 PM
Do you want to take a diiferent action for each bit is true? If so, you can simply wire a U8 numeric to a Number to Boolean Array. Wire that to a for loop with a case statement inside. If not, there would be a second case statement inside both the true and false cases and these would be wired to the iteration terminal. You would create cases 0-7. Wiring the outermost case structure to the iteration termial with a true/false inside each of those will do the same thing.
08-21-2010 09:36 PM
Nice, that should do it. The answer seems so simple, but I would neve thought of this .
Thanks
Kas