0% found this document useful (0 votes)
41 views

K-Map For Minimization

explaination of kmap procedure and details to solve the equations

Uploaded by

Ankur Saharia
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

K-Map For Minimization

explaination of kmap procedure and details to solve the equations

Uploaded by

Ankur Saharia
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 81

B.

TECH FIRST
YEAR
ACADEMIC YEAR: 2023-2024

COURSE NAME: EES


COURSE CODE : EE1002
LECTURE SERIES NO : 01(ONE)
CREDITS : 3
MODE OF DELIVERY : ONLINE (POWER POINT PRESENTATION)
FACULTY :
EMAIL-ID :
PROPOSED DATE OF DELIVERY:
“A SYSTEMATIC WAY
SESSION OUTCOME TO MINIMIZE THE
GIVEN LOGIC ”
ASSIGNMENT
QUIZ ASSESSMENT
MID TERM EXAMINATION –II
END TERM EXAMINATION
CRITERIA’S
PROGRAM
OUTCOMES
MAPPING WITH
CO4

[PO1]

DEMONSTRATE DIFFERENT NUMBER SYSTEMS,


BOOLEAN EXPRESSIONS AND DIFFERENT
ELEMENTS OF COMMUNICATION SYSTEMS AND
TO PROMOTE DIFFERENT SKILLS TOWARDS
ELECTRONICS INDUSTRIES.
KARNAUGH MAP
The Karnaugh map, also known as the K-map, is a method to simplify Boolean algebra expressions.

The Karnaugh map reduces the need for extensive calculations by taking advantage of humans'
pattern-recognition capability.

Karnaugh Map: A graphical technique for simplifying a Boolean expression into either form:
 minimal sum of products (MSP)
 minimal product of sums (MPS)

Goal of the simplification.


 There are a minimal number of product/sum terms
 Each term has a minimal number of literals

These terms can be used to write a minimal Boolean expression representing the
required logic.
KARNAUGH MAPS - RULES OF
SIMPLIFICATION
THE KARNAUGH MAP USES THE FOLLOWING RULES FOR THE SIMPLIFICATION OF EXPRESSIONS BY GROUPING
TOGETHER ADJACENT CELLS CONTAINING ONES.

1.Groups may not include any cell containing a zero.

2.Groups may be horizontal or vertical, but not


diagonal.
3. GROUPS MUST CONTAIN 1, 2, 4, 8 CELLS OR IN GENERAL 2N CELLS. THAT IS IF N = 1, A
GROUP WILL CONTAIN TWO 1'S SINCE 21 = 2. IF N = 2, A GROUP WILL CONTAIN FOUR 1'S
SINCE 22 = 4.
4. EACH GROUP SHOULD BE AS LARGE AS POSSIBLE.

5.Each cell containing a one must be in at least one group.


6.GROUPS MAY OVERLAP.
7.Groups may wrap around the table.
The leftmost cell in a row may be grouped with the rightmost cell and the top cell in a column may be
grouped with the bottom cell.
8. THERE SHOULD BE AS FEW GROUPS AS POSSIBLE, AS LONG AS THIS DOES NOT
CONTRADICT ANY OF THE PREVIOUS RULES.
SUMMMARY:

• No zeros allowed.
• No diagonals.
• Only power of 2 number of cells in each group.
• Groups should be as large as possible.
• Every one must be in at least one group.
• Overlapping allowed.
• Wrap around allowed.
• Fewest number of groups possible.
EXAMPLES
TWO-VARIABLE K-MAP
a
b 0 1
0

1
KARNAUGH MAPS
• Karnaugh maps, or K-maps, are often used to simplify logic problems with 2, 3
or 4 variables.

Cell = 2n ,where n is a number of variables

For the case of 2 variables, we form a map consisting of 22=4 cells


