Logic Operators with 3 arguments

  • Thread starter Thread starter pamelafluente
  • Start date Start date
P

pamelafluente

Hi,

what is the appropriate way to to
the following operations for three arguments (a,b,c)
(wikipedia has definitions, in case):

NAND, NOR, XNOR ?

Thanks

-P
 
Just look at the truth table for these and you'll see how to do it.

http://hyperphysics.phy-astr.gsu.edu/HBASE/electronic/nand.html
Private Function NAND(byval a as boolean, byval b as boolean, byval c as
boolean) as boolean
if a=True and b=True and c=True then Return False
Return True
End Function

http://hyperphysics.phy-astr.gsu.edu/HBASE/electronic/nor.html
Private Function NOR(byval a as boolean, byval b as boolean, byval c as
boolean) as boolean
if a=True or b=True or c=True then Return False
Return True
End Function

http://hyperphysics.phy-astr.gsu.edu/HBASE/electronic/xnor.html
Private Function XNOR(byval a as boolean, byval b as boolean, byval c as
boolean) as boolean
if a=b and a=c then Return True
Return False
End Function
 
Terry Olsen ha scritto:

Thanks Terry,

let's see tham for general numbers (bitwise operators, instead of
boolean).

If I understand correctly, you are suggesting:

1. Return Not (a and b and c)
2. Return Not (a or b or c)

I am not sure for the 3-rd. Would that be:

3. Return Not (a xor b xor c)

?????????????? or what ?

-P
 
Back
Top