CST203 - M2 Ktunotes - in
CST203 - M2 Ktunotes - in
CST203 - M2 Ktunotes - in
Boolean Algebra
• Boolean algebra is an algebra for binary number system. It operates only on two numbers
0 & 1.
• It is a set of rules, laws and theorems by which logical operations can be mathematically
expressed.
• In the Boolean algebra, Binary variables can take either of two values 0 and 1 (TRUE or
FALSE),
• Boolean Algebra is used to analyze and simplify the digital (logic) circuits. It uses only
the binary numbers i.e. 0 and 1.
• It is also called as Binary Algebra or logical Algebra.
1. Dot sign(.):
If the two variables are A and B, then their logical product is A × B = A.B
Dot operation is also called logical AND operation A AND B
A B A AND B
0 0
0
1 0
0
0 0
1
1 1
1
2. Plus sign(+):
If the two variables are A and B, then their logical sum is A + B
Plus operation is also called logical OR operation A OR B
A B A OR B
0 0
0
Dept of CSE|STIST|PAGE 1
1 1
0
0 1
1
1 1
1
3. Complement:
4.
(‘) or (¯). These signs indicates that the terms are complemented.
If the term is A then A’ is NOT A.
A A’
1
0
0
1
Boolean Algebra is an algebraic structure defined on a set of elements K together with two
binary operators + and . and provided the following (Huntington) postulates are satisfied:
Dept of CSE|STIST|PAGE 2
• Postulate 5: Complement
A unary operation, complementation, exists for every element of K.
That is, for any element x in K
x.x’ = 0
x+ x’ = 1
• Postulate 6:
There exists at least two elements x, y in K such that x is not equal to y
Proof:
A + A = (A + A).1 (identity element)
= (A + A)(A + A`) (complement)
= A + A A` (distributivity)
= A + 0 (complement)
= A (complement)
By principle of duality A . A = A
Proof:
A + 1 = (A + 1).1 (identity element)
= 1.(A + 1) (commutativity)
= (A + A`)(A + 1) (complement)
Dept of CSE|STIST|PAGE 3
= A + A`. 1 (distributivity)
= A + A` (identity element)
= 1 (complement)
4. Absorption Theorem
A+A.B=A
A .(A + B) = A
Proof:
A + A.B = A.1 + A.B (identity element)
= A.(1 + B) (distributivity)
= A.1 (Theorem 2: Null Elements exist)
= A (identity element)
5. Associativity
A + (B + C) = (A + B) + C
A .(B . C) = (A . B).C
AND laws
A.0 = 0
A.1 = A
A.A = A
A.A’ = 0
Dept of CSE|STIST|PAGE 4
OR laws
A+0=A
A+1=1
A+A=A
A + A’ = 1
De Morgan's Theorems
I. Theorem 1: (A.B)’ = A’ + B’
Complement of product is equal to the sum of complements
Table showing verification of the De Morgan's first theorem −
Dept of CSE|STIST|PAGE 5
Consensus Theorem
a) AB + A’C + BC = AB + A’C
Proof:
AB + A'C + BC
=AB(1 + C) + A'C(1 + B)
b) (A+B).(A'+C).(B+C) = (A+B).(A'+C)
Duality Principle
This principle states that any algebraic equality derived from these axioms will still be valid
whenever the OR and AND operators, and identity elements 0 and 1, have been interchanged. i.e.
changing every OR into AND and vice versa, and every 0 into 1 and vice versa.
Boolean Expressions and Their Corresponding Duals:
Dept of CSE|STIST|PAGE 6
Dept of CSE|STIST|PAGE 7
Logic gates
Logic gates are the basic building blocks of any digital system. It is an electronic circuit having
one or more than one input and only one output. The relationship between the input and the output
is based on a certain logic. Based on this, logic gates are named as AND gate, OR gate, NOT gate
etc.
2. AND Gate
• It has n input (n >= 2) and one output.
• Y = A.B
• Output of AND gate is High (1) only if both inputs are High (1)
• Logic diagram and Truth Table for AND Gate
Dept of CSE|STIST|PAGE 8
3. OR Gate
• It has n input (n >= 2) and one output.
• Y = A+ B
• Output of OR gate is High (1) if atleast one input is High (1).
• Logic diagram and Truth Table for OR Gate.
4. NAND Gate
• A NOT-AND operation is known as NAND operation.
• It has n input (n >= 2) and one output.
• Output of NAND gate is complement of AND gate. Output is low (0) only when both
inputs are High (1).
• Logic diagram and Truth Table for NAND Gate.
Dept of CSE|STIST|PAGE 9
5. NOR Gate
• A NOT-OR operation is known as NOR operation. It has n input (n >= 2) and one
output.
• Output of NOR gate is complement of OR gate. Output is low (0) when atleast one input
is High(1).
• Logic diagram and Truth Table for NOR Gate.
6. XOR Gate
• XOR or Ex-OR gate is a special type of gate. It has n input (n >= 2) and one output.
• Y= A⊙B
• Output of 2-input XOR gate is high(1) when inputs are different, low (0) when inputs are
same.
• Output of 3-input XOR gate is high(1) when number of input that are high are odd, and
low (0) when the number of inputs that are high are not odd.
• Logic diagram and Truth Table for XOR Gate.
Dept of CSE|STIST|PAGE 10
7. XNOR Gate
• XNOR or EX-NOR gate is a special type of gate. It has n input (n >= 2) and one output.
• Y= A⊙B
• Output of XNOR gate is high(1) when inputs are same, low (0) when inputs are different.
• Logic diagram and Truth Table for XNOR Gate.
Boolean Functions
Here the left side of the equation represents the output Y. So equation no. 1 can be
written as
Dept of CSE|STIST|PAGE 11
Examples:
Dept of CSE|STIST|PAGE 12
Dept of CSE|STIST|PAGE 13
Example:
f (a, b, c)
= a.b’ + b + a.b.c
= a.b’ (c + c’) + b (a + a’)(c + c’) + a.b.c
= a.b’.c + a.b’.c’ + a.b.c + a.b.c’ + a’.b.c + a’.b.c’ + a.b.c
= a.b’.c + a.b’.c’ + a.b.c + a.b.c’ + a’.b.c + a’.b.c’
f (a, b, c)
= a’ (b’ + c)
= (a’ + bb’ + cc’) (b’ + c + aa’)
= (a’ + b + c)(a’ + b + c’)(a’ + b’ + c)(a’ + b’ + c’)(a + b’ + c)(a’ + b’ + c)
= (a’ + b + c)(a’ + b + c’)(a’ + b’ + c)(a’ + b’ + c’)(a + b’ + c)
Dept of CSE|STIST|PAGE 14
Example:
f (a, b, c) = a’.b’.c’ + a’.b’.c + a’.b.c’ + a.b.c’ + a.b.c
f
= (f’)’
= [(a’.b’.c’ + a’.b’.c + a’.b.c’ + a.b.c’ + a.b.c)’]’
= [a’.b.c + a.b.c’ + a.b’.c]’ (Consider remaining minterms)
= (a + b’ + c’)(a’ + b’ + c)(a’ + b + c)
Example: Obtain the canonical sum of product form of the following function:
F (A, B) = A + B
Solution:
The given function contains two variables A and B. The variable B is missing from the
first term of the expression and the variable A is missing from the second term of the expression.
Therefore, the first term is to be multiplied by (B + B′) and the second term is to be multiplied by
(A + A′) as demonstrated below.
F (A, B) = A + B
= A.1 + B.1
= A (B + B′) + B (A + A′)
= AB + AB′ + AB + A′B
= AB + AB′ + A′B (as AB + AB = AB)
Hence the canonical sum of the product expression of the given function is
F (A, B) = AB + AB′ + A′B.
Example: Obtain the canonical sum of product form of the following function.
F (A, B, C) = A + BC
Solution:
Here neither the first term nor the second term is minterm. The given function contains
three variables A, B, and C. The variables B and C are missing from the first term of the
expression and the variable A is missing from the second term of the expression. Therefore, the
Dept of CSE|STIST|PAGE 15
first term is to be multiplied by (B + B′) and (C + C′). The second term is to be multiplied by (A
+ A′)..
F (A, B, C) = A + BC
= A (B + B′) (C + C′) + BC (A + A′)
= (AB + AB′) (C + C′) + ABC + A′BC
= ABC + AB′C + ABC′ + AB′C′ + ABC + A′BC
= ABC + AB′C + ABC′ + AB′C′ + A′BC (as ABC + ABC = ABC)
Hence the canonical sum of the product expression of the given function is
F (A, B, C) = ABC + AB′C + ABC′ + AB′C′ + A′BC.
Example : Obtain the canonical product of the sum form of the following function.
F (A, B, C) = (A + B′) (B + C) (A + C′)
Solution:
In the above three-variable expression, C is missing from the first term, A is missing from the
second term, and B is missing from the third term. Therefore, CC′ is to be added with first term,
AA′ is to be added with the second, and BB′ is to be added with the third term.
F (A, B, C) = (A + B′) (B + C) (A + C′)
= (A + B′ + 0) (B + C + 0) (A + C′ + 0)
= (A + B′ + CC′) (B + C + AA′) (A + C′ + BB′)
= (A + B′ + C) (A + B′ + C′) (A + B + C) (A′ + B + C) (A + B + C′) (A + B′ + C′)
[using the distributive property, as X + YZ = (X + Y)(X + Z)]
= (A + B′ + C) (A + B′ + C′) (A + B + C) (A′ + B + C) (A + B + C′)
[as (A + B′ + C′) (A + B′ + C′) = A + B′ + C′]
Hence the canonical product of the sum expression for the given function is
F (A, B, C) = (A + B′ + C) (A + B′ + C′) (A + B + C) (A′ + B + C) (A + B + C′)
Example: Obtain the canonical product of the sum form of the following function.
F (A, B, C) = A + B′C
Solution:
Dept of CSE|STIST|PAGE 16
In the above three-variable expression, the function is given at sum of the product form. First, the
function needs to be changed to product of the sum form by applying the distributive law as
shown below.
F (A, B, C) = A + B′C
= (A + B′) (A + C)
Now, in the above expression, C is missing from the first term and B is missing from the second
term. Hence CC′ is to be added with the first term and BB′ is to be added with the second term as
shown below.
F (A, B, C) = (A + B′) (A + C)
= (A + B′ + CC′) (A + C + BB′)
= (A + B′ + C) (A + B′ + C′) (A + B + C) (A + B′ + C)
[using the distributive property, as X + YZ = (X + Y) (X + Z)]
= (A + B′ + C) (A + B′ + C′) (A + B + C)
[as (A + B′ + C) (A + B′ + C) = A + B′ + C]
Hence the canonical product of the sum expression for the given function is
F (A, B, C) = (A + B′ + C) (A + B′ + C′) (A + B + C).
Dept of CSE|STIST|PAGE 17
The final sum of products expression (SOP) for the output Y is derived by summing or
performing an OR operation of the four product terms as shown below.
Y = A′BC′ + AB′C′ + AB′C + ABC′
In general, the procedure of deriving the output expression in SOP form from a truth table can be
summarized as below.
1. Form a product term for each input combination in the table, containing an output value of 1.
2. Each product term consists of its input variables in either true form or complemented form. If
the input variable is 0, it appears in complemented form and if the input variable is 1, it appears
in true form.
3. To obtain the final SOP expression of the output, all the product terms are OR operated.
Dept of CSE|STIST|PAGE 18
In general, the procedure of deriving the output expression in POS form from a truth table can be
summarized as below.
1. Form a sum term for each input combination in the table, containing an output value of 0.
2. Each product term consists of its input variables in either true form or complemented
form. If the input variable is 1, it appears in complemented form and if the input variable is 0, it
appears in true form.
5. To obtain the final POS expression of the output, all the sum terms are AND operated.
Dept of CSE|STIST|PAGE 19
Dept of CSE|STIST|PAGE 20
o In the above figure, there is only one possibility of grouping four adjacent minterms.
o The possible combinations of grouping 2 adjacent minterms are {(m0, m1), (m2, m3), (m0,
m2) and (m1, m3)}.
Dept of CSE|STIST|PAGE 21
3-variable K-map
The 3-variable K-map is represented as an array of 23 = 8 cells.
Dept of CSE|STIST|PAGE 22
Dept of CSE|STIST|PAGE 23
5-variable K-map
With the help of the 32- cell K-map, the boolean expression with 5 variables can be simplified.
For constructing a 5-variable K-map, we use two 4-variable K-maps. The cell adjacencies within
each of the 4- variable maps for the 5-variable map are similar to the 4- variable map.
A K-map for five variables (PQRST) can be constructed using two 4-variable maps. Each map
contains 16 cells with all combinations of variables Q, R, S, and T. One map is for P = 0, and the
other is for P = 1).
Dept of CSE|STIST|PAGE 24
Illustration of Step 4
• In the below example, there is a total of two groups, i.e., group 1 and group 2, with
two and one number of 'ones'.
• In the first group, the ones are present in the row for which the value of A is 0.
Thus, they contain the complement of variable A. Remaining two 'ones' are present
in adjacent columns. In these columns, only B term in common is the product term
corresponding to the group as A'B. Just like group 1, in group 2, the one's are
present in a row for which the value of A is 1. So, the corresponding variables of
this column are B'C'. The overall product term of this group is AB'C'.
Dept of CSE|STIST|PAGE 25
3. We group the number of ones in the decreasing order. First, we have to try to make the group
of eight, then for four, after that two and lastly for 1.
4. In horizontally or vertically manner, the groups of ones are formed in shape of rectangle and
square. We cannot perform the diagonal grouping in K-map.
5. The elements in one group can also be used in different groups only when the size of the
group is increased.
6. The elements located at the edges of the table are considered to be adjacent. So, we
can group these elements.
Dept of CSE|STIST|PAGE 26
7. consider the 'don't care condition' only when they aid in increasing the group-size.
Otherwise, 'don't care' elements are discarded
Solution:
• Given expression is in canonical form, as every term contains all the variables A and
B.
• Expression contains 2 variables A and B, hence 2 variable K map with 4 cells
required.
• enter 1 to each product-term into the K-map cell and fill the remaining cells with
zeros.
• form the groups by considering ones in the K-map (refer K-map grouping rules)
Dept of CSE|STIST|PAGE 27
• find the boolean expression for each group by looking at the common variables in
cell-labeling
Ans: Y=A'+B
Solution:
• Given expression is in canonical form, as every term contains all the variables A, B
and C.
• Expression contains 3 variables A, B and C, hence 3 variable K map with 8 cells
required.
Dept of CSE|STIST|PAGE 28
Group 1 : C’
Group 2 : A
Example 3: Simplify using Kmap Y= A'B'C' D' + A' B' CD' + A' BC’D + A' BCD
+ AB' C'D' + ABC’D + ABCD + AB’CD’
Dept of CSE|STIST|PAGE 29
Group 1: B’D’
Group 2: BD
Dept of CSE|STIST|PAGE 30
4. At last, to find the simplified boolean expression in the POS form, we will combine the
sum-terms of all individual groups.
Group 1 : P + Q + R
Group 2 : Q’+R’
Group 3 : P’ + Q’
Dept of CSE|STIST|PAGE 31
There exists functions for which some of the inputs are treated as don’t cares and the
corresponding output values do not matter. Such inputs will never appear.
When creating the groups, we can include the cells marked as ‘X’ along with those marked as ‘1’
to make the group bigger. It is not necessary to include all cells marked as ‘X’.
Dept of CSE|STIST|PAGE 32