10-30-2009 09:05 AM - edited 10-30-2009 09:08 AM
Turnabout is fair play, so today's function is "Implies". A previous nugget touched on this subject, but this is really one of those functions that cries out for a VIOTD treatment. Plus it is Friday, so I try to have a little extra fun with these.
So what the heck does this function do? Pretty simple operation, !x OR y, I am sure that I have used that construction a few times, probably with less confusion than if I dropped an Implies function on the BD. Even if I were trying to be efficient, I'll either be clicking the compound arithmetic node to invert one input, or clicking the switcheroo tool because I'll never remember which is x and which is y.
The question you are asking with this function is "Does X imply Y", confusion may stem from the fact that you may be expecting to be asking something about X or Y. For example, I am going to Las Vegas this weekend (plus Monday if you are wondering). Let X be 'you see me' and Y be 'you are in Las Vegas'. If you see me, you are in Las Vegas TT->T. You will not see me if you are not in Vegas FF->T. It is a big place, so you could be in Las Vegas and still not see me FT->T. Finally, the case where you see me, but aren't in Vegas is not possible TF->F. It is early and Friday, so no loopholes involving telescopes, Big Brother, wormholes, me being on the 6 o'clock news....
What does this have to do with LV? I don't know, I can think of only a couple of uses. First, I go to some pretty boring meetings. Now I can imagine a group of NI engineers sitting around discussing implementation of this function. Sounds like loads of fun, suddenly, maybe my meeting isn't so bad. Second, when I want a new feature in LV I can say "You have time to implement Boolean Implies, but you can't give us ....".
I had to use it in a VI, so here is a Venn diagram generator where you can see what the Boolean functions do I think it is LV8.0 or 8.2.
VIOTD groundrules here.
10-30-2009 09:16 AM - edited 10-30-2009 09:24 AM
Very nice VI to graphically show the relationships between the different functions. I like it!
If I can make a suggestion, add the couple other boolean operations that seem to be missing (NOR, NXOR, anything else?)
Perhaps one more thing, put two string controls on the front panel where you can apply a description for X and Y that will be plotted on the diagram as well. That way if you are working out a logic problem for two conditions such as Temp <30 degrees also Sun is UP, you could work out which is the correct logic to use for something like "It must be winter".
What else is interesting about your diagram is that it shows all the boolean operations are commutative EXCEPT for the Implies function. All the the charts are symmetrical except for Implies. It graphically shows that the order of operations for X vs. Y matters.
10-30-2009 09:23 AM
10-30-2009 09:23 AM - edited 10-30-2009 09:25 AM
p | q | p -> q |
---|---|---|
T | T | T |
T | F | F |
F | T | T |
F | F | T |