Logic function

Logic operator

Instead of the usual arithmetic operators (addition, subtraction, etc.), the logical operators are: NOT, OR, NOR, AND, NAND, XOR, XNOR. The NOT operator is unary, the rest are binary operators.

Any logical statement which contains a finite number of logical variables can be analyzed using a table which lists all possible values of the variables: a truth table.

Operator NOT

Truth table: NOT A

AANOT A

Operator OR

Truth table: A OR B

ABA + BA OR B

Operator NOR

Truth table: A NOR B

ABA + BA NOR B

Operator AND

Truth table: A AND B

ABA * BA AND B

Operator NAND

Truth table: A NAND B

ABA * BA NAND B

Operator XOR

Truth table: A XOR B

ABA ⊕ BA XOR B

Operator XNOR

Truth table: A XNOR B

ABA ⊕ BA XNOR B

Logic function

The logical function implements logical operation. The function's symbol is usually Y (or F).


logical negation, NOT

Truth table: = NOT A

inputoutput
A = A = NOT A

inclusive disjunction, OR

Truth table: = A OR B

inputoutput
AB = A + B = A OR B

negation of inclusive disjunction, NOR

Truth table: = A NOR B

inputoutput
AB = A + B = A NOR B

logical conjunction, AND

Truth table: = A AND B

inputoutput
AB = A * B = A AND B

negation of logical conjunction, NAND

Truth table: = A NAND B

inputoutput
AB = A * B = A NAND B

exclusive disjunction, XOR

Truth table: = A XOR B

inputoutput
AB = A ⊕ B = A XOR B

negation of exclusive disjunction, XNOR

Truth table: = A XNOR B

inputoutput
AB = A ⊕ B = A XNOR B

Truth table

 A  B  A  B  = A + B = A + B = A * B = A * B = A ⊕ B = A ⊕ B
  = A OR B   = A NOR B   = A AND B   = A NAND B   = A XOR B   = A XNOR B 

Logic function

A
      
B
 A  B 123456
 A OR B  A NOR B  A AND B  A NAND B  A XOR B  A XNOR B 
1 = A + B
2 = A + B
3 = A * B
4 = A * B
5 = A ⊕ B
6 = A ⊕ B

A
      
B
 A  B  = A + B = A + B
  = A OR B   = A NOR B 

 A  B  = A * B = A * B
  = A AND B   = A NAND B 

 A  B  = A ⊕ B = A ⊕ B
  = A XOR B   = A XNOR B 

A
      
B