Binary Boolean Algebra
Binary Boolean Algebra
0 = lamp off.
1= lamp on.
Variable: it is a quantity represented by a symbol, which can take a state (true =1
or false =0);
Function: it represents a group of variables linked by logical operators.
b. Axioms of Boolean algebra
For an algebra to be said to be Boolean, it must satisfy the axioms mentioned in the
following table (Table 4.1):
Absorption a + ab = a a(a+b) = a
De Morgan ̅̅̅̅̅̅̅
𝑎 + 𝑏= 𝑎̅.𝑏̅ ̅̅̅̅̅
𝑎. 𝑏= 𝑎̅+𝑏̅
Generalized De
̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
𝑎 + 𝑏 + 𝑐 + ⋯= 𝑎̅. 𝑏̅. 𝑐̅. … ̅̅̅̅̅̅̅̅̅̅̅
𝑎. 𝑏. 𝑐. …= 𝑎̅ + 𝑏̅+ 𝑐̅ +…
Morgan
A B A.B
0 0 0
0 1 0
1 0 0
1 1 1
That is to say that the operator gives the value true “1” if and only if the two variables A
The OR operator (OR): it is a binary operator, and the symbol used is a plus “+”. We
can write (A OR B) or simply (A+B) and it is also called logical addition.
This operator is defined by the following truth table:
A B A+B
0 0 0
0 1 1
1 0 1
1 1 1
That is to say, the operator gives the true value “1” if at least one variable has the true
value.
The NOT operator: it is a unary operator, and the symbol used is a bar above the
variable ( 𝐴̅) or ( ⦢ A) and it is also called logical negation.
This operator is defined by the following truth table:
A 𝐴̅
0 1
1 0
That is, the operator gives the inverse state of the variable.
b. Schematic representations
NOT logic gate
This operator is the negation of the AND operator. It is a binary operator whose logical
A B ̅̅̅̅̅̅̅̅
𝐴 +𝐵
0 0 0
0 1 0
1 0 0
1 1 1
Table 4.3: The truth table of the logical operator NOR
Its characteristic diagram is as follows:
𝑌 = 𝐴. 𝐵̅ + 𝐴̅. 𝐵
=𝐴⊕𝐵
A B 𝐴⊕𝐵
0 0 0
0 1 1
1 0 1
1 1 0
The expression "A implies B" amounts to negating the antecedent and adding the
consequent. Proposition “A” is the antecedent, and proposition “B” is the consequent. So,
𝐴 ⟹ 𝐵 ⟺ 𝐴̅ + 𝐵
𝐴 ⟹𝐵
A B 𝑜𝑟
𝐴̅ + 𝐵
0 0 1
0 1 1
1 0 0
1 1 1
This operator does not have any particular circuit. But we can construct the function
with classic logic gates. In particular: 𝑌 = 𝐴̅ + 𝐵, which gives the following diagram:
= ̅̅̅̅̅̅̅̅
𝐴⊕𝐵
= 𝐵⊙𝐵
= 𝐴⊗𝐵
A B ̅̅̅̅̅̅̅̅
𝐴⊕𝐵
0 0 1
0 1 0
1 0 0
1 1 1
The operator evaluates to true if variables A and B are both true and false at the same
time.
Remark
Except for the NOT gate, all other logic gates can have multiple inputs and a single
output.
- Write on the first line the name of the input variables and the output variable;
- Divide the table into a number of columns equal to the total inputs and output. So
the truth table of a two-input logic function will have three columns (two for the
inputs and one for the output);
- Determine the number of possible combinations using the input variables. This
number is equal to two exponents the number of entries ( 2N lines, N = the number of
entries. ). For example, with three inputs, there will be 23 = 8 possible combinations;
- Complete each line with a possible combination of input variables. The best way to
list all the combinations without making a mistake is to count in binary;
- Enter the value of the function for each combination in the “output” column. The
following examples will help you better master this method.
A B F
0 0 0
1 0 1
1 1 0
You notice that this truth table is made up of three columns (two for inputs and
one for output) and five rows.
On the first line are written the names of the input variables A and B and the
output.
The four possible combinations of entries A and B are written on the next four
lines. These combinations are listed in binary counting order, i.e. (00), (01), (10)
and (11).
The logical state of the output is written in the "output" column opposite each possible
combination. When A and B are both in logic state 0 or in logic state 1, the function is
equal to 0 while it is in logic state 1 when a = 0 and b = 1 or when a = 1 and b = 0.
a b c F
0 0 0 0
0 0 1 0
0 1 0 0
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 0
In this figure, you notice that with three input variables, there are 23 = 8 possible
combinations. These combinations are listed according to the way of counting in binary
with 3 bits. We obtain in order: (000), (001), (010), (011), (100), (101), (110) and (111).
The input variables are represented as trios where the highest weight corresponds to a
while c has the lowest weight. The output is at logic state 1 when only two inputs are at
logic state 1. It is at logic state 0 for all other possibilities.
Out of all the possible combinations, three possibilities give rise to cases where only
two variables are in logic state 1, these possibilities are as follows:
Remark :
We can have more than one exit. For example, if we have N inputs and M outputs ⟹
(N+M) columns in the truth table.
Expression :
f(x,y) = xy + 𝑥̅ y
Truth table:
The most common representation of a logical function is the truth table. A function F of
N variables is entirely described by the statement of all the combinations of the input
variables and the value of the function corresponding to each combination. This
statement generally takes the form of a table with N+1 columns (N inputs + 1 output)
and 2N lines (on N bits, we can code 2N different values), The (N+1)th column contains the
values that the function takes for each combination of variables.
Simply, just give the output value for all possible combinations of values of its
arguments.
Example :
The truth table of the three-argument function f which is true if and only if exactly two of
its arguments are true:
x1 x2 x3 f( x1 , x2 , x3 )
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 1 1
1 1 0 1
1 1 1 0
Example :
2
If n=2 => there therefore exist 22 = 16 Boolean functions of arity 2.
x y f 1 f 2 f 3 ……… f 6 ……….. f 16
0 0 000 0 1
0 1 000 1 1
1 0 001 1 1
1 1 010 0 1
We call minterm (product term) of n variables, a logical product (AND, AND) of the
latter (complemented or not). With n variables, we construct 2n minterms, i.e. as many
possible combinations of n elements taking two states.
Example :
For two variables a and b, here are the four minterms: ab , 𝑎̅𝑏, 𝑎𝑏̅and 𝑎̅𝑏̅.
When a variable (e.g. A) is in logical state 1, it is replaced by its name (A) and when it
̅) .
is in logical state 0, it is replaced by its negation ( 𝑨
For example, the first line of the truth table of a function F of two independent variables
a and b is represented by the binary sequence (00) i.e. a = 0, b = 0. The minterm
associated with this line is then 𝑎̅. 𝑏̅, which means that for this line a = 0 AND b = 0.
The minterms of the truth table of a logical function are denoted by the letter "m"
and an index corresponding to the decimal value of the minterm sequence.
Consider a logical function “F” with two input variables a and b. The following table
(table 4.8) presents the possible combinations and the minterms associated with each
sequence when the variable ' a ' corresponds to the highest weight.
Variables
Binary Decimal
a b minterms
sequence value
0 0 00 0 𝑚0 = 𝑎̅. 𝑏̅
0 1 01 1 𝑚1 = 𝑎̅. 𝑏
1 0 10 2 𝑚2 = 𝑎. 𝑏̅
1 1 11 3 𝑚3 = 𝑎. 𝑏
Table 4.8: Possible combinations and minterms
The decimal equivalent of each binary sequence of each combination represents the
For two variables a and b, here are the four Maxterms: a+b , 𝑎̅ + 𝑏, 𝑎 + 𝑏̅and 𝑎̅ + 𝑏̅.
When a variable (e.g. A) is in logical state 0 , it is replaced by its name (A) and when it
̅) .
is in logical state 1 , it is replaced by its negation ( 𝑨
For example, the first line of the truth table of a function F of two independent variables
a and b is represented by the binary sequence (00) i.e. a = 0, b = 0. The Maxterms
associated with this line is then 𝑎 + 𝑏, which means that for this line a = 0 or b = 0.
The Maxterms of the truth table of a logical function are denoted by the letter “M”
and an index corresponding to the decimal value of the Maxterm sequence.
Consider a logical function “F” with two input variables a and b. The following table
presents the possible combinations and the Maxterms associated with each sequence
when the variable ' a ' corresponds to the highest weight.
Variables
Binary Decimal
a b Maxterms
sequence value
0 0 00 0 𝑀0 = 𝑎 + 𝑏
0 1 01 1 𝑀1 = 𝑎 + 𝑏̅
1 0 10 2 𝑀2 = 𝑎̅ + 𝑏
1 1 11 3 𝑀3 = 𝑎̅ + 𝑏̅
The decimal equivalent of each binary sequence of each combination represents the
index of the associated Maxterm. The Boolean value of the Maxterm is then equal to
the logical sum of the Boolean variables.
The normal (canonical) form of a function can be obtained in two different ways. The
first is to directly extract the expression from the truth table. The second is to obtain it
from an expression which is not in normal form using the properties (axioms and
theorems) of Boolean algebra cited above.
In the 1st normal (canonical) form, the function is expressed as a sum of all combinations
of all logical variables for which the function is “1”, each term is called min-term or
fundamental product. For a given expression this form is unique.
Example :
To derive the normal form of a function from its truth table, we consider the true states
(1) of the function. Then extract the minterms corresponding to the true states (1) and
sum them.
Example :
1 1 0 1 𝑚6 = 𝐴𝐵𝐶̅
1 1 1 0
Examples:
1- f(x,y,,z) = x + 𝑦̅z
= xy + x 𝑦̅+ 𝑦̅z
From this expression, we can deduce the truth table by following the reverse steps: each
minterm must be replaced by 1 in the corresponding box in the truth table. The
remaining boxes must be set to 0.
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
Remark :
The sum of all minterms of n variables is always 1 since there always exists a minterm
of n variables worth 1.
Example :
Consider a function given by the following truth table:
A B C F(A,B,C)
0 0 0 0 𝑀0 = 𝐴 + 𝐵 + 𝐶
0 0 1 0 𝑀1 = 𝐴 + 𝐵 + 𝐶̅
0 1 0 0 𝑀2 = 𝐴 + 𝐵̅ + 𝐶
0 1 1 1
1 0 0 0 𝑀4 = 𝐴̅ + 𝐵 + 𝐶
1 0 1 1
1 1 0 1
𝑀7 = 𝐴̅ + 𝐵̅ + 𝐶̅
1 1 1 0
Then, the expression of the function in the 2nd normal form (Product of Sums) is as
follows:
Examples:
f(x,y,z) = x + yz
= (x + y + z 𝑧̅)(x + z)
From this expression, we can deduce the truth table by following the reverse steps: each
Maxterm must be replaced by 0 in the corresponding box in the truth table. The
remaining boxes must be set to 1.
x y z f(x,y,z)
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
L = ( ̅̅̅̅̅̅
𝐴̅𝐵̅ 𝐶̅ ) ( ̅̅̅̅̅̅
𝐴̅BC) ( ̅̅̅̅̅̅ ̅̅̅̅̅̅̅ )
𝐴𝐵̅ C) ( AB𝐶
L = (A + B + C)(A + 𝐵̅+ 𝐶̅ )( 𝐴̅+ B + 𝐶̅ )( 𝐴̅ + 𝐵̅+ C )
4.8.4. Decimal canonical form:
So that the expression is not long enough, we replace each minterm or Maxterm by a
number representing its order.
Example :
F(x,y) = m 1 +m 2 = 1+2
= M 0 .M 3 =0×3 = 0 . 3
L= ∑(1,2,4,7)=∏(0,3,5,6)
The universality of NAND and NOR gates makes it possible to create all basic logic
functions.
NAND and NOR gates offer the possibility of being able to create any logic circuit using a
single type of component.
An expression of a logical function can be transformed into the NAND form of NANDs, by
application of Morgan's theorem. The 1st normal form (SOP) automatically transforms
into the NAND form of NANDs by replacing AND gates with NAND gates and OR gates
with NAND gates.
Knowing that the algebraic expression of the NAND logic gate is: ̅̅̅̅̅
𝑥. 𝑦
Example :
= ̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
𝑥𝑦̅ + 𝑥̅ 𝑧 + 𝑦𝑧̅
= ̅̅̅̅̅̅̅̅̅̅̅̅
̅̅
𝑥𝑦̅̅̅ . ̅̅̅ ̅̅̅
𝑥̅ 𝑧. 𝑦𝑧̅
= ̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
̅̅̅̅̅̅
𝑥𝑦.
̅̅̅̅̅ ̅̅̅̅̅̅
𝑥. 𝑥 . ̅̅̅̅̅̅
𝑦. ̅̅̅̅̅𝑧 𝑦𝑧.
̅̅̅̅𝑧
An expression of a logical function can be transformed into the NOR form of NORs, by
application of Morgan's theorem. The 2nd normal form (POS) automatically transforms
into the NOR form of NORs by replacing the OR gates and AND gates with NOR gates.
Knowing that the algebraic expression of the NOR logic gate is: ̅̅̅̅̅̅̅
𝑥+𝑦
Example :
= ̅̅
𝑥𝑦̅̅̅ + ̅̅̅
𝑥̅ 𝑧 + ̅̅̅
𝑦𝑧̅
= 𝑥̅̅̅̅̅̅̅̅
+ 𝑦̅ + ̅̅̅̅̅̅̅
𝑥̅̅ + 𝑧̅ + ̅̅̅̅̅̅̅
𝑦̅ + 𝑧̅̅
= 𝑥̅̅̅̅̅̅̅̅
+ 𝑦 + ̅̅̅̅̅̅̅
𝑥 + 𝑧̅ + ̅̅̅̅̅̅̅
𝑦̅ + 𝑧
= ̅̅̅̅̅̅̅̅̅̅̅̅
𝑥 + 𝑥 + 𝑦 + ̅̅̅̅̅̅̅̅̅̅̅̅
̅̅̅̅̅̅̅ 𝑧 + 𝑧 + ̅̅̅̅̅̅̅̅̅̅̅̅
𝑥 + ̅̅̅̅̅̅̅ ̅̅̅̅̅̅̅
𝑦+𝑦+𝑧
̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
= ̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
̅̅̅̅̅̅̅̅̅̅̅̅
𝑥 + 𝑥 + 𝑦 + ̅̅̅̅̅̅̅̅̅̅̅̅
̅̅̅̅̅̅̅ 𝑥 + ̅̅̅̅̅̅̅ 𝑦 + 𝑦 + 𝑧 + ̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
𝑧 + 𝑧 + ̅̅̅̅̅̅̅̅̅̅̅̅
̅̅̅̅̅̅̅ ̅̅̅̅̅̅̅̅̅̅̅̅
𝑥 + 𝑥 + 𝑦 + ̅̅̅̅̅̅̅̅̅̅̅̅
̅̅̅̅̅̅̅ 𝑧 + 𝑧 + ̅̅̅̅̅̅̅̅̅̅̅̅
𝑥 + ̅̅̅̅̅̅̅ ̅̅̅̅̅̅̅
𝑦+𝑦+𝑧
1) Box
Relationship
F
Used between
variables Output
Inputs/Output
Inputs
2) A logic circuit
Examples:
1- f = x + yz
Remark :
The expression in ‘Example 1’ and that in ‘Example 2’ are two different writings of the
same function.
The representation of the function by the simplified expression leads to:
Reduction in production cost
Fast processing (time saving)
And also reduction in energy consumption
This means that simplification of logic functions is essential.
a. Algebraic method
Examples:
1) f = xy + 𝑥̅ z + yz
= xy + 𝑥̅ z + yz(x + 𝑥̅ )
= xy + 𝑥̅ z + yzx + yz𝑥̅
= xy(1+z) + 𝑥̅ z(1+y)
= xy + 𝑥̅ z
2) f = a 𝑐̅+ 𝑎̅b + bc
= ab + 𝑎̅b + a𝑏̅𝑐̅
= b + ab 𝑐̅+ a𝑏̅𝑐̅
= b + a 𝑐̅(b + 𝑏̅)
Remark:
The rules and properties of Boolean algebra make it possible to simplify functions
but remain a relatively cumbersome method. It never allows us to know whether or
not we arrive at a minimal expression of the function.
The Karnaugh method allows you to visualize a function and intuitively derive a
simplified function. The basic element of this method is the Karnaugh table which
represents, in tabular form, all possible combinations of states for a given number of
variables. Since each dimension of the array can visually represent two variables,
functions with four variables can easily be simplified using a two-dimensional array.
The Karnaugh table is based on the concept of adjacency. Two binary words are said to
be adjacent if they differ only by the complementarity of one, and only one, variable. If
two adjacent words are summed, they can be merged and the variable that differs is
eliminated.
Example :
ABC + AB 𝐶̅ = AB (C + 𝐶̅ ) = AB
The numbering of rows and columns is done according to the Gray code, we go from
one row to the next by changing a single bit and from one column to the next by also
changing a single bit.
x 0 1
0 m0 m1
1 m2 m3
yz
x 00 01 11 10
0 m0 m1 m3 m2
1 m4 m5 m7 m6
xy 00 01 11 10
00 m0 m1 m3 m2
01 m4 m5 m7 m6
11 m 12 m 13 m 15 m 14
10 m8 m9 m 11 m 10
Each box in a Karnaugh table corresponds to the single minterm taking the value 1 for
the combination identified by the row and the column. For example, the dark box in the
following table corresponds to the minterm m 1 representing ( x,y,z,w )=(0,0,0,1) which
gives 𝑚 1 = 𝑥 ̅. 𝑦 ̅. 𝑧 ̅. w.
zw
xy 00 01 11 10
00 m0 m1 m3 m2
01 m4 m5 m7 m6
11 m 12 m 13 m 15 m 14
10 m8 m9 m 11 m 10
The transition from the truth table to the Karnaugh table consists of filling each box (of
the Karnaugh table) with the value of the function for the corresponding (minterm)
product. This table is a two-dimensional representation of the truth table.
The simplification will consist of firstly representing the logical function by a Karnaugh
table, then proceeding to group together all the “1s” found in symmetrical or adjacent
boxes.
The rules for simplification using the Karnaugh table are as follows:
A prime implicant which contains at least 1 which cannot be included in any other prime
implicant is said to be essential prime implicant .
To obtain the minimal form, we first choose the essential prime implicants. Then, we
choose among the remaining prime implicants those which are necessary to completely
cover the original function.
If the minimal form contains only essential prime implicants, then it is unique.
Examples:
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 0
yz
x 00 01 11 10
0 m0 m1 m3 m2
1 m4 m5 m7 m6
x 00 01 11 10
0 0 1 1 0
1 0 1 0 0
Simplification:
Construction of groups: The minterms involved are m1, m3 and m5. The minterms
m1 and m3 are adjacent, we can therefore form a group g1 . The minterms m1 and
m5 are adjacent, we can therefore form a group g2 .
yz
x 00 01 11 10
g1=𝑥̅ . 𝑧
0 0 1 1 0
1 0 1 0 0
g2=𝑦̅. 𝑧
f(x,y,z,w) = m3 + m7 + m11
zw
xy 00 01 11 10
00 m0 m1 m3 m2
01 m4 m5 m7 m6
10 m8 m9 m11 m10
xy 00 01 11 10
00 0 0 1 0
01 0 0 1 0
11 0 0 0 0
10 0 0 1 0
Simplification:
Construction of groups: The minterms involved are m3, m7 and m11. The
minterms m3 and m7 are adjacent; we can therefore form a group g1. The
minterms m3 and m11 are adjacent, we can therefore form a group g2 .
zw
xy 00 01 11 10
00 0 0 1 0
g1=𝑥̅ . 𝑧𝑤
01 0 0 1 0
11 0 0 0 0
10 0 0 1 0 g2=𝑦̅. 𝑧𝑤
The simplified function is the logical sum of all the terms of each group, that is to
say:
𝑓(𝑥, 𝑦, 𝑧, 𝑤) = 𝑥̅ . 𝑧. 𝑤 + 𝑦̅. 𝑧. 𝑤
Remark :
The Karnaugh method requires that we minimize the number of groups and maximize
the number of 1s in a group. The 1s in a group must be in adjacent boxes, but the
number of 1s in a group must also be a power of 2. For example, if you have three 1s in
three boxes adjacent to each other, you will not be able to form just one group but two.
Karnaugh table:
The method remains the same as that explained previously, however taking into account
the fact that the state (ф, X) can be considered as a '0' or a '1', depending on which is
advantageous.
Noticed :
When the state (ф, X) has been set to ‘0’ or ‘1’, it is no longer possible to change its state
Redundant implicants:
An implicant is redundant if all the windows it covers in a Karnaugh table are already
covered by other implicants. This term can be removed from the equation without
changing the truth table. Under certain conditions, this term can stabilize the circuit by
removing momentary operating errors (gliches).
Remark :
The Karnaugh diagram method is effective for Boolean expressions with at most 4
entries (variables). Beyond that, the graphic representation becomes complex, it is
difficult to highlight the symmetries, and the method becomes unusable.
c. Quine−McCluskey method
With the previous methods, the simplifications were obtained purely intuitively; nothing
assures us that the function obtained is really the simplest that can be obtained.
Furthermore, in the absence of a well-defined algorithm, these methods cannot be
effectively implemented in software.
Example 1:
𝑆 = 𝐴̅𝐵̅ 𝐶𝐷
̅ + 𝐴̅𝐵𝐶̅ 𝐷
̅ + 𝐴̅𝐵𝐶̅ 𝐷 + 𝐴̅𝐵𝐶𝐷 + 𝐴𝐵̅ 𝐶̅ 𝐷 + 𝐴𝐵𝐶̅ 𝐷
Weight 1 0010
0100
0101
Weight 2 0110
1001
1101
3 0101 --------------
7 1101
Terms that have never spawned new terms are marked with an “*”
0100 010X
------- 01X0
0101 -------
0110 01X1
1001 X101*
------ 011X
0111 1X01*
1101
X101 √ √
The essential implicants are: 0X10, 1X01 and 01XX. Since they are sufficient to represent
all solutions, the simplified function is:
Example 2:
X111 √ √
The essential implicants are: 01X1 and 1X1X. Since they are sufficient to represent all
solutions, the simplified function is:
S = A̅ BD + AC
𝐹 = ∑(2,4,7,12,10,15) + ∅ ∑(6,9,11,14)
From this step on, optional conditions are treated like other terms.
Weight 1 0010
0100
Weight 2 0110
1001
1010
1100
Weight 3 0111
1011
1110
Weight 4 1111
1011 √ 10X1 √
1110 √ 11X0 √
1111 √ X111 √
1X11 √
111X √
Note that only essential terms are listed. The usefulness of optional conditions is over
since it is limited to allowing greater simplification.
10X1
1X1X √ √
S = BA̅ + C𝐴̅ + 𝐶𝐵
Remark:
The algebraic method for functions with two variables or functions with more
than two variables but containing few terms in canonical form.
Karnaugh's method for functions of three, four, five or six variables.
The Quine/McCluskey method for functions with five or more variables.