as shown in Figure
A A A
0 1 0 1 0 1
B B B
00 10
0 AB AB 0 0 2 0 AB AB
01 11
1 AB AB 1
1 3
1 AB AB
Maxterm Minterm
EXAMPLE
2-variable Karnaugh maps are trivial but can be used to introduce
the methods you need to learn. The map for a 2-input OR gate
looks like this:
A
0 1
B
A
Y 0 1
B A
1 1 1
A B Y
0 0 0
0 1 1
B
1 0 1
A+B
1 1 1
EXAMPLE 1: Consider the following map. The function plotted is: Z = f(A,B) = AB’ + AB

Note that values of the input variables form the


rows and columns.
That is the logic values of the variables A and B
(with one denoting true form and zero denoting
false form) form the head of the rows and
columns respectively.

The map displayed is a one dimensional type which can be used to simplify
an expression in two variables.

There is a two-dimensional map that can be used for up to four variables,


and a three-dimensional map for up to six variables.
REFERRING TO THE MAP ABOVE, THE TWO ADJACENT 1'S ARE GROUPED
TOGETHER.

Through inspection it can be seen that variable B has its true and false
form within the group.

This eliminates variable B leaving only variable A which only has its true
form.

The minimized answer therefore is Z = A.


KARNAUGH MAPS
• 3 variables Karnaugh map

Cell = 23=8

AB
C 00 01 11 10
0 2 6 4
0 ABC ABC ABC ABC
1 3 7 5
1 ABC ABC ABC ABC
THREE-VARIABLE K-MAP

ab
c 00 01 11 10

0 m0 m2 m6 m4

1 m1 m3 m7 m5
THREE-VARIABLE K-MAP

ab
c 00 01 11 10

Edges are adjacent


TERMINOLOGY

• Implicant
• Product term that could be used to cover minterms of
a function
• Prime Implicant
• An implicant that is not part of another implicant
• Essential Prime Implicant
• An implicant that covers at least one minterm that is
not contained in another prime implicant
GUIDELINES FOR SIMPLIFYING
FUNCTIONS

• Group as many squares as possible. This eliminates the most


variables.
• Make as few groups as possible. Each group represents
a separate product term.
• You must cover each minterm at least once. However, it
may be covered more than once.
EXAMPLE
AC
A B C Y
0 0 0 1 AB
C 00 01 11 10
0 0 1 1
0 1 0 0 0 1 1 1
0 1 1 0
1 0 0 1 1 1 1
1 0 1 1
1 1 0 1
1 1 1 0 B
B  AC
Three-Variable K-Map Example
Plot 1’s (minterms) of switching function

ab
c 00 01 11 10

0 1

1 1 1 1

Fa , b , 
c m 1 ,3 ,
Three-Variable K-Map Example
Plot 1’s (minterms) of switching function

ab
c 00 01 11 10
0 ab
bc 1

1 1 1 1

F a , b , c 
 ab
THREE-VARIABLE K-MAPS
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 EXAMPLES

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 1 1 1 1 1
FOUR VARIABLE
EXAMPLES
FOUR-VARIABLE K-MAP

ab
cd 00 01 11 10

00 m0 m4 m8
m12
01 m1 m5 m m9
13
11
m3 m7
m15 m11
10
m2 m6
m14 m10
FOUR-VARIABLE K-MAP
ab
cd 00 01 11 10

00

Edges are adjacent


01

11

10

Edges are adjacent


Exam
ple
• Use a K-Map to simplify the following Boolean expression

aF, b , c, d  m 0 ,2 ,3 ,6 ,8 ,1

2 ,1 3 , 1 5 
Four-variable K-
Map
cd 00 01 11 10
ab
00
1 1 1
01
1
11
1 1
10
1 1

F   m  0 ,2 ,3 ,6
Four-variable K-
Map
cd 00 01 11 10
ab
00
1 1 1
01
1
11
1 1
10
1 1

F a b d a b c  ac
FOUR-VARIABLE
K-MAPS
CD CD CD CD
00 01 11 10 00 01 11 10 00 01 11 10 00 01 11 10
AB AB AB AB
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   (5,13)  B C  D f   (13,15)  A  B D f   (4,6)  A  B D


