Lec 24
Lec 24
Hello friends, welcome to my lecture on Karnaugh maps. In this lecture we shall discuss the
matter of simplifying Boolean functions. Why we simplify Boolean function? Okay, if we
simplify a Boolean function, we can reduce the required number of the gates and so we can
reduce the size of the circuit and thereby reduce the cost also. Say for example, consider this
Boolean function, F 1 =X ' Y ' + X ' YZ + X Y ' Now this is the figure of this Boolean function, you
see this is X , this is X conjugate, sorry this is X , this is X ' , this is Y , this is Y ' and this is Z.
Okay, so then X ' Y ' Z ' , okay, X ' Y ' ,so we have this input X ' , then we have this input Y ' and
then we have this input Z. Okay and X ' Y ' Z ' , to implement X ' Y ' Z ' , we have consider this
AND gate, okay. So when these are 3 inputs X ' Y ' Z ' then to get the output X ' Y ' Z 'we have
used this AND gate. Okay, then X ' YZ , so we have this X ' input then Y and then Z. Okay, so
3 inputs are there, X ' Y and Z and to get the output as X ' YZ we accused again another AND
gate, okay.
So, then the third term is X Y ' so we have this input X okay and this input Y ' okay, so 2 inputs
are here X and Y ' and to get the output X Y ' we use the AND gate. Okay, so in the first AND
gate there are 3 inputs X ' Y ' Z . Okay, in the second AND gate there are 3 inputs again X ' Y and
Z and in the case of third AND gate there are 2 inputs X and Y ' . So, there are 3 AND gates,
first AND gate considers two, 3 inputs, okay, this AND gate has 3 inputs, this AND gate has
3 inputs again and this AND gate has 2 inputs and there are two NOT gates, this is one, okay,
X and Y ,there are two NOT gates.
' '
So, there are two NOT gates, okay, two, 3 input AND gates, there are 3 input AND gates
okay, there are 3 input AND gates here and then to obtain F 1 okay, the output F 1 okay, we
have to use this OR gate okay, so for OR gate there are 3 inputs X ' Y ' Z . Okay, X ' YZ and X Y '
so there are 3 inputs and to get the output F 1 we use this OR gate okay, so there are 3 AND
gates with one has 3 inputs, the one other has 3 inputs again, the third one has 2 inputs and 3
AND gates and one OR gate.
So there are two NOT gates okay, X ' and Y ' , to get X ' Y ' okay and there are 3 AND gates
okay, this, this and this 3 AND gates, two NOT gates this and this okay and there is 1 OR
gate, okay, to get the desired output F 1 =X ' Y ' Z+ X ' YZ + XY ' . Now that is simplify this
Boolean expression. Okay, using the postulates and the theorems that we are earlier studied.
(Refer Slide Time: 4:55)
Okay, but we will have them, so let us simplify this Boolean function using postulates and the
theorems F 1 =X ' Y ' Z+ X ' YZ + XY ' , we can then use this distributive law and we say that
A∗( B+C )= A∗B+ A∗C Okay, so X ' Y ' Z+ X ' YZ + XY ' can be written as X ' Z∗+Y +Y ' by
using this distributive law, so X ' ZY +Y ' + X Y ' , now Y +Y ' =1 okay.
So, we have X ' ∗X ' Z∗1 here. Okay and this is equal to X ' Z because A∗1= A ∀ Aϵ B okay,
this we know for all Aϵ B , A∗1= A , 1 is the unit element, so here X ' Z 1=X ' Z and therefore
we will have X ' Z+ X Y ' making use of Y +Y ' =1. Now, let us see how to get this desired this
output X ' Z+ X Y ' , let us again draw the gates.
(Refer Slide Time: 6:34)
So, here we have this, this is your X, this is X ' okay, the output, so we have one NOT gate
and then for Y we have one NOT gate Y ' , so there are two NOT gates, okay, and since our
output
' '
F 1 =X Z + X Y , how to get is X ' Z ? We take the input X ' , okay, this is input X ' ,and this is
input Z. Okay, so X ' , this is X ' , this is Z, to get X ' Z we used this AND gates, okay, so 1
AND gate we use to get the X ' Z , so there are 2 inputs X ' Z and 1 AND gate to get the output
X Z and then for the other term X Y we use again 2 inputs this is X and this is Y , okay, so
' ' '
two inputs X and Y ' with an AND gate then gives us X Y ' okay.
So, and to get then X ' Z+ X Y ' we use one OR gate okay, so this is one OR gate, so we have
two NOT gates, two AND gates and one OR gate, okay, and we get F 1 =X ' Z + X Y ' . So you
can see now the number of gates that we need are less, okay, in comparison to the previous
case and number of inputs also are less, okay, there we had 3 inputs, okay, if we see this one,
this figure we had two NOT gates okay, we also have two NOT gates there, we have three
AND gates here, while we have one AND gate there, we have two AND gates there.
So, this three AND gates reduced to two AND gates and moreover the inputs like here in this
two AND gates the inputs were three each. Okay, here, three and here also three and there we
see that we have two AND gates with inputs 2 each. So, by using postulates and the theorem
we can simplify given Boolean expression, so that many draw the figure okay, we use less
number of AND or OR gates and NOT gates to get the desired output, so that actually
reduces the cost of the output, to get the desired output, we have to spend much less okay, by
using the theorems and postulates to simplify the given Boolean function.
Now, let us consider methods to simplify the Boolean functions. Okay, one method that we
have just now seen by using postulates and theorems, we can simplify the Boolean functions,
the other method is using Karnaugh map okay, so let us see how we use Karnaugh map to
simplify the given Boolean functions.
(Refer Slide Time: 10:00)
Now, let us say to simplify the Boolean function if you use postulates and theorems okay,
then there are no specific rules. The only way to simplify is that the apply postulates and
basic theorems and some other manipulation methods to arrive at the simplification of the
given Boolean expression, let say for example, let us consider F=X X ' +Y okay, then we can
simplify this, so F is equal to we use distributive law a∗( b+c ) =a∗b+ a∗c okay and this
gives us X X ' + XY . Now, we know that a'∗a=0. Okay, so this is equal to 0+ XY ,okay, and
we know that by identity law A+0= A ∀ Aϵ B okay, so 0+ XY =0So, we see that the
expression F=X X ' + XY can be simplified to F=XY by using the postulates and theorems.
(Refer Slide Time: 11:23)
Now, let consider another example XY + X ' Z +YZ , let consider this Boolean function, we can
write it as XY + X ' Z and then YZ, YZ can be written as X + X ' YZ . Okay, because X + X ' =1
okay, so this YZ can be written as X + X Z' and then this is equal to by distributive law
So, XY + XYZ can be combined and we have XY ∗1+ Z .. Okay, so we have this, now we
know that A+1, A+1= A , A ∀ Aϵ B , so
XY ∗1+ Z , 1+ Z=1 okay, so this will be XY ∗1 okay, this is equal to XY ∗1 and XY ∗1=XY
okay, because we know that A∗1= A , A ∀ Aϵ B .Okay, B, so this gives us XY and similarly
we combine X ' Z and X ' YZ so X ' Z .1+Y we can write, 1+Y =1, okay, so we have
XY + X Z . Okay, so this given expression which consisted of the 3 terms XY, X Z and YZ is
' '
Okay, now let us consider this another Boolean function F=ZX +Y X ' + ZY + Z . Okay, then
what you notice is that if you take the, these 2 terms X ' + Z then X ' + ZY +Z , we can write as
X Y +Z by using a∗( b+c ) =a∗b+ a∗c okay, we can write it as X plus, X + Z . y + z we can
' '
literally write as Z+ X ' Z+Y , okay. So then it is equal to Z+ X ' ∗Y , okay. So, we have or we
can write it as X ' ∗Y + Z . Okay, so X ' Y +Z we have here, okay, so the function F which
consisted of 3, product of 3 terms, now has been reduced to product of 2 okay, X +Y and
'
X ∗Y + Z
Now, let us define a Minterm, a product term in which all the variables appear exactly once.
Okay, either complemented or uncomplemented is called a minterm, okay. So a product term
in which all the variables appear exactly once, okay, either complemented or
uncomplemented is called a minterm. This we define or in the previous lecture also. Okay,
we have defined it again to emphasise it because we are using, going to use it when we
discuss Karnaugh maps, so we have defined it earlier. Again here, a minterm represents
exactly one combination of the binary variables in a truth table. Okay, it has the value 1 for
that combination and 0 for the others and we shall see while discussing Karnaugh maps.
(Refer Slide Time: 15:52)
So, the Karnaugh map method is a graphical technique, it is a graphical technique which
provides a simple procedure for simplification of Boolean expressions and it can be applied
to six or fewer variables beyond that it is not easy to handle this situation, so Karnaugh maps
can be used to Boolean expressions containing up to six variables, Karnaugh map it is a
diagram made up of a number of squares, okay.
If the expression contains N variables, the map will have N squares, 2 to the power N
squares, each square represents a minterm, okay, and 1s are written in the corresponding
squares for the minterms present in the expression and 0s are written in those squares which
correspond to the minterms not present in the expression okay, so those minterms which are
present in the expression, in the corresponding boxes.
Okay, we shall right 1 and the minterm which are not present in the expression in those
boxes, we shall in those squares, we shall put 0. Okay, now once the map is filled with 0s and
1s the canonical sum of products expression. Okay, for the output is obtained by grouping
together those squares that contain 1, okay, so we shall then group those squares that contain
1 to get the desired output.
(Refer Slide Time: 17:28)
Now, let us consider two variable case for Karnaugh maps. So, if you consider a Boolean
expression having with two variables then the number of, since the number of variables are
two, the map will have, Karnaugh map we have 2 the power 2 that is 4 squares. The values of
one variable okay, the values of one variable say A, are listed above the top horizontal line
like here okay, the values of A are listed above the top horizontal line, this is top horizontal
line. Okay, and the values of the other variables say B are listed on the left side.
So here they are listed, the 2 values of B, B and B 'okay, four possible minterms okay, with
variables A and B, what are the minterms? There are 4 minterms, AB, A B ' , A ' B , A ' B ' okay,
so those 4 minterms are than represented by four squares, so you can see A ' , B ' okay, this is
A B , then A B , this is A B and then A B okay, this is A B and then AB, this is AB.
' ' ' ' ' '
Now if you use the value of A=1 then value of A dash will be 0, value of B if you take as 1
value of B 'will be 0, so we can use the alternate Karnaugh map, this one also to find the
desired output, here instead of A and B and A ' , B ' we use their values. Okay, so A has value
1, A ' has value 0, B has value 1, B ' has value 0. Okay, then 0, 0, this is A ' , B ' okay, A ' has
value 0, B ' has value 0, so A ' , B ' 0, 0 means A ' , B ' 1, 0, 1 0 means A B ' okay and then 0, 1
means, 0,1 means A ' B , 1, 1 means AB okay, so this also can be use.
(Refer Slide Time: 19:26)
Now, let us define adjacent squares, which squares are called adjacent, okay, so squares are
said to be adjacent if the minterms that they represent define in exactly one literal. Okay, two
squares will be called adjacent, if the minterms that they represent. Okay, differ in exactly
one literal. For instance, the squares representing A ' B okay, you can see here A ' B okay,
representing A ' B it is adjacent to this one AB because A B ' differs with AB only in one
literal, okay, and here A ' , B ' and A ' B differs with A ' B ' only in one literal that is B okay. So
this square A ' B this square is called adjacent to the square representing AB and the square
representing A ' B ' , okay, so we can easily see which square is adjacent to which one using the
definition of the adjacent squares, okay.
(Refer Slide Time: 20:38)
Now, let us go to how to simplify the Boolean expression using Karnaugh maps, so the
expression can be simplified by properly combining those squares in the K-map which
contain 1’s. Okay, the process for combining, how will we combine? The process of
combining 1’s is called looping okay, wherever there are 1’s in two adjacent squares in the
K-map, the minterms represented by these squares can be looped and it eliminates the
variable that appear in complemented and uncomplemented form.
For example, find Karnaugh maps and simplify this expression, A B ' + A ' B ' okay, so let us see
okay, if we have used this one. So A B ' and A ' B ' okay, we have this. Okay, so this is A ' ,
okay, this is A dash, this one is A, this one is B dash, this one is B, and so therefore, A dash B
dash, this is A ' B ' . No, we have A ' B ' okay, A B 'means A will have value 0, B ' will have value,
this is A B ' okay, this is A B ' okay and this is A ' B ' , okay and this one is A ' B , this one is AB.
Now, what is our first part A B ' + A ' B ' . A B ' + A ' B ' okay. Now, these two squares representing
A B and A B are adjacent because they differ only in one variable, that is B okay, that is A
' ' '
okay, so here we have A, here we have A ' and B ' is same, so they differ only in one variable
that is A and therefore, they both have value 1, so we combine them, be it consider loop, this
loop okay and then, ( AB)' + A ' B ' will be equal to, now see, this A appears, this square it
appears in the uncomplemented form, here it appears in the complemented form.
So, will consider A B ' + A ' B ' =B ' okay by using this Karnaugh method. Karnaugh method
says that eliminate the variable that appear in complemented in uncomplemented form after
you have taken the loop okay. So here we are considered the loop okay and then we eliminate
the variable, which appears in the complemented and uncomplemented form, so
So, A B ' + A ' B ' =B ' , if we use the postulates and theorems, we can write it as A+ A ' B ' if we
use the distributive formula, A∗( B+C )= A∗B+ A∗C. Okay, if we use this formula and the
commutative with formula of commutative law also. Okay, because we have here the
situation, by using commutative law we can write it as B+C∗A , B+C∗A=B∗A+C∗A ,
okay.
So using this formula A B ' + A ' B ' can be written as A+ A ' B ' and A+ A ' , A+ A' =1 , we know
okay, so 1. B ' and we know that A∗1= A , ∀ A ∈ B , so B '∗1=B ' okay, so by using postulate
theorems A B ' + A ' B ' turns out to be B ' and by using Karnaugh map also A B ' + A ' B ' comes out
to be B ' .
So, A ' B+ A ' B ' that will be equal to A ' okay. Now let us consider this square, this square
represents A ' B ' and this represents A B ' then here are we see that B ' is same in the two
minterms that they are representing, A is occurring here in the uncomplemented form, here it
is occurring in the complemented form. So A ' B ' , we have considered this loop,
' ' ' ' ' '
A B + A B , A B +A B
when you find it will give you B ' because A occurs in the complemented and
uncomplemented form.
So, A B ' + A ' B+ A ' B ' is then the sum of this B ' okay, which is the result of looping, this
looping, it gives us B ' okay and at the result of this looping, as the result of this looping we
get A ' , so we get the output as B ' + A ' or we can say A ' + B' in the third part.
(Refer Slide Time: 29:20)
Now, let us draw Karnaugh map for AB+ A B ' + A ' B ' , so we have seen that this is A ' okay,
this let us say is A, this is B ' this is B okay, so the value here is 0, here the value is 1, here the
value is 0, here the value is 1 okay, then A ' B ' , this box, this square represents the minterm
A B , this represents the minterm A B and it represents the minterm A B and this square
' ' ' '
represents the minterm ABB, AB okay, now we see A ' B ' AB+ A B ' .
Let, us look at this square and this square okay, the two squares are adjacent because they
differ in just one literal that is B okay, so this square and this square are adjacent and this is 1,
1, this is 1 okay, so we considered this loop because we give the value 1 to the minterm that
is occurring here in the given Boolean expression, so A B ' is occurring here, AB is occurring
here, so there squares will be represented by the 1, they will have value 1 and then we have
A B , so this is A B , okay, this has a value 1 and then A B and A B , this square which
' ' ' ' ' ' '
represents A ' B ' and this square which represents A B ' they are also adjacent because they
differ in one literal that is A okay.
So we loop 1 here, 1 here. Okay. Now, because of this looping okay, if you consider this loop
first, this loop first, then as the result of this looping the value will be B ' because A and A ' are
occuring here, so A is occurring in the complemented form, as well as uncomplemented
form, so as a result of this looping A ' B ' + A B ' =B ' okay A ' B ' + A B ' =B ', and as a result of this
looping okay, as a result of this looping B is occurring in the complemented and
uncomplemented form, so the result will be A okay, so A ' B ' + A B' + AB will be equal to B ' + A
okay or you can say A+ B ' so this is how we can use Karnaugh map to simplify this
expression, this can be obtained, this output well can be obtained by using postulates also, a
postulate and theorem, what we can do is.
Okay, now let us get this output A+ B ' by using postulates and theorems, so AB+ A B ' + A ' B ' I
can also write as AB+ A B ' + A B ' + A ' B ' because
A+ A= A , ∀ A ∈ B okay. Now what we can do? We can combine this and this. Okay, so
AB+ A B we can combine and we can combine A B + A B , then this equal to, now using
' ' ' '
distributive law this is A∗( B+ B ' ) , A∗(B+ B ' ) and here we get A+ A '∗B ' =1 , so A .1+1. B ' and
this is equal to A+ B ' , so that is how we can arrive at the output given by the Karnaugh map,
that is all in this lecture. Thank you very much for your attention.