# LabVIEW

cancel
Showing results for
Did you mean:

## logic gate inputs

Hi all

Does any one know if there is any logic functions that have more than two inputs?
Other than wiring extra inputs yourself by compounding gates!
Can't see any in the functions.

TonyC

Message 1 of 10
(3,657 Views)

## Re: logic gate inputs

yes you can use the "compound arithmetic" function in the numeric palette and set it to and or or. It is resizable

Cheers

Doc-Doc
http://www.machinevision.ch
http://visionindustrielle.ch
Message 2 of 10
(3,649 Views)

## Re: logic gate inputs

Use the Compound Arithmetic function. You can right click and change modes to AND, OR, XOR. You can right click on any input or the output and select Invert.
Message 3 of 10
(3,643 Views)

## Re: logic gate inputs

Thanks to you both for the tip.

Yes this should just do the job....

TonyC

Message 4 of 10
(3,635 Views)

## Re: logic gate inputs

If you want some complex logic that you will use multiple times, you can also make you own subVIs.

Lynn
Message 5 of 10
(3,630 Views)

## Re: logic gate inputs

@johnsold wrote:
If you want some complex logic that you will use multiple times, you can also make you own subVIs.

Lynn

Another neat thing about boolean algebra is, if you replace every "and" with a multiply, and every "or" with an addtion, and do the appropiate things with negation, you can evaluate the expression using regular numerical algebra.

Example:

~AB + A~B + AB + ~A~B should be TRUE (you can verify this using the distributive property)

Now we apply normal math to it:

For A and B  both TRUE (TRUE = 1)

=~1*1 + 1*~1 + 1*1 + ~1*~1

=0*1 + 1*0 + 1*1 + 0*0

=1

You can verify this works with any combination of A or B.

Another example:

take the expression A+B+C+D, with A=B=C=D=TRUE

Evaluating the expression gives you 1+1+1+1 = 4, which is equivalent to TRUE

You may be thinking, hmm, 4 is not TRUE or FALSE, but remember, in a lot of programming languages, 0 is FALSE, and anything else is TRUE.

Message 6 of 10
(3,619 Views)

## Re: logic gate inputs

Correct, that is why it is in the arithmetic palette and not in the boolean one.

Cheers

Doc-Doc
http://www.machinevision.ch
http://visionindustrielle.ch
Message 7 of 10
(3,610 Views)

## Re: logic gate inputs

The compound function is in both Numeric and Boolean palettes since at least LV 6.

Lynn
Message 8 of 10
(3,604 Views)

## Re: logic gate inputs

Same in v7.1

Knowing that boolean arithmetic follows numeric arithmetic makes filling out truth tables a breeze.

Message Edited by agill on 07-12-2006 10:39 AM

Message 9 of 10
(3,597 Views)

## Re: logic gate inputs

old habits... sometimes close your eyes!

Thanks. Cheers

Doc-Doc
http://www.machinevision.ch
http://visionindustrielle.ch