f   (0,8)  B  C 
D
CD CD CD CD
00 01 11 10 00 01 11 10 00 01 11 10 00 01 11 10
AB AB AB AB
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
00 01 11 10 00 01 11 10 00 01 11 10 00 01 11 10
AB AB AB AB
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, f  (1, 2, 4,


f   (4,5, 6, 7)  A  f  (3, 7,11,15)  C
9,10,12,15) 7,8,11,13,14)
B D
f ABCD f ABCD
CD CD CD CD
00 01 11 10 00 01 11 10 00 01 11 10 00 01 11 10
AB AB AB AB
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, f f   (4,5,6,7,12,13,14,15) f   (0,1,2,3,8,9,10,11)


9,11,13,15) (0,2,4,6,8,10,12,14) fB fB
fD fD
FOUR-VARIABLE K-MAPS
EXAMPLES

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
Exam
ple
• Use a K-Map to simplify the following Boolean expression

Fa , b , 
c m 2 ,3 ,6

 ,7 
Three-Variable K-Map
Example
Step 1: Plot the K-
c 00 01
map 11 10
ab
0 1 1

1 1 1

Fa , b , 
c m 2 ,4 ,5
Three-Variable K-Map Example
Step 2: Circle Prime Implicants
ab
c 00 01 11 10
Wrong!!
We really
0 1 1 should draw
A circle
around
all four 1’s
1 1 1

Fa , b , 
c m 2 ,3 ,6
Three-Variable K-Map Example
Step 3: Identify Essential Prime Implicants

ab EPI EPI
c 00 01 11 10
Wrong!!
We really
0 1 1 should draw
A circle
around
all four 1’s
1 1 1

Fa , b , 
c m 2 ,3 ,6
Three-Variable K-Map Example
Step 4: Select Remaining Prime Implicants to
complete the cover.
ab EPI EPI
c 00 01 11 10

0 1 1

1 1 1

Fa , b , 
c m 2 ,3 ,6
Three-Variable K-Map
Example
Step 5: Read the map.
ab a ab
c 00 01 11 10
b
0 1 1

1 1 1

Fa , b , 
c m 2 ,3 ,6
SOLUT
ION

F  a , b , c  a b
 aSince
b we can still b
simplify the function
this means we did not use the largest
possible groupings.
Three-Variable K-Map Example
Step 3: Identify Essential Prime Implicants

ab EPI
c 00 01 11 10

0 1 1

1 1 1

Fa , b , 
c m 2 ,3 ,6
Three-Variable K-Map
Example
Step 5: Read the map.
ab b
c 00 01 11 10

0 1 1

1 1 1

Fa , b , 
c m 2 ,3 ,6
Soluti
on

F a,b,c


b
SPECIAL
CASES
THREE-VARIABLE K-MAP
EXAMPLE

ab
c 00 01 11 10

0 1 1 1 1

1 1 1 1 1

F a ,b,c
THREE-VARIABLE K-MAP
EXAMPLE

a
cb 00 01 11
10
0 0 0 0 0

1 0 0 0 0

F a ,b,c
THREE-VARIABLE K-MAP
EXAMPLE

ab
c 00 01 11 10

0 1 1

1 1 1

F a,b,c 
Exam
ple
• Use a K-Map to simplify the following Boolean expression

a , b ,c 
F m 1 ,2 ,3 ,

 5,6 
Three-Variable K-Map
Example
Step 1: Plot the K-
c 00 01
map 11 10
ab
0 1 1

1 1 1 1

a , b ,c 
F m 1 ,2 ,3 ,
Three-Variable K-Map Example
Step 2: Circle ALL Prime Implicants
ab
c 00 01 11 10

0 1 1

1 1 1 1

a , b ,c 
F m 1 ,2 ,3 ,
DECODERS, MULTIPLEXERS
AND ADDER/SUBTRACTOR
DECODER

 A n-to-2n decoder takes an n-bit input and produces 2n outputs. The n inputs represent
a binary number that determines which of the 2 n outputs is uniquely true.
 A 2-to-4 decoder operates according to the following truth table.
 The 2-bit input is called S1S0, and the four outputs are Q0-Q3.
 If the input is the binary number i, then output Qi is uniquely true.

S1 S0 Q0 Q1 Q2 Q3
0 0 1 0 0 0
0 1 0 1 0 0
1 0 0 0 1 0
1 1 0 0 0 1

 For instance, if the input S1 S0 = 10 (decimal 2), then output Q2 is true, and Q0, Q1,
Q3 are all false.
 This circuit “decodes” a binary number into a “one-of-four” code.
 Follow the design procedures from last time! We have a truth table,
so we can write equations for each of the four outputs (Q0-Q3),
based on the two inputs (S0-S1).
S1 S0 Q0 Q1 Q2 Q3
0 0 1 0 0 0
0 1 0 1 0 0
1 0 0 0 1 0
1 1 0 0 0 1

 In this case there’s not much to be simplified. Here are the


Q0 = S1’ S0’
equations:
Q1 = S1’ S0
Q2 = S1 S0’
Q3 = S1 S0
A PICTURE OF A 2-TO-4 DECODER

S1 S0 Q0 Q1 Q2 Q3
0 0 1 0 0 0
0 1 0 1 0 0
1 0 0 0 1 0
1 1 0 0 0 1
ENABLE INPUTS
 Many devices have an additional enable input, which is used to
“activate” or “deactivate” the device.
 For a decoder,
 EN=1 activates the decoder, so it behaves as specified earlier. Exactly
one of the outputs will be 1.
 EN=0 “deactivates” the decoder. By convention, that means all of the
decoder’s outputs are 0.
 We can include this additional input in the decoder’s truth table:

EN S1 S0 Q0 Q1 Q2 Q3
0 0 0 0 0 0 0
0 0 1 0 0 0 0
0 1 0 0 0 0 0
0 1 1 0 0 0 0
1 0 0 1 0 0 0
1 0 1 0 1 0 0
1 1 0 0 0 1 0
1 1 1 0 0 0 1
A 3-TO-8 DECODER

 Larger decoders are similar. Here is a 3-to-8 decoder.


 The block symbol is on the right.
 A truth table (without EN) is below.
 Output equations are at the bottom right. Q0 = S2’ S1’ S0’
Q1 = S2’ S1’ S0
 Again, only one output is true for any input
Q2 = S2’ S1 S0’
combination.
Q3 = S2’ S1 S0
S2 S1 S0 Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q4 = S2 S1’ S0’
0 0 0 1 0 0 0 0 0 0 0 Q5 = S2 S1’ S0
0 0 1 0 1 0 0 0 0 0 0
Q6 = S2 S1 S0’
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0 Q7 = S2 S1 S0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
 Do the truth table and equations look familiar?

S1 S0 Q0 Q1 Q2 Q3
0 0 1 0 0 0
0 1 0 1 0 0 Q0 = S1’ S0’
1 0 0 0 1 0 Q1 = S1’ S0
1 1 0 0 0 1 Q2 = S1 S0’
Q3 = S1 S0

 Decoders are sometimes called minterm generators.


 For each of the input combinations, exactly one output is true.
 Each output equation contains all of the input variables.
 These properties hold for all sizes of decoders.
 This means that you can implement arbitrary functions with
decoders. If you have a sum of minterms equation for a function,
you can easily use a decoder (a minterm generator) to implement
that function.
MULTIPLEXERS/DEMULTIPLEXERS
MULTIPLEXERS
 A 2n-to-1 multiplexer sends one of 2n input lines to a single output
line.
 A multiplexer has two sets of inputs:
 2n data input lines

 n select lines, to pick one of the 2n data inputs

 The mux output is a single bit, which is one of the 2n data inputs.
Q = S’ D0 + S D1
 The simplest example is a 2-to-1 mux:

 The select bit S controls which of the data bits D0-D1 is chosen:
 If S=0, then D0 is the output (Q=D0).
 If S=1, then D1 is the output (Q=D1).
MORE TRUTH TABLE ABBREVIATIONS

 Here is a full truth table for this 2-to-1 mux,


based on the equation: S D1 D0 Q
0 0 0 0
Q = S’ D0 + S D1 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 1

