You are on page 1of 58

Digital Electronics and

Microprocessors
Chapter 2: Boolean Functions (Canonical)
Chapter 3: Gate Level Minimization

Srevats Laxman
srevats@gmail.com

Srevats Laxman 1
Boolean Functions
 Described by an Algebraic expression
 Binary variables
 Constants 0 and 1
 Logic Operations

 Example: F(x,y,z) = x’ + yz

 Truth Table and Gate Implementation

Srevats Laxman 2
Boolean Functions
 Complements of a Function
 De-Morgan’s Rule
 More than 2 variables

 Example:
 F1 = x (y’z’ + yz) => F1’ = x’ + (y+z)(y’+z’)
 F1 = x’yz’ + x’y’z => F2’ = (x+y’+z)(x+y+z’)

 Another procedure
 Dual of the function
 Complement each literal

Srevats Laxman 3
Complements

 F (w,x,y,z) = x.y.z +w’.x’


 F’
 Dual (x+y+z) . (w’+x’)
 F’ (x’+y’+z’). (w+x)

 F(A,B,C,D) = AB’ + BCD’ + ABCD


 What is F’? (A’+B). (B’+C’+D). (A’+B’+C’+D’)

Srevats Laxman 4
Min-terms and Max-terms
X Y Z F Min terms Max terms
0 0 0 0 X’.Y’.Z’ X+Y+Z
0 0 1 0 X’.Y’.Z X+Y+Z’
0 1 0 1 X’YZ’ X+Y’+Z
0 1 1 1 X’YZ X+Y’+Z’
1 0 0 1 XY’Z’ X’+Y+Z
1 0 1 0 XY’Z X’+Y+Z’
1 1 0 0 XYZ’ X’+Y’+Z
1 1 1 0 XYZ X’+Y’+Z’

F (X,Y,Z) = X’.Y.Z’ + X’.Y.Z + X.Y’.Z’ = ( 2,3,4) = (0,1,5,6,7)


F’(X,Y,Z) = (X+Y’+Z). (X+Y’+Z’). (X’+Y+Z)
F’(X,Y,Z) = ( 0,1,5,6,7) ===> F = (0,1,5,6,7)

Srevats Laxman 5
Canonical and Standard Form
 We start with the Truth Table
 What is a Min term / standard product? (mj)
 What is a Max term / standard sum? (Mj)

 Boolean function as Sum of Min-terms 


 As Product of Max-terms 
 Examples

 Note: One can obtain Product of Max terms (using De-


Morgan’s complement) from sum of min terms of F’

Srevats Laxman 6
Canonical Forms and Standard
Forms
 Conversion between Canonical Forms

 mj’ = Mj Example (Conversion)

 Standard Forms to Canonical Form


 xy + xy’z = xyz’+ xyz + xy’z = (5,6,7)= (0,1,2,3,4)

 Implementation with gates

Srevats Laxman 7
Standard to Canonical Conversion

 F(ABCD) = AB’ + BCD’ + ABCD


10xx 8, 9, 10, 11
x110 6, 14
1111 15
F(ABCD) = Sum (6,8,9,10,11,14,15)

 F(WXYZ) = WX’ + WYZ = SUM( ?)


 Gate level implementation

Srevats Laxman 8
Boolean Functions - Simplification

 Simplify the boolean functions to minimum number of literals


 x. (x’+y) = xy
 x+x’y = x+y
 (x+y) (x+y’) =x
 xy+x’z+yz = xy + x’z
 (x+y).(x’+z).(y+z) = (x+y).(x’+z)

Srevats Laxman 9
Problems to solve
 Find the complement of
 F (a,b,c) = ab’ + bc’ + ac
 F(w,x,y,z) = wxy + wz’ + xy’ +xz

 Convert the following standard form representation to Canonical


Form and draw the truth table for the function
 F (a,b,c) = ac’ + bc + ab
 F(w,x,y,z) = xyz’ + wz’ + xy’ +x’z

 Simplify the following expression based on the theorems and


postulates you know
 abc +abc’ + ab’
 xy +yz +yz’

Srevats Laxman 10
Gate Level Minimization
 Gate Level Minimization. What are we trying to do?

 Maps

 Prime Implicants and Essential Prime Implicants

 SOP and POS simplification

 Don’t Care Conditions

 Implementation (2 level)

Srevats Laxman 11
Gate Level Minimization. What are we
trying to do?
 Idea is to obtain a gate level minimized
