0% found this document useful (0 votes)
45 views58 pages

DDMP Unit 2 Updated 2024

Uploaded by

subhilogix
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views58 pages

DDMP Unit 2 Updated 2024

Uploaded by

subhilogix
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

Unit-2

BOOLEAN ALGEBRA AND MINIMIZATION


TECHNIQUES

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}.

Now you know why the binary numbering


system is so handy in digital systems.
Boolean Algebra
• The truth table for the Boolean function:

is shown at the right.

• To make evaluation of the Boolean function


easier, the truth table contains extra (shaded)
columns to hold evaluations of subparts of the
function.
Boolean Algebra: Basic Theorems
Simplification Theorems
1. 1. XYXY++XY
XY ==XX
''

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

Just recall your operator precedence in the Arithmetic (BODMAS).


Inversion
( X + Y ) ' = X 'Y ' Prove with the truth
tables…
( XY ) ' = X ' + Y '
( X 1 + X 2 + ... + X n ) = X X ...X
' '
1
'
2
'
n

( X 1 X 2 ...X n ) ' = X 1' + X 2' + ... + X n'

• The complement of the product is the sum of the complements


• The complement of the sum is the product of the complements
Examples
Find the complements of

[( 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 -x1 + (-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

AB, A' B, AB ' , A' B '

• Each of those terms is called a minterm (standard product)


• In general, if there are n variables, there are 2 n minterms
Exercise
• List the minterms for 3 variables
A B C maxterm Designation

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
Maxterms
• Consider variables A and B
• Assume that they are somehow combined with OR operator
• There are 4 possible combinations

A + B, A' + B , A + B' , A' + B '

• Each of those terms is called a maxterm (standard sums)


• In general, if there are n variables, there are 2𝑛 maxterms
Exercise
• List the maxterm for 3 variables
A B C Maxterm Designation

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 '

F = A + BC ' = A( B + B ' )(C + C ' ) + ( A + A' ) BC '


= ABC + ABC ' + AB 'C + AB 'C ' + ABC ' + A' BC '
= ABC + ABC ' + AB 'C + AB 'C ' + A' BC '
= m7 + m6 + m5 + m4 + m2
=  (2,4,5,6,7 )
= (0,1,3)
Sum-of-Products
• All products are the product of single variable only

AB + CD E + AC E
' ' ' '
YES

A+ B +C + D E
' ' YES

( A + B)CD + EF NO
Sum-of-Products

AB ' + CD' E + AC ' E '

One or more AND gates feeding a single OR gate at the output

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 ' )

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

• F = A’B’C + AB’C’ + AB’C + ABC’ + ABC ➔ Canonical SoP form


• F = A + B’C ➔ Standard SoP form

• F = (A+B+C)*(A+B’+C)*(A+B’+C’) ➔ Canonical PoS form


• F = Pi(0, 2, 3)
• F = (A=B’)*(A+C) We can use the K-map for obtaining the Standard PoS form from the
canonical PoS form.
Simplifications of Boolean Equations

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:

Minimize: 1. 𝐹 = 𝐴𝐵𝐶ҧ ത + AB𝐶ҧ +ABC


+ 𝐴𝐵C
2. F = 𝐴ҧ𝐵𝐶+
ത ҧ 𝐶ҧ + 𝐴𝐵𝐶+
𝐴B ҧ ABC
Logic Gates
Exclusive-OR A0 = A
A 1 = A '

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)

• A visual way to simplify logic expressions


• It gives the most simplified form of the expression
• Algebra Method becomes more complicated when the number of variables in the
Boolean equation exceeds 3 (It is sometimes cumbersome for 3-variables as well)

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

• Implicant: It is a product/minterm term in Sum of Products (SOP) or


sum/maxterm term in Product of Sums (POS) of a Boolean function.
• E.g., consider a boolean function, F = AB + ABC + BC. Implicants are AB,
ABC, and BC.
• Prime Implicants: A group of squares or rectangles made up of a bunch of
adjacent minterms which is allowed by the definition of K-Map are called prime
implicants(PI) i.e. all possible groups formed in 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

f =  (0,4) = A C f =  (4,6) = A C f =  (0,2) = A C f =  (0,2,4,6) = C

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

f =  (0,8) = B • C • D f =  (5,13) = B • C • D f =  (13,15) = A • B • D f =  (4,6) = A • B • D

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

f =  (2,3,6,7) = A • C f =  (4,6,12,14 ) = B • D f =  (2,3,10,11 ) = B • C f =  (0,2,8,10) = B • D


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 0 0 0 0 00 0 0 1 0 00 1 0 1 0 00 0 1 0 1
01 1 1 1 1 01 0 0 1 0 01 0 1 0 1 01 1 0 1 0
11 0 0 0 0 11 0 0 1 0 11 1 0 1 0 11 0 1 0 1
10 0 0 0 0 10 0 0 1 0 10 0 1 0 1 10 1 0 1 0

f =  (0, 3,5, 6, 9,10,12,15) f =  (1, 2, 4, 7,8,11,13,14)


f =  (4, 5, 6, 7) = A • B f =  (3, 7,11,15) = C • D
f = A  B C D f = A  B C D

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

f =  (1, 3,5, 7, 9,11,13,15) f =  (0,2,4,6,8,10,12,14) f =  (4,5,6,7,12,13,14,15) f =  (0,1,2,3,8,9,10,11)


f =D f =D f =B f = B
Four-Variable K-Maps
CD CD CD
AB 00 01 11 10 AB 00 01 11 10 AB 00 01 11 10
00 1 1 1 00 1 1 1 00
01 1 1 1 01 1 01 1 1 1
11 1 1 1 11 11 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.

2. Comparison: Each minterm in a group is compared with every other minterm


in the adjacent group to find minterms which differ in exactly
one variable.

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.

5. Repeats Steps 3 and 4 until done.


Q-M on F(x,y,z)= m(2,3,6,7)
Initial Column (a) Column (b) Column(c)
Step 1 Group
One 1 xyz
010 m2 xyz xyz
----------------
Two 1's 011 m3
110 m6
----------------
Three 1's 111 m7

Step 2: Compare terms from adjacent groups.


Group 1 => Group 2
010: (011  01-), (110 -10)
Group 2 => Group 3
011: (111-11)
110: (111  11-)
Q-M on F(x,y,z)= m(2,3,6,7)
Initial Column (a) Column (b) Column(c)
Step 3
Group
One 1 010 m2
xyz xyz
(01-) m2,m3 xyz
---------------- (-10) m2,m6
Two 1's 011 m3 ------------------
110 m6 (-11) m3,m7
---------------- (11-) m6,m7
Three 1's 111 m7

Step 4: Repeat on Column (b)


Group (1-2) => Group (2-3)
(01-): (-11 Ø), (11-  -1-)
(-10): (-11 -1-), (11-Ø)
Q-M on F(x,y,z)= m(2,3,6,7)
Initial Column (a) Column (b) Column(c)
Step 5
Group
One 1 010 m2
xyz (01-) m2,m3
xyz xyz
(-1-)m2,m3,m6,m7
---------------- (-10) m2,m6 (-1-)m2m6,m7
,m3,m6,m7
Two 1's 011 m3 ----------------- m3,m7
110 m6 -(-11) m3,m7
---------------- (11-) m6,m7
Three 111 m7
1's
Note that the resulting terms are duplicates and are unchecked at
termination.
Final Result: F(x,y,z) = y
In general, when no new terms can be generated, the set of all
unchecked terms give the result.
Q-M on F(x,y,z)= m(2,3,6,7)
• The steps mentioned so far helps us in identifying the prime implicants.

• 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.

• This procedure can be well explained with the help of an example.

• 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

• Minimize the following using Q-M Method:


1. F(A, B, C, D) = σ 𝑚 (0, 5, 7, 8, 9, 10, 11, 14, 15)
2. F(A, B, C, D) = σ 𝑚 0, 2, 3, 4, 6, 7, 10, 11, 12, 14, 15
3. F(A, B, C, D) = σ 𝑚 (1, 3, 4, 5, 9, 10, 11)+ σ 𝑑 (6, 8)
K-Map with Don’t cares
f = m(1, 5, 6, 11, 12, 13, 14) + d(4)

f = BC' + BD' + A'C'D + AB'CD


K-Map with Don’t cares
Exercises:

1. F(A, B, C, D) = m(1, 2, 6, 7, 8, 13, 14, 15) + d(0, 3, 5, 12)

2. F(A, B, C, D) = m(0, 1, 2, 3, 4, 5) + d(10, 11, 12, 13, 14, 15)

Note, repeat the above exercises using Q-M method as well.


K-Map with Don’t cares
f = m(1, 5, 6, 11, 12, 13, 14) + d(4)

f = BC' + BD' + A'C'D + AB'CD


Thank You

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy