From Wikipedia:
Logical operators
AND, NAND, OR, XOR and NOT are the main logical operators, the basis for the construction of digital systems and the propositional Logic, and also widely used in programming language. The AND, NAND, OR and XOR operators are binary operators, that is, they need two elements, whereas NOT is unary. In computing, these elements are usually binary variables, whose possible values are 0 or 1. However, the logic used for these variables also serves sentences (sentences) of human language, where if this is true corresponds to value 1, and if for false is 0.
-
AND
Logical operator in which the operation response is true (1) if both input variables are true.
x1 x2 x1 AND x2
0 0 0
0 1 0
1 0 0
1 1 1
-
NAND
Logical operator in which the operation response is true (1) if at least one of the variables is false.
x1 x2 x1 NAND x2
0 0 1
0 1 1
1 0 1
1 1 0
-
OR
Logical operator in which the operation response is true (1) if at least one of the input variables is true.
x1 x2 x1 OR x2
0 0 0
0 1 1
1 0 1
1 1 1
-
XOR
Logical operator in which the operation response is true (1) when the variables take different values from each other.
x1 x2 x1 XOR x2
0 0 0
0 1 1
1 0 1
1 1 0
-
NOT
Logical operator representing the negation (inverse) of the current variable. If it is true, it becomes false, and vice versa
x1 NOT x1
0 1
1 0
Source: link
Logical port
I think this subject off-topic, because even if it has some context similar to programming, I still do not know if it is totally comprehensive, although algorithm doubts are accepted, but the doubt is not about a specific algorithm , even so just to chant the difference:
Logical ports or logic circuits are devices that operate one or more input logic signals to produce one and only one output, depending on the function implemented in the circuit. They are usually used in electronic circuits, because of the situations that the signals of this type of circuit can present: presence of signal, or "1"; and no signal, or "0". The "Truth" and "False" situations are studied in Boole's Logic or Mathematical Logic; origin of the name of these ports. The behavior of the logic gates is known by the truth table that shows the logic states of the inputs and the outputs.
-
AND
ENTRADASAÍDAABAANDB000010100111
OR
ENTRADASAÍDAABAORB000011101111
NOT
ENTRADASAÍDAANOTA0110
NAND
ENTRADASAÍDAABANANDB001011101110
NOR
ENTRADASAÍDAABANORB001010100110
XOR
ENTRADASAÍDAABAXORB000011101110
XNOR
ENTRADA SAÍDA
A B A XNOR B
0 0 1
0 1 0
1 0 0
1 1 1