Unit 1
Unit 1
Unit 1
a. Logic Gates
Logic gates are the basic building blocks of any digital system. Logic gates are
electronic circuits having one or more than one input and only one output. The
relationship between the input and the output is based on certain logic. Based on this,
logic gates are named as:
1. AND gate
2. OR gate
3. NOT gate
4. NAND gate
5. NOR gate
6. Ex-OR gate
7. Ex-NOR gate
1. AND gate: The AND gate is an electronic circuit that gives a high output (1) only
if all its inputs are high. A dot (.) is used to show the AND operation i.e. A.B or
can be written as AB
Y= A.B
Figure-1: Logic Symbol of AND Gate Figure-2: Truth Table of AND Gate
2. OR gate: The OR gate is an electronic circuit that gives a high output (1) if one or
more of its inputs are high. A plus (+) is used to show the OR operation.
Y= A+B
Y= A'
Figure-3: Logic Symbol of NOT Gate Figure-6: Truth Table of NOT Gate
4. NAND gate: This is a NOT-AND gate which is equal to an AND gate followed
by a NOT gate. The outputs of all NAND gates are high if any of the inputs are
low. The symbol is an AND gate with a small circle on the output. The small
circle represents inversion.
Y= AB
Figure-7: Logic Symbol of NAND Gate Figure-8: Truth Table of NAND Gate
Y=A+B
Figure-9: Logic Symbol of NOR gate Figure-10: Truth Table of NOR gate
6. Ex-OR gate: The 'Exclusive-OR' gate is a circuit which will give a high output if
either, but not both of its two inputs are high. An encircled plus sign (⊕) is used to
show the Ex-OR operation.
Y=A⊕B
Figure-11: Logic Symbol of Ex-OR gate Figure-12: Truth Table of Ex-OR gate
7. Ex-NOR gate: The 'Exclusive-NOR' gate circuit does the opposite to the EX-OR
gate. It will give a low output if either, but not both of its two inputs are high. The
symbol is an EX-OR gate with a small circle on the output. The small circle
represents inversion.
Y= A⊕B
Fig.-13: Logic Symbol of Ex-NOR gate Fig.-14: Truth Table of Ex-NOR gate
Ex-NOR gate is created from AND, NOT and OR gates. The output is high only
when both the inputs are same.
Digital Control circuits give the facilities to ON, OFF, and speed control of a
machine by computer from the control rooms. This is possible for the logic gates.
Chapter-2 Boolean Algebra
Variable used can have only two values. Binary 1 for HIGH and Binary 0 for LOW.
Complement of a variable is represented by an overbar (-). Thus, complement of
variable B is represented as . Thus if B = 0 then = 1 and B = 1 then = 0.
ORing of the variables is represented by a plus (+) sign between them. For example
ORing of A, B, C is represented as A + B + C.
Logical ANDing of the two or more variable is represented by writing a dot between
them such as A.B.C. Sometime the dot may be omitted like ABC.
Commutative law: Any binary operation which satisfies the following expression is
referred to as commutative operation.
Commutative law states that changing the sequence of the variables does not have any
effect on the output of a logic circuit.
Associative law: This law states that the order in which the logic operations are
performed is irrelevant as their effect is the same.
AND law: These laws use the AND operation. Therefore they are called
as AND laws.
OR law: These laws use the OR operation. Therefore they are called as OR laws.
INVERSION law: This law uses the NOT operation. The inversion law states that
double inversion of a variable results in the original variable itself.
Example:
AB + BC' + AC = AC + BC'
Proof:
LHS
= AB + BC' + AC
= AB(C + C') + BC'(A + A') + AC(B + B')
= ABC + ABC' + ABC' + A'BC' + ABC + AB'c
= ABC + ABC' + A'BC' + AB'C
= AC(B + B') + BC'(A + A')
= AC + BC'
= RHS
d. Duality Theorem:
Dual expression is equivalent to write a negative logic of the given boolean relation. For
this,
Change each OR sign by and AND sign and vice-versa.
Complement any 0 or 1 appearing in the expression.
Keep literals as it is.
Example:
Dual of A(B+C) = A+(B.C) = (A+B)(A+C)
e. Complementary Theorem: For obtaining complement expression,
Change each OR sign by AND sign and vice-versa.
Complement any 0 or 1 appearing in the expression.
Complement the individual literals.
Example:
Complement of A(B+C) = A'+(B'.C') = (A'+B')(A'+C')
3. Simplification using boolean algebra
A simplified Boolean expression uses the fewest gates possible to implement a given
expression.
Simplify: C + BC:
Expression Rule(s) Used
C + BC Original Expression
C + (B + C) DeMorgan's Law.
T Identity Law.
A Complement, Identity.
(A + C)A(D + D) + AC + C Distributive.
AA + AC + C Distributive.
You can also use distribution of or over and starting from A(A+C)+C to
reach the same result by another route.
AB + A(B + T + B) Distributive.
A + AB Commutative.
(A + A)(A + B) Distributive.
Note:
If the number of input variables are n, then the total number of
combinations in Boolean algebra is 2n.
If the input variable (let A) value is :
Zero (0) – a is LOW -It should be represented as A’ (Complement
of A)
One (1) – a is HIGH -It should be represented as A
In boolean logic,
AND is represented as '.'
A AND B is written as 'A.B'
OR is represented as '+'
A OR B is written as 'A+B'
For example, Considering number of input variables =3, Say A, B
and C.
Total number of combinations are: 23=8.
A B C
0 0 0
0 0 1
0 1 0
A B C
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
A B C X
0 0 0 0
0 0 1 1
A B C X
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 0
The function X can be written in SOP form by adding all the min-
terms when X is HIGH(1).
While writing SOP, the following convention is to be followed:
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 0
X (POS) = M (0, 2, 4, 5, 7)
= (A+B+C).(A+B'+C).(A'+B+C).(A'+B+C').(A'+B'+C')
Solution:
To realize this using the AOI logic gates, we will use the reverse approach.
Step 1:
Our expression BC + A + (A+C) is the summation of three terms BC, A and, (A+C), thus
a 3-input OR Gate must have been used to obtain the expression as given :0
Step 2:
Now, BC and (A + C) both are inverted in nature, so they must have been inverted using a
NOT Gate earlier. BC must have been obtained by inverting the input BC and (A +
C) must have been obtained by inverting the input (A + C) both using the NOT Gate.
Step 3:
Moving further, in the reverse direction we see, BC must have been an output of 2-input
AND Gate with inputs as B and C. Likewise, (A + C) must have been obtained as the
output of 2-input OR gate with A and C as the inputs.
So, Final Logic Diagram for above given Boolean expression can be drawn as,
Converting Logic Diagrams into Boolean Expressions
The easiest way to obtain the Boolean Expression from any logic circuit is to follow the
forward propagation approach. In this, we start from the input side and move ahead until
the output is reached. While moving from the input side to the output side, we continue
evaluating the output of intermediate logic gates.
Example 1: Find out the Boolean Expression for Logic Diagram given below and
simplify the output in the minimal expression, also implement the simplified
expression using the AOI logic.
Solution:
Following the forward propagation approach, we see that gate G1 is a 2-input AND Gate
having inputs A and B. So, output of G1 will be AB. Similarly, G2 is an OR Gate, so
output of G2 will be (B+C). Also, G3 is an AND Gate and its output will be AB.
Now, gate G4 is a 2-input OR Gate which has one of its inputs as A and the other one is
the output of gate G1, thus the output of gate G4 will be (A + AB). Similarly, output for
gate G5 and G6 will be (B + BC) and (C + AB) respectively. Now, gate G7 is a 3-input
AND Gate, therefore output (Y) of G7 will be equal to (A+AB). (B+BC). (C+AB)
Since, we have Y = (A+AB). (B+BC). (C+AB), now we have to minimize it.
Therefore, Y=AB is the minimal expression. This can be implemented using a 2-input
AND Gate having inputs A and B as:
The K-map is a systematic way of simplifying Boolean expressions. With the help of the K-
map method, we can find the simplest POS and SOP expression, which is known as the
minimum expression. The K-map provides a cookbook for simplification.
Just like the truth table, a K-map contains all the possible values of input variables and their
corresponding output values. However, in K-map, the values are stored in cells of the array.
In each cell, a binary value of each input variable is stored.
The K-map method is used for expressions containing 2, 3, 4, and 5 variables. For a higher
number of variables, there is another method used for simplification called the Quine-
McClusky method. In K-map, the number of cells is similar to the total number of variable
input combinations. For example, if the number of variables is three, the number of cells is
23=8, and if the number of variables is four, the number of cells is 2 4. The K-map takes the
SOP and POS forms. The K-map grid is filled using 0's and 1's. The K-map is solved by
making groups. There are the following steps used to solve the expressions using K-map:
2 Variable K-map
There is a total of 4 variables in a 2-variable K-map. There are two variables in the 2-variable
K-map. The following figure shows the structure of the 2-variable K-map:
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 {(m 0, m1), (m2, m3),
(m0, m2) and (m1, m3)}.
3-variable K-map
The 3-variable K-map is represented as an array of eight cells. In this case, we used A, B, and
C for the variable. We can use any letter for the names of the variables. The binary values of
variables A and B are along the left side, and the values of C are across the top. The value of
the given cell is the binary values of A and B at left side in the same row combined with the
value of C at the top in the same column. For example, the cell in the upper left corner has a
binary value of 000, and the cell in the lower right corner has a binary value of 101.
The 4-Variable Karnaugh Map
The 4-variable K-map is represented as an array of 16 cells. Binary values of A and B are
along the left side, and the values of C and D are across the top. The value of the given cell is
the binary values of A and B at left side in the same row combined with the binary values of
C and D at the top in the same column. For example, the cell in the upper right corner has a
binary value of 0010, and the cell in the lower right corner has a binary value of 1010
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).
7. Simplification of boolean expressions using Karnaugh Map
As we know that K-map takes both SOP and POS forms. So, there are two possible solutions
for K-map, i.e., minterm and maxterm solution. Let's start and learn about how we can find
the minterm and maxterm solution of K-map.
There are the following steps to find the minterm solution or K-map:
Step 2: Next, we create the K-map by entering 1 to each product-term into the K-map
cell and fill the remaining cells with zeros.
Step 3: Next, we form the groups by considering each one in the K-map.
Notice that each group should have the largest number of 'ones'. A group cannot contain
an empty cell or cell that contains 0.
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.
The elements in one group can also be used in different groups only when the size of
the group is increased.
The elements located at the edges of the table are considered to be adjacent. So, we can
group these elements.
We can consider the 'don't care condition' only when they aid in increasing the group-
size. Otherwise, 'don't care' elements are discarded.
Step 4: In the next step, we find the boolean expression for each group. By looking at
the common variables in cell-labeling, we define the groups in terms of input variables.
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'.
Step 5: Lastly, we find the boolean expression for the Output. To find the simplified
boolean expression in the SOP form, we combine the product-terms of all individual
groups. So the simplified expression of the above k-map is as follows:
A'+AB'C'
To find the simplified maxterm solution using K-map is the same as to find for the
minterm solution. There are some minor changes in the maxterm solution, which are as
follows:
i. We will populate the K-map by entering the value of 0 to each sum-term into the K-
map cell and fill the remaining cells with one's.
ii. We will make the groups of 'zeros' not for 'ones'.
iii. Now, we will define the boolean expressions for each group as sum-terms.
iv. At last, to find the simplified boolean expression in the POS form, we will combine
the sum-terms of all individual groups.
Let's take some example of 2-variable, 3-variable, 4-variable and 5-variable K-map
examples
Example 1: Y=(A'+B')+(A'+B)+(A+B)
Example 2: Y=(A + B + C') + (A + B' + C') + (A' + B' + C) + (A' + B' + C')
Example 3: F(A,B,C,D)=π(3,5,7,8,10,11,12,13)