 In today's lecture we continue our discussions on Boolean functions what we have seen so far that a function from bn to b that is called a Boolean function we have also seen that a Boolean function can be represented by Boolean expressions now by a Boolean expression we mean an expression consisting of Boolean variables and the operations plus dot and complementation of course there are other names of these operations the plus is sometimes called or or disjunction this dot is called and or conjunction and this prime is called not or complementation now we have also seen that there are some standard forms of expressing Boolean functions two most important of those standard forms are disjunctive normal form and conjunctive normal form in short written as dnf and cnf respectively so we have disjunctive normal form written dnf and conjunctive normal form written cnf at this point we ask a question that can we represent a Boolean function by expressions consisting of something less than the Boolean variables and plus dot and complementation the answer is yes and first example is just the set consisting of plus and dot I am sorry plus and complementation suppose we have two Boolean variables and consider the expression x complement plus y complement and complement of this whole expression which gives me x complement complement of that dot complement of y complement by de Morgan's law which in turn gives me x dot y now this shows me that the x dot y or x and y can be written in terms of plus and complement therefore if we consider the disjunctive normal form of a function and then just replace all the products by using the relation x dot y equals to x complement y complement and complement of that then we can write the disjunctive normal form purely in terms of plus and complementation and therefore we can say that any Boolean function can be written in terms of the Boolean variables and the operations from the set plus and complementation so I write like this any Boolean function from bn to b can be written as an expression consisting of n Boolean variables operations from the set plus and complementation now we consider another set which is dot and complementation here also we see that if x and y are Boolean variables we can take x complement dot y complement and complement of that whole expression and by de Morgan's law this becomes x complement complement plus y complement complement this is by de Morgan's law which is equal to x plus y thus invoking the same same argument we can say that a Boolean x a Boolean function can be written as a Boolean expression consisting of the Boolean variables and the operations dot and complement in general if we have a set of operations let us say s s we will call this set s functionally complete or universal if any Boolean function can be written as expressions consisting of the Boolean variables and the operations from the set s so let us write it down formally s is said to be functionally complete if any Boolean function can be written as a Boolean expression consisting of the Boolean variables operations belonging to the set yes now we ask a question can there be a singleton set which is functionally complete and surprisingly the answer is yes in fact we will check two singleton sets which are functionally complete the first one consists of an operation which is called NAND so I write NAND inside third bracket to designate that we are considering a set consisting of a simple single operation called NAND and this NAND is sometimes denoted by a single stroke a vertical stroke NAND is defined as x NAND y equal to x complement plus y complement now in order to show that NAND is functionally complete we have to show that we can express complementation or and and all three in terms of NAND in order to check complementation we see that x NAND x gives me x complement plus x complement which is of course x complement then we see that if we consider x complement x NAND x and then NAND of y NAND y then we get x complement NAND y complement which in turn by definition of NAND is x complement complement of that plus complement of y complement which is x plus y therefore we see that we can construct the complementation operation of a Boolean variable by NAND which is x complement equal to x NAND x and the operation which is x NAND x NAND y NAND y at this point we realize that we do not have to show that we can write and operation in terms of NAND because we have already proved that the set plus and complement is functionally complete we have proved that therefore we can write since the set plus and complement is functionally complete the set consisting the single operation NAND is also functionally complete now we move to another operation which is called NOR and this is given by the symbol of an arrow directed downward and nor is defined as x nor y is equal to x complement dot y complement now let us check whether nor is functionally complete or not we consider just like before x nor x which is x complement and x complement which is of course x complement then we construct x nor x nor of y nor y which is equal to x complement nor y complement which is equal to x complement complement of that and complement of y complement which is x y thus again we see that the operations dot and complement can be generated from nor therefore we can write as before since dot and complement is functionally complete so is the single term set nor and that is all so the basic strategy of proving such results is that when we are given a set of operations and ask to show whether that set is functionally complete or not somehow we should try to write plus and complement or dot and complement in terms of those operations if we can do that then it is direct that the original set is functionally complete at this point we will introduce another operation which is called exclusive or or simply x or now I will write the table corresponding to x or suppose we are considering two variables x and y the possible values of these two variables are 0 0 0 1 1 0 1 1 and x x or y by the way this is the symbol corresponding to x or is 0 when both x and y are 0s it is 1 when x is 0 and y is 1 it is again 1 when x is 1 and y is 0 but unlike or x or is 0 when both x and y are once this is an operation which is used in several applications of Boolean functions now we can consider this operation as a Boolean function itself and try to write down the disjunctive normal form or DNF of this operation we want to do that then we will find that the DNF is x or y is equal to we have to only consider this row and this one so here we have got x complement y and for this row we will have x y complement and this is the expression of x or in terms of complement and and or it can be proved fairly easily that x or and and complementation together is also functionally complete x or and and complementation is functionally complete this is because I can write x plus y as x plus y is equal to x or y x or x y if we want to check that we have to check the truth table of this function x x or y x or x dot y let us consider all the input patterns of for this expression and then evaluate so when x and y both are zeros we have the output as 0 when y is 1 we see that x x or y gives me 1 x or x dot y gives me 0 so I have got 1 when x is 1 and y is 0 then also I have 1 and now when x and y both are 1 then x x or y gives me 1 I am sorry x x or y gives me 0 because of this but x dot y gives me 1 so altogether I have got 0 x or 1 which gives me 1 and this pattern in the extreme right hand column is exactly the pattern corresponding to x plus y or x or y therefore we see that by combining x or then the and and complementation we can generate or and since or and and complementation is functionally complete x or and and complementation is also functionally complete at this point we can also do something even further we can write the complement of x as x x or 1 where 1 is the greatest element in the Boolean algebra that we are considering 1 is the greatest element in the considered Boolean algebra so what happens then this means that I can replace even complement if I denote the greatest element by 1 and 0 and of course they are their existence is guaranteed by the basic definition of Boolean algebra therefore we can even say that xor and dot is functionally complete with the understanding that further we can write a Boolean function by using simply xor and dot and we can see that because we can always replace the plus by xor and dot and what we can do is that every complement we can write as a sum with the original and the one by some I mean xor now if we do that then we will be getting a Boolean expression in terms of the Boolean variables xor and dot or and whatever we call it a Boolean expression of this type is called an algebraic normal form or a nf a Boolean expression consisting of the Boolean variables and the operations from the set consisting of xor and dot is said to be an algebraic normal form in short it is written as a nf and of course I need not explain further that any Boolean function can be written in terms of an algebraic normal form next we move on to another topic which is extremely important in the context of Boolean functions and that is the that is called minimization of Boolean functions by this we will mean that suppose we know that a Boolean function can be written in terms of the Boolean variables and some operations we would like to write the same function by using minimum number of variables and in such a way that the operations are used minimum number of times now in general this is a very vast problem and a current area of research however we can deal with small Boolean functions and consider its expression in terms of or and and not and try to reduce it to something smaller now we start with an expression on three variables suppose we have a function f which is given by 267 this is a form that we have already discussed before and let us suppose the variables are designated as XYZ therefore we first write the truth table XYZ are the variables corresponding to the coordinates of the Boolean algebra B3 and we write the possible values of XYZ so the first row consists of 0 0 0 the second 0 0 1 then 0 1 0 and the fourth one is 0 1 1 and we move further down to 1 0 0 1 0 1 1 1 0 and 1 1 1 without write down the corresponding decimal code the first entry is 0 the second is 1 then 2 then 3 then 4 then 5 6 and lastly 7 my function says 267 that means according to our convention the function is 1 at 2 then it is 1 at 6 and then it is 1 at 7 and at the rest of the places the functional value is 0 we have got we can write f over here and now we are in a position to write down the algebraic normal I am sorry the disjunctive normal form of this function so I am going to write down XYZ as X complement YZ complement plus XYZ complement plus XY and Z now a question occurs is that can we write this in terms of something which is shorter than this what we can do here is X complement YZ complement and split this the second term as XYZ complement second term as XYZ complement plus XYZ complement because we know that if we take or of the same variable we get back the same variable and XYZ and then if we observe here we see that you can use distributive law to write X complement plus X within a bracket then followed by YZ complement then a plus and here again I can write XY and Z complement Z now we recall the results that we derived extremely thoroughly in in a lecture previous to this one where we have proved that X plus X complement gives me 1 and Z plus Z complement gives me 1 well that is the definition of complement so I have got 1 YZ complement and XY1 so I get YZ complement plus X and Y the final term is interesting because this gives the same function but this uses lesser number of variables at each term and also of course lesser number of operations the question is that can we do it systematically there is a tabular form that is used for functions with smaller number of variables which is the case here that I would like to discuss in this lecture this is called Carnot map method here we will consider a table which is best understood by using examples I write XY over here and Z below it so I will keep on writing all possible values of XY in these positions and all possible values of Z in these positions I will write 0 0 and then write 0 1 but instead of writing 1 0 I will write 1 1 and then lastly I will write 1 0 there is a pattern here that is when we move from one cell to another there is only one change in the variable values if I change from 0 1 to 1 0 that means 0 will change to 1 and 1 will change to 0 which is not acceptable to us will change from 0 1 to 1 1 and then the last one we will make 0 so I will have 1 0 and in case of the rows I will just write 0 and 1 now see that we can write the decimal codes in a corner of each cell so this cell corresponds to 0 0 0 which is 0 then this cell corresponds to 0 1 0 now 0 1 0 is 1 then I am sorry 0 1 0 is not 1 0 1 0 is 2 and then I have got 1 1 0 which is 6 and then I have got 1 0 0 which is 4 so I am just writing the decimal codes over here and I have got 0 0 1 0 0 1 is 1 0 1 1 which is 3 1 1 1 which is 7 and 1 0 1 which is 5 now I look at the disjunctive normal form of the function the first entry of the disjunctive normal form is x complement y z complement now when I encounter x complement then I will consider x equal to 0 so I come to either this cell or this cell but I have y along with that y corresponds to 1 so I come to this cell and then I have got z complement z complement means z equal to 0 in fact I could look into the entry 0 1 0 corresponding to which I have the mean term x complement y z complement 0 1 0 here I put a 1 similarly if I look at the other mean term 1 1 0 which corresponds to this mean term 1 1 0 I will put a 1 over here and last one is 1 1 1 I put a 1 over here after this I will join the adjacent cells like this by some rectangles now if you consider these two cells you will find that the value of x changes value of y remains intact and value of z remains intact only the value of x changes so we cut down x so what we do is that corresponding to this to merge cell I write y z complement then I see that I can merge also these two cells and when I do this the value of z changes from 0 to 1 value of x and y remains as it is so I will just write plus x and y removing the variable value which changes and this happens to be the reduced expression what we see is that this is exactly what we got by using algebra the problem of this method is that when the variables start increasing then this whole system can become very very complicated but we can do the same map method for functions having four variables which is the last topic that we will discuss in this lecture now let us consider a function with four variables f w x y and z which is given by 0 4 5 7 8 9 13 and 15 as I have already told that Carnot method is best understood by examples now we have a function at hand we will consider a table in this case unlike the previous table we will have two variables labeling the columns as before but two more variables labeling the rows so I draw the table like this I pick first two variables w and x to label the columns and the last two variables y and z to label the rows well there will be four possible columns and four rows I make the grid and here the values will be 0 0 0 1 1 1 this is a note of caution and 1 0 in the rows we will have 0 0 0 1 1 1 and 1 0 so when we are reading of the cells the upper left hand corner cell will read 0 0 0 0 which corresponds to 0 I can write over here the next one is 0 1 0 0 which corresponds to well it corresponds to 4 then we have 1 1 0 0 this corresponds to 12 and here we have 1 0 0 0 which corresponds to 8 now then we have 0 0 0 1 which corresponds to 1 and 0 1 0 1 which corresponds to 5 and similarly 1 1 0 1 which corresponds to 13 and lastly corresponds to 9 here again the next one is 0 0 1 1 it corresponds to 3 then we have 7 then we have 15 and we have 11 and the fourth row will be 2 6 14 and lastly 10 1 0 1 0 which is 10 now we can read off from the formula and write 1 in appropriate places in 0 we have got 1 in 4 we have got 1 and then in 5 we have got 1 in 7 we have got 1 in 8 we have got 1 in 9 also we have got 1 then lastly 13 and 15 now our goal will be to cover these ones by rectangles in such a way that we can cover all of them with minimal number of rectangles if we try to do that we will see that we have a big rectangle which is in fact a square covering these four ones and then one like this and another like this now we first check the middle rectangle of the square and try to see that when I move around how many variables are changing so see if I move around w is changing and x is keeping the value 1 therefore I will put x over here and when I move in the vertical direction I see that y is changing but z is remaining in the same value 1 therefore y will be deleted and I will write z when I move to this rectangle in the left hand corner I see that x varies but yz and w remains same but all at the state 0 so I will put w complement y complement and z complement and similarly for the last one we see that z changes but w is in the state 1 x is in the state 0 therefore x complement z changes therefore I remove z and y does not change but remains in the state 0 therefore I just put y complement and that is going to be the reduced expression of the function f w x y z now what we can do is that we can write the disjunctive normal form of the function f that I have stated over here and then try to do algebraic manipulation and then also we will come to the same expression as this one this is an example of minimization of Boolean expressions by using the Karnaugh map method so in this lecture we have started with the idea of functionally complete sets of operations in this we have checked apart from the usual operations three new operations one is called XOR another is NAND and the other one which is NOR secondly we have briefly discussed the Boolean expression minimization problem by using the Karnaugh map method that is for today thank you