boolean expression

 Boolean Simplification F= xy+x’z+yz =xy+x’z

 Well… Can there be something simpler?


 Something like a set of pre-defined steps that can
be followed

Srevats Laxman 12
What’s in store for the day?
 Gate Level Minimization. What are we trying to do?

 Maps

 Prime Implicants and Essential Prime Implicants

 SOP and POS simplification

 Don’t Care Conditions

 Implementation (2 level)

Srevats Laxman 13
Maps
 Objective: Build some kind of mapping that will help us do the
simplification

 Let us revisit simplification using Boolean algebra

 Example F=xy + xy’ = x(y+y’) = x.(1) = x


Note a 1 bit change in y

 Is that suggesting a way in which we can develop a mapping?


GRAY CODE

 Based on min terms, we will try and build a map that will allow us to
do a similar mapping

Srevats Laxman 14
K-Map
 Step1:
If it is in standard form convert to
Canonical form (SOP)

 Step2:
Sketch the K-Map and write the gray
coded values which each variable
can take

Srevats Laxman 15
K- Map (2 variables)

Y 0 1
X
0

1
Srevats Laxman 16
K-Map

 Step3:
Write the min terms in the Boolean function
corresponding to each box

 Step4:
Look at the canonical form of the Boolean
expression and place a 1 corresponding to the
min terms in the boolean expression in the
appropriate box.

Srevats Laxman 17
K- Map (2 variables)

Y 0 1
X
0
0 1

1
2 3

Srevats Laxman 18
2- variable K Map
What does each box represent?

Srevats Laxman 19
K- Map (3 variables)

YZ
00 01 11 10
X

1
Srevats Laxman 20
K- Map (3 variables)

YZ
00 01 11 10
X

0
0 1 3 2

1
4 5 7 6

Srevats Laxman 21
3 Variable K Map
What do the boxes represent?

Let us take an example of a Boolean Function.


F(x,y,z)=(1,3,6,7)

Srevats Laxman 22
K- Map (4-variables)

CD 00 01 11 10
AB
00
0 1 3 2

01
4 5 7 6

11
12 13 15 14

10
8 9 11 10

Srevats Laxman 23
K- Map (4-variables)
F=(1,3,5,9,10,11)
CD 00 01 11 10
AB
00 1 1
0 1 3 2

01 1
4 5 7 6

11
12 13 15 14

10 1 1 1
8 9 11 10

Srevats Laxman 24
What’s in store for the day?
 Gate Level Minimization. What are we trying to do?

 Maps

 Groups: Prime Implicants and Essential Prime Implicants

 SOP and POS simplification

 Don’t Care Conditions

 Implementation (2 level)

Srevats Laxman 25
Grouping
 So What next? Step 5: We group them.

 Example F=xy + xy’ (2 variable map);


Adjacent min terms are grouped to form a simplified
term.

 Let us discuss all possible 2-variable groupings

 How do you find out what is the simplified term?


Step 6: Name of the group or Simplified expression of
the group- Drop the variables that have changed and
Retain those that have not changed in their
complemented or un-complemented form
Srevats Laxman 26
Examples of 2 variable mapping and
getting to a simplified Boolean expression

A grouping of 4 would also be


possible? What would be the
expression in that case?
Srevats Laxman 27
Grouping- 3 variables
 Let us move to a 3 variable map

 Example F= (0,1,4,5)

 First attempt a simplified expression using algebra

 Let us try to make groups. We start with highest grouping


possible.

 What happens in this case, when you make a group of 4?


Dependency of 2 variables reduced

 Name the group(s) and get to the simplified expression

Srevats Laxman 28
Grouping in K-Map
 Example:
 F(x,y,z) = Σ(2,3,4,5) = x’yz’+x’yz+xy’z’+xy’z
 Two blocks of size 2:

 Convert groups into expressions


 F = x’y + xy’

Srevats Laxman 29
Groupings of larger size
 Example:
F(A,B,C) = Σ(1,2,3,5,7)

 C+A’B

 Blocks can overlap


 Still find the largest pos

sible power-2 blocks

Srevats Laxman 30
4 variable mapping
 One square represents a minterm of 4 literals.

 A rectangle of 2 adjacent squares represents a product term of 3


literals.

 A rectangle of 4 squares represents a product term of 2 literals.

 A rectangle of 8 squares represents a product term of 1 literal.

 A rectangle of 16 squares produces a function that is equal to


logic 1.

Srevats Laxman 31
Grouping – Prime and Essentially Prime
Implicants
 Step 7: Classify the groupings of min terms into Prime and Essentially
