LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
dthor

Native Ternary Logic support (3-valued logic)

Status: Declined

Any idea that has received less than 9 kudos within 9 years after posting will be automatically declined.

I'd like to see native Ternary Logic support (aka three-valued or trivalent logic, or 3VL). True and False could still be represented by 1 and 0 respectively, and the third option could be represented by -1.

 

Not much else to say about this really... I think it's pretty self-explanatory.

8 Comments
elset191
Active Participant

Are you talking about 'Select'?  Your description seems different.  If not, I'm not sure what you're talking about.

 

Edit:  I guess there's also a ternary Logic, different from a ternary operation

Message Edited by elset191 on 06-01-2010 02:59 PM
--
Tim Elsey
Certified LabVIEW Architect
Intaris
Proven Zealot

There is always I8......

 

Otherwise I don't get it.

dthor
Active Participant

Give me a bit and I'll post an example showing when 3VL is useful.

dthor
Active Participant

Yes, Ternary Logic is different from a ternary operation. Sorry for the confusion there. There would be an entire pallet of functions specific to trivalent logic. More than likely, a new wire datatype would be needed. This function pallet would be analogous to the current Boolean pallet.

 

In this example, the nexted Case structure would be replaced by a single case structure. The Random number generator and the tests are just there to simulate the a ternary logic value.

3VL example.png

Intaris
Proven Zealot
I see neither where the ternary value should be created in this code nor why it can't be done with an I8.....
dthor
Active Participant

Yes, you would currently implement ternary logic with the I8 data type. The subVIs that I've made for my ternary logic needs use just that.

 

What I'm proposing would not only eliminate the need to use subVIs for the logic operations (not a big deal, really), but would also add comparison operations that return ternary values.

 

Read up on Ternary Logic and SQL's Null marker and you should see the benefits having ternary comparison/logical operations available.

JackDunaway
Trusted Enthusiast

Here are some related Ideas for "nVL" logic. I would like to see this type of functionality implemented, but no suggestion so far has clearly risen to the distinction of "That's the One!"

 

Equivalent of a Switch Statement in C 

Elseif Structure 

Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 9 kudos within 9 years after posting will be automatically declined.