DDMP Unit 2 Updated 2024
DDMP Unit 2 Updated 2024
Dr. V S M Srinivasavarma,
Assistant Professor,
Computer Science and Engineering,
Shiv Nadar University Chennai.
Boolean Algebra
• Boolean algebra is a mathematical system for the manipulation of variables
that can have one of two values.
• In formal logic, these values are “true” and “false.”
• In digital systems, these values are “on” and “off,” 1 and 0, or “high” and
“low.”
• Boolean expressions are created by performing operations on Boolean
variables.
• Common Boolean operators include AND, OR, and NOT.
Boolean Algebra
• A Boolean operator can be completely described using
a truth table.
• The truth table for the Boolean operators AND and
OR are shown at the right.
• The AND operator is also known as a Boolean
product. The OR operator is the Boolean sum.
Boolean Algebra
• The truth table for the Boolean NOT operator
is shown at the right.
• The NOT operation is most often designated by
an overbar. It is sometimes indicated by a
prime mark ( ‘ ) or an “elbow” ().
Boolean Algebra
• A Boolean function has:
• At least one Boolean variable,
• At least one Boolean operator, and
• At least one input from the set {0,1}.
• It produces an output that is also a member of the set {0,1}.
2. 2. X + Y )( X +
( X + Y )( X + Y ) = X
( '
Y ) '= X
3. 3. X X+ +XY XY = = XX
4. 4. X ( X +
X (X +Y) = X Y ) = X
5. ( X + Y' )Y = XY
'
5. ( X + Y )Y = XY
' +Y = X +Y
'
6. XY
6. XY + Y = X + Y
Simplification Theorems
• Proof 6.
R.H.S. = X+Y
= X(Y+Y’)+Y(X+X’)
= XY+XY’+XY+X’Y
= XY+XY’+X’Y
= (X+X’)Y+XY’
= Y+XY’
= L.H.S.
Operator Precedence
• Parenthesis
• NOT
• AND
• OR
[( A + B )C ] = ?
' ' '
[( AB + C ) D + E ] = ?
' ' '
A + (( BC ) ' '
+ D)
' ''
=?
Boolean Algebra
• Most Boolean identities have an AND (product) form as well as an OR (sum)
form. We give our identities using both forms. Our first group is rather intuitive:
Boolean Algebra
• Our second group of Boolean identities should be familiar to you from your study
of algebra:
Duality
• The dual of a Boolean expression is obtained by interchanging Boolean sums and
Boolean products and interchanging 0s and 1s.
Examples:
The dual of x(y + z) is x + yz.
The dual of -x1 + (-y + z) is (-x + 0)((-y)z).
minterms
• Consider variables A and B
• Assume that they are somehow combined with AND operator
• There are 4 possible combinations
0 0 0 A+B+C 𝑀0
0 0 1 A+B+C' 𝑀1
0 1 0 A+B'+C 𝑀2
0 1 1 A+B'+C' 𝑀3
1 0 0 A'+B+C 𝑀4
1 0 1 A'+B+C' 𝑀5
1 1 0 A'+B'+C 𝑀6
1 1 1 A'+B'+C' 𝑀7
Example
• Express F in the sum of minterms and product of maxterms formats
F = A + BC '
AB + CD E + AC E
' ' ' '
YES
A+ B +C + D E
' ' YES
( A + B)CD + EF NO
Sum-of-Products
A
B'
C
D'
E
A
C'
E'
Product-of-Sums
All sums are the sums of single variables
( A + B )(C + D + E )( A + C + E )
' ' ' '
YES
AB C ( D + E )
' ' YES
( A + B)(C + D) + EF NO
Product-of-Sums
One or more OR gates feeding a single AND gate at the output
A
B'
C
D'
E
A
C'
E'
Simplifications of Boolean Equations
• Every Boolean equation represent some logic function which has some
computational relevance.
• Every Boolean logic has to be implemented by using logic gates
• For time being, let us assume, we need to implement them using Basic Gates:
AND, OR, and NOT.
• The objective is to implement a given Boolean function using minimum number
of Gates.
• Why minimum Gates.? To reduce the cost and energy consumption of the chip.
Canonical & Standard Forms
We can express a Boolean equation in following two ways.
• Canonical SoP form
• Canonical PoS form
• F = A + B’C
• F = A’B’C + AB’C’ + AB’C + ABC’ + ABC ➔ Canonical SoP form
• F = Sigma(1, 4, 5, 6, 7)
• A given function in canonical SoP form can be represented in the canonical PoS form as
follows:
• F = Pi(0, 2, 3)
• F = (A+B+C)*(A+B’+C)*(A+B’+C’) ➔ Canonical PoS form
• Both canonical SoP and canonical PoS forms are Dual to each other. Functionally, these
two forms are same. Based on the requirement, we can use one of these two forms.
Canonical & Standard Forms
Whereas the reduced form is also referred to as the standard form
Any Boolean function can be reduced by using one of the following techniques:
1. Naïve Approach: Using Boolean Laws
2. Karnaugh Map (K-Map)
3. Quine-Mccluskey Method (Tabular Approach)
Naïve Approach: Using Boolean Laws
Ex-Or: ⊕. ҧ + A 𝐵ത
A ⊕ B = 𝐴𝐵
𝐹 = 𝐴ҧ𝐵𝐶 ҧ 𝐶ҧ + A 𝐵ത 𝐶ҧ +ABC
ത + 𝐴B
Ex-Nor: ʘ. A ʘ B = 𝐴ҧ𝐵ത + AB
𝐹 = 𝐴(ҧ 𝐵𝐶
ത +B 𝐶)ҧ + A( 𝐵ത 𝐶ҧ +BC)
Recall that, (𝐴 + 𝐵) = 𝐴ҧ * 𝐵ത
ҧ ⊕ 𝐶) + A(B ʘ C)
𝐹 = 𝐴(𝐵
ҧ ⊕ 𝐶) + A(𝐵 ⊕ 𝐶)
𝐹 = 𝐴(𝐵 (A ⊕ B) = ҧ + A 𝐵ത
𝐴𝐵
𝐹 =𝐴⊕𝐵⊕𝐶 ҧ ത
= (𝐴𝐵)*(A 𝐵)
= ҧ 𝐵)*(
(𝐴+ ത
ത 𝐴ҧ + 𝐵)
Here, F represents the sum output of a = ҧ
ത 𝐴+B)
(A+ 𝐵)*(
Full-adder circuit. More about a Full-adder = (A 𝐴ҧ + AB + 𝐴ҧ𝐵ത + B 𝐵ത )
will be discussed in Unit -3. = (0+ AB + 𝐴ҧ𝐵ത + 0)
= (𝐴ҧ𝐵ത + AB)
= AʘB
Naïve Approach: Using Boolean Laws
Note, while minimizing any Boolean expression, we need to recall the basic
Boolean laws and apply them as needed.
Exercises:
A A = 0
A A' = 1
A B = B A
( A B) C = A ( B C ) = A B C
A( B C ) = AB AC
( A B) ' = A B ' = A' B = AB + A' B '
A B = 1 A = 1 or B = 1 but not both
In other words, the output of Ex-Or gate is high when both the inputs are different.
Ex-Nor is the complement of Ex-Or output.
Logic Gates
• NAND and NOR gates are also called as Universal Gates.
• AND+NOT = NAND, OR+NOT = NOR.
• In real-world, for VLSI digital circuit implementation, the VLSI library has only
two macros in the library (NAND and NOR)
• Any equation should be implemented using these macros
• Why NAND and NOR.? Please explore and answer by next class (+2 Marks will
be rewarded in the CIA*).
• And, using NAND and NOR, we can implement all other gates, i.e. AND, OR,
NOT, Ex-OR, and Ex-Nor.
Practice Question: (i) Implement all other gates using NAND gate alone
(Cond.: Use minimum no. of gates).
Karnaugh Maps (K-Maps)
Motivation:
• Simplification of logic expression using Boolean algebra is awkward because:
• it lacks specific rules to predict the most suitable next step in the
simplification process
• it is difficult to determine whether the simplest form has been achieved.
K-Map
• A Karnaugh map is a graphical method used to obtained the most simplified form
of an expression in a standard form (Sum-of-Products or Product-of-Sums).
• The simplest form of an expression is the one that has the minimum number of
terms with the least number of literals (variables) in each term.
• By simplifying an expression to the one that uses the minimum number of terms,
we ensure that the function will be implemented with the minimum number of
gates.
• By simplifying an expression to the one that uses the least number of literals for
each terms, we ensure that the function will be implemented with gates that have
the minimum number of inputs.
K-Map
Ex:
K-Map
• Essential Prime Implicants: These are those subcubes (groups) that cover at least
one minterm that can’t be covered by any other prime implicant. Essential prime
implicants(EPI) are those prime implicants that always appear in the final
solution.
Ex:
Three-Variable K-Map
f = (0,4) = B C f = (4,5) = A B f = (0,1,4,5) = B f = (0,1,2,3) = A
BC BC BC BC
A 00 01 11 10 A 00 01 11 10 A 00 01 11 10 A 00 01 11 10
0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 1 1
1 1 0 0 0 1 1 1 0 0 1 1 1 0 0 1 0 0 0 0
BC BC BC BC
A 00 01 11 10 A 00 01 11 10 A 00 01 11 10 A 00 01 11 10
0 0 1 1 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 1
1 0 0 0 0 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1
Three-Variable K-Map
BC BC BC
A 00 01 11 10 A 00 01 11 10 A 00 01 11 10
0 1 0 1 1 1 0 1 1
1 1 1 1 1 1 1 1 1 1
BC BC BC
A 00 01 11 10 A 00 01 11 10 A 00 01 11 10
0 1 0 1 1 1 0
1 1 1 1 1 1 1 1
Four-Variable K-Maps
CD CD CD CD
AB 00 01 11 10 AB 00 01 11 10 AB 00 01 11 10 AB 00 01 11 10
00 1 0 0 0 00 0 0 0 0 00 0 0 0 0 00 0 0 0 0
01 0 0 0 0 01 0 1 0 0 01 0 0 0 0 01 1 0 0 1
11 0 0 0 0 11 0 1 0 0 11 0 1 1 0 11 0 0 0 0
10 1 0 0 0 10 0 0 0 0 10 0 0 0 0 10 0 0 0 0
CD CD CD CD
AB 00 01 11 10 AB 00 01 11 10 AB 00 01 11 10 AB 00 01 11 10
00 0 0 1 1 00 0 0 0 0 00 0 0 1 1 00 1 0 0 1
01 0 0 1 1 01 1 0 0 1 01 0 0 0 0 01 0 0 0 0
11 0 0 0 0 11 1 0 0 1 11 0 0 0 0 11 0 0 0 0
10 0 0 0 0 10 0 0 0 0 10 0 0 1 1 10 1 0 0 1
CD CD CD CD
AB 00 01 11 10 AB 00 01 11 10 AB 00 01 11 10 AB 00 01 11 10
00 0 1 1 0 00 1 0 0 1 00 0 0 0 0 00 1 1 1 1
01 0 1 1 0 01 1 0 0 1 01 1 1 1 1 01 0 0 0 0
11 0 1 1 0 11 1 0 0 1 11 1 1 1 1 11 0 0 0 0
10 0 1 1 0 10 1 0 0 1 10 0 0 0 0 10 1 1 1 1
10 1 1 10 1 1 1 10 1
CD CD CD
AB 00 01 11 10 AB 00 01 11 10 AB 00 01 11 10
00 1 1 00 00
01 1 1 1 1 01 01
11 1 1 1 11 11
10 1 10 10
Design of combinational digital circuits
• Steps to design a combinational digital circuit:
• From the problem statement derive the truth table
• From the truth table derive the unsimplified logic expression
• Simplify the logic expression
• From the simplified expression draw the logic circuit
Design of combinational digital circuits
• Example: Design a 3-input (A,B,C) digital circuit that will give at its output (X) a
logic 1 only if the binary number formed at the input has more ones than zeros.
Inputs Output
A B C X X = (3, 5, 6, 7)
0 0 0 0 0
1 0 0 1 0 X
BC
2 0 1 0 0 A 00 01 11 10
3 0 1 1 1 0 0 0 1 0
4 1 0 0 0 1 0 1 1 1
5 1 0 1 1
6 1 1 0 1
7 1 1 1 1 X = AC + AB + BC
A B C
Design of combinational digital circuits
• Example: Design a 4-input (A,B,C,D) digital circuit that will give at its output (X) a
logic 1 only if the binary number formed at the input is between 2 and 9 (including).
Inputs Output
A B C D X X = (2,3,4,5,6 ,7,8,9)
0 0 0 0 0 0
1 0 0 0 1 0 X
2 0 0 1 0 1 CD
3 0 0 1 1 1 AB 00 01 11 10
4 0 1 0 0 1 00 0 0 1 1 Same
5 0 1 0 1 1
01 1 1 1 1
6 0 1 1 0 1
7 0 1 1 1 1 11 0 0 0 0
8 1 0 0 0 1 10 1 1 0 0
9 1 0 0 1 1
10 1 0 1 0 0
11 1 0 1 1 0
12 1 1 0 0 0 X = AC + AB + A B C
13 1 1 0 1 0
14 1 1 1 0 0
15 1 1 1 1 0 A B C D X
Quine-McCluskey Method
• K-Map limitation is that it can be used only till 6-variables.
• Note, for 5-variable itself (refer below figure), the process is little complicated and
require careful observation while pairing the minterms.
Quine-McCluskey Method
• Tabular method is standardly preferred for reducing the Boolean equation having
more than 6 variables (Indeed, anything more than 5, Tabular method is preferred)
• Standard Tabular method was improved by Quine and McCluskey to reduce the
total steps involved
• Due to time constraints, we will directly jump into Quine-McCluskey Method.
Quine-McCluskey Method
The Tabular Method:
1. Grouping: Use the number of "1"s in the minterm to group the minterms.
Preserve groups derived from this grouping in adjacent columns.
3. New List: Constructs a new list with terms of one fewer variables, keeping
track of which minterms were covered. This step also should happen
in group-wise manner.
Ex: Terms formed by comparing group-0 and group-1 should be kept as
one new group in the new list formed.
Quine-McCluskey Method
The Tabular Method:
4. Comparison: Compares every element in a group in the new list with all the elements
in the adjacent group of the new list. Find terms that differ in one more
variable. This step also should happen in group-wise manner.
• Prime Implicants: 1. All the minterms (Step-1) or minterm combinations (Step-3) which are unticked
and the minterms combinations in the last step (Step-5) are the prime implicants.
• Recall that, the minimized Boolean equation should contain only Essential Prime Implicants (EPIs).
• So, we need to identify the EPIs. A sample table used for identifying the EPIs from PIs is shown below.
• Note, once the procedure for identifying the EPIs from PIs is completed, you are advised to draw a K-
Map for minimizing the Boolean expression (Note, this step is not part of Q-M and this will enhance the
understanding of the step). This gives an essential clarity on the final step.
PIs m1 m2 m3 m9 m13
PI-1
PI-2
PI-3
Exercises