Prime Implicants; Obtain the final expression

 Prime implicant
 Product term that cannot be further reduced

 Block of 1’s that cannot be further increased

 Essential prime implicant


 Prime implicant that covers a 1 (minterm) that is not covered by any

other prime implicant

 Essential Prime Implicants: If a min term can be grouped only by one


prime implicant and not by any another prime implicant then that prime
implicant becomes essential

Srevats Laxman 32
Example
 Simplify the following Boolean function
(A,B,C,D) = ∑m(0,1,2,4,5,7,8,9,10,12,13).
cd
ab 00 01 11 10

00 1 1 1 1 1 1

01 1 1 1 1 1 1

11 1 1 1 1

10 1 1 1 1 1 1

g(A,B,C,D) = c’+b’d’+a’bd
All 3 are EPI (no more PI)
Srevats Laxman 33
Another Example
 Example 1:
 F(w,x,y,z)= Σ(0,1,2,4,5,6,8,9,12,13,14)
 ANS: y’+w’z’+xz’

 Example 2:
 F(A,B,C,D)= A’B’C’+B’CD’+A’BCD’+AB’C’
 ANS: B’C’+B’D’+A’CD’

Srevats Laxman 34
Example
 f(a,b,c,d) =
∑m(0,1,2,3,4,5,7,14,15).
cd
ab
 Five grouped terms, not all 1 1 1 1
needed. (Prime Implicants)
1 1 1
 3 shaded cells covered by
only one term 1 1

 3 EPIs, since each shaded


cell is covered by a different
term.

 F(a,b,c,d) = a’b’ + a’c’ + a’d +


abc

Srevats Laxman 35
Example
 F(A,B,C,D)= Σ(0, 2,3,5,7,8,9,10,11,13,15)

 P.I BD, B’D’, CD, AD, AB’, B’C


 EPI BD, B’D’

 F(A,B,C,D) = BD+B’D’+CD+AD
= BD+B’D’+CD+AB’
= BD+B’D’+B’C+AD
= BD+B’D’+B’C+AB’

 What is the Karnaugh map for F(x,y,z) = Σ(3,4,6,7) ?

Srevats Laxman 36
What’s in store for the day?
 Gate Level Minimization. What are we trying to do?

 Maps

 Prime Implicants and Essential Prime Implicants

 SOP and POS simplification

 Don’t Care Conditions

 Implementation (2 level)

Srevats Laxman 37
SOP and POS Simplification
 We have obtained a SOP expression (minimized)

 Can we get a minimized POS expression?

 But we have built the K-map that can have only min
terms

 So what is the solution? Consider the complements

Srevats Laxman 38
POS minimization
 How to generate a product of su
ms from a Karnaugh map?
 Use duality of Boolean algebra (
DeMorgan law)

 Look at 0s in map instead of 1s


 Generate blocks around 0’s
 Gives inverse of function
 Use duality to generate product o
f sums

 Example:
 F = Σ(0,1,2,5,8,9,10)
 F’ = AB+ CD + BD’
 F = (A’+B’)(C’+D’)(B’+D)

Srevats Laxman 39
What’s in store for the day?
 Gate Level Minimization. What are we trying to do?

 Maps

 Prime Implicants and Essential Prime Implicants

 SOP and POS simplification

 Don’t Care Conditions

 Implementation (2 level)

Srevats Laxman 40
Don’t care Conditions
 There may be a combination of input values which
 will never occur

 if they do occur, the output is of no concern.

 The function value for such combinations is called a


don't care.

 They are usually denoted with x. Each x may be


arbitrarily assigned the value 0 or 1 in an
implementation.

 Don’t cares can be used to further simplify a function

Srevats Laxman 41
Minimization using Don’t Cares
 Treat don't cares as if they are 1s to generate
PIs.

 Groupings that cover only don't care


minterms shall not be includes as PIs

 Treat the covering of remaining don't care


minterms as optional in the selection process
(i.e. they may be, but need not be, covered).

Srevats Laxman 42
Minimization example
 F(w,x,y,z) = Σ(1,3,7,11,15) and d(w,x,y,z) = Σ(0,2,5)

 What are possible solutions?

Srevats Laxman 43
Example cd
ab 00 01 11 10
 Simplify the function f(a,b,c,d)
00 0 1 0 1
whose K-map is shown at the right.
01 1 1 0 1
11 0 0 x x
 f = a’c’d+ab’+cd’+a’bc’
