A logical variable is a mathematical quantity that can take one of two values: true or false.
The value true is represented by the value 1.
The value false is represented by the value 0.
A logical function applies mathematical operations to logical variables.
The value of a logical function is a logical variable.
A logical function is defined by its truth table.
NOT functionThe NOT function is applied to a single variable.
This function is also called negation.
Notation
The NOT applied to the variable a is noted a.
Truth table
| a | a | 
| 0 | 1 | 
| 1 | 0 | 
OR functionThe OR function is applied to two variables.
This function is also called disjuntion.
Notation
The OR function applied to two variables a and b is noted a + b
and it is also noted a ∨ b.
Truth table
| a | b | a ∨ b | 
| 0 | 0 | 0 | 
| 0 | 1 | 1 | 
| 1 | 0 | 1 | 
| 1 | 1 | 1 | 
AND functionThe AND function is applied to two variables.
This function is also called conjuntion.
Notation
The AND function applied to two variables a and b is noted a . b
and it is also noted a ∧ b.
Truth table
| a | b | a ∧ b | 
| 0 | 0 | 0 | 
| 0 | 1 |  | 
| 1 | 0 |  | 
| 1 | 1 | 1 | 
XOR functionThe XOR function (exclusive or) is applied to two variables.
Notation
The XOR function applied to two variables a and b is noted and defined as follows:a ⊻ b = a ⊕ b =  a.b + a.b
Truth table
| a | b | a ⊻ b | 
| 0 | 0 | 0 | 
| 0 | 1 |  | 
| 1 | 0 |  | 
| 1 | 1 |  | 
The logical functions OR and AND are commutative and associative.
a.(b + c) = a.b + a.c
a + (b.c) = (a+b).(a+c)
De Morgan’s laws
a + b = a . b
a.b = a + b 
Consider applying for a job competition.
Acceptance of the application is “TRUE” if the candidate holds a Bachelor’s degree AND has four years of professional experience, OR if the candidate holds a Master’s degree.
We have 3 variables:a = “hold a Bachelor’s degree”b = “have four years of professional experience”c = “hold a Master’s degree”
The variabled = “application accepted”
is a logical function of the variables a, b and c.
d = f(a,b,c) = a.b + c
Truth table
| a | b | c | a.b + c | 
| 0 |  | 0 | 0 | 
|  | 0 |  |  | 
| 0 | 1 | 0 | 0 | 
|  | 1 |  |  | 
|  | 0 |  |  | 
| 1 | 0 | 1 | 1 | 
|  | 1 |  | 1 | 
| 1 | 1 | 1 | 1 |