Here is another kind of abbreviated truth table.


 Input variables appear in the output column.
 This table implies that when S=0, the output Q=D0, S Q
and when S=1 the output Q=D1. 0 D0
 This is a pretty close match to the equation. 1 D1
A 4-TO-1 MULTIPLEXER

 Here is a block diagram and abbreviated truth table for a 4-to-1


mux.

EN’ S1 S0 Q
0 0 0 D0
0 0 1 D1
0 1 0 D2
0 1 1 D3
1 x x 1

Q = S1’ S0’ D0 + S1’ S0 D1 + S1 S0’ D2 + S1 S0 D3


IMPLEMENTING FUNCTIONS WITH MULTIPLEXERS
 Muxes can be used to implement arbitrary functions.
 One way to implement a function of n variables is to use an n-to-1
mux:
 For each minterm mi of the function, connect 1 to mux data input Di. Each
data input corresponds to one row of the truth table.
 Connect the function’s input variables to the mux select inputs. These are
used to indicate a particular input combination.
 For example, let’s look at f(x,y,z) = m(1,2,6,7).
x y z f
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 1
A MORE EFFICIENT WAY
 We can actually implement f(x,y,z) = m(1,2,6,7)
x y z f
with just a 4-to-1 mux, instead of an 8-to-1.
0 0 0 0
 Step 1: Find the truth table for the function, and 0 0 1 1
0 1 0 1
group the rows into pairs. Within each pair of rows,
0 1 1 0
x and y are the same, so f is a function of z only. 1 0 0 0
 When xy=00, f=z 1 0 1 0
1 1 0 1
 When xy=01, f=z’
1 1 1 1
 When xy=10, f=0
 When xy=11, f=1

 Step 2: Connect the first two input variables of the


truth table (here, x and y) to the select bits S1 S0 of
the 4-to-1 mux.

 Step 3: Connect the equations above for f(z) to the


data inputs D0-D3.
BINARY ADDITION: HALF ADDER

Ai Ai
0 1 0 1
Ai Bi Sum Carry Bi Bi
0 0 0 0 0 0 1 0 0 0
0 1 1 0
1 0 1 0 1 0
1 1 0 1
1 1 0 1

Sum = Ai Bi + Ai Bi Carry = Ai Bi
= Ai + Bi
Ai
Sum
Bi Half-adder Schematic
Carry
 Half Adder:
o The most basic digital arithmetic circuit is the addition of two binary digits.
o A combinational circuit that performs the arithmetic addition of two bits is
called a half-adder.

Half-adder truth table and implementation

S = A`B+AB` = A⊕B C = AB
FULL ADDER
 Full Adder:
o A full-adder is a combinational circuit that performs the arithmetic sum of three
input bits.
Logic Diagram of Full Adder
The full adder can be thought of as two half adders connected
together, with the first half adder passing its carry to the second
half adder.

The Boolean Expression for a full adder is: Sum = (A⊕B) ⊕C in

C-Out = A.B + Cin(A⊕B) = AB+ACin+BCin


HALF & FULL SUBTRACTOR

 Half Subtractor
 Full Subtractor
HALF- SUBTRACTOR FUNCTION TABLE
Input Output
A B Difference Borrow
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
HALF- SUBTRACTOR CIRCUIT
Difference  AB  A B  A  B
Borrow  A' B
FULL-SUBTRACTOR FUNCTION TABLE
Input Output
A B C Difference Borrow
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 1
1 0 0 1 0
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
DIFFERENCE EXPRESSION
D  ABC  ABC  ABC  ABC
D  A( BC  BC )  A( BC  BC )
D  A( B  C )  A( B  C )
BORROW EXPRESSION

Borrow  A' B ' C  A' BC ' A' BC  ABC


Borrow  A' B  A' C  BC
A’B’ A’B AB AB’

C’ 1

C 1 1 1
FULL-SUBTRACTOR CIRCUIT
Borrow  A' B  A' C  BC

-Draw the circuit


FULL-SUBTRACTOR BASED ON
TWO HALF-SUBTRACTORS
Full-Subtractor = Half-Subtractor + Half-Subtractor

You might also like