10 1 1 x x
or
 f = a’c’d+ab’+cd’+a’bd’ 0 1 0 1
1 1 0 1
 The middle two terms are EPIs, while the 0 0 x x
first and last terms are selected to
1 1 x x
cover the minterms m1, m4, and m5.

0 1 0 1
 (There’s a third solution!) 1 1 0 1
0 0 x x
Srevats Laxman 1 1 x x 44
Another Example cd
ab
x 1 0 0
1 x 0 x
 Simplify the function
1 x x 1
g(a,b,c,d) whose K-map
0 x x 0
is shown at right.
x 1 0 0
1 x 0 x
 g = a’c’+ ab 1 x x 1
or 0 x x 0
 g = a’c’+b’d x 1 0 0
1 x 0 x
1 x x 1
0 x x 0 45
Srevats Laxman
What’s in store for the day?
 Gate Level Minimization. What are we trying to do?

 Maps

 Prime Implicants and Essential Prime Implicants

 SOP and POS simplification

 Don’t Care Conditions

 Implementation (2 level)

Srevats Laxman 46
Implementation (2- level
implementation)
 SOP AND-OR

 POS OR-AND

 AND- OR can also be made into a NAND-NAND


implementation

 OR-AND can also be made into a NOR-NOR


implementation

 Others AND-NOR, OR-NAND and so on

Srevats Laxman 47
Gate Implementation

AND-OR OR - AND

for simplified for simplified

SOP expression POS expression

Srevats Laxman 48
Using Universal Gates

 NAND and NOR gates are easier to fabricate


with components

 Two illustrations for NAND gates


 AND-invert
 Invert-OR

Srevats Laxman 49
Conversion to NAND Implementation

 Sum of minterms

 Replace AND with AND-i


nvert and OR with invert-
OR

 Replace AND-invert and i


nvert-OR with NAND
 F=((AB)’(CD)’
= AB+CD

Srevats Laxman 50
NAND Example

 Function F = Σ(1,2,3,4,
5,7)
 Karnaugh map:
 Implementation:

Srevats Laxman 51
Using NOR gates

 Two representations of NOR:


 OR-invert and invert-AND

Srevats Laxman 52
Other 2 level implementations

 OR-NAND
 AND-NOR

 NOR-OR
 NAND-AND

 How do you implement a Boolean function in


any of these implementations?

Srevats Laxman 53
Re-cap
So let us try and answer some questions!
 What are we trying to do in a K-Map?

 What do we do when we group 2-adjacent minterms?

 Why use Gray Code in K-Maps?

 What do we do when we group 4 minterms?

 How do we fill the relevant min terms in a K-Map?

 How do we group min terms?

Srevats Laxman 54
Re-cap
So let us try and answer some questions!
 How do you find the simplified product term of
the group?

 What happens to a min term that cannot be


grouped?

 What are prime and Essential prime implicants?

 How do we write the final minimized expression?

 Implementation and Don’t care conditions


Srevats Laxman 55
STEPS TO BE FOLLOWED
 Obtain the sum of min term expression of the Boolean function. Canonical

 Identify the number of variables involved

 Fill the K-Map. Account for Don’t care conditions

 Start looking out for grouping starting from the biggest level

 After every stage of grouping is exhausted check if there are min terms to be grouped

 Only in that case move to a lower level of grouping

 If all min terms are exhausted list down the E.P.I and P.I

 Write the simplified expression

 Perform the 2-level implementation

Srevats Laxman 56
Extra Problems

1. A 4 bit number (w,x,y,z) representing a valid BCD


number is given as input to a logic circuit. If the
equivalent decimal value is a prime number then the
output of the logic circuit should be 1 else it should be 0.
Derive the minimum expression of the logic circuit in
SOP form and realize it with NAND gates.

2. Identify the prime and essential prime implicants in the


sum of min terms expression given F(A,B,C,D)=
(0,2,4,5,7,8,10,12,13,15). Find the final minimized
expression and implement the result in NAND NAND
implementation and also in NAND-AND implementation.
Srevats Laxman 57
Extra Problems

3. For the expression given below give the


minimized expression in POS form. F(A,B,C,)=
(1,2,4,7). Implement using NOR-NOR
implementation. What about NOR- OR?

4. For the expression given below, give the


minimized expression in SOP form F(w,x,y,z)=
(1,3,4,6,9,11,12,14) DontCare(w,x,y,z)=
(0,2,8,10). And implement the same using
AND-OR implementation.
Srevats Laxman 58

You might also like