 Good morning everyone, sorry for the slight delay. So, today we are going to talk about digital circuits. So, the first half of the morning we will cover combinatorial circuits and the second half we will cover sequential circuits. So, let us begin. So, just some motivation to begin with and these things actually are not going to draw on the board. Let me just expand and this is just to sort of motivate the students about what, why digital circuits are important. So, here this slide shows a simple example of an analog signal and a digital signal and even if you are not able to see all the details that is not a problem. So, the analog signal of course, can go both positive negative, digital signal can only cope between 0 and 1 and so on. So, that is the plot. So, the points that are to be made at the beginning of this topic so that the students get some idea about you know the motivation is the distinction between an analog signal and a digital signal. First of all what is the difference then a point out that digital signal is binary in nature that is it takes only two values low and high. Of course, there are some other systems in maths where we have not binary, but higher logic systems, but of course, in real world we basically just use this binary digital system. Now it is important to also point out that the definition of low and high really depends on the technology that you use. For example, in TTL the low and high levels may be something like CMOS, it may be 0 and VDD, ECL, emitter coupled logistic, it may be something else and so on. But so as far as we are concerned, we are just going to treat all of these as just 0s and 1s and not worrying about right now the exact levels. So, let us go on to the next slide and it is good to show at this stage some example or some connection of the digital world with the real analog world and that is why I have shown this particular slide and it is already if you cannot read these symbols. So, essentially there is a base resistor RB, there is a collector resistor RC, input is applied at the base and output is taken at the collector and this graph here shows the output voltage versus input voltage and essentially what we want to point out in this slide is if the output is low then the input is low then the output is high, if the input is high the output is low and essentially this is a BJT inverter. So, this gives the students a feel for what it is all about in the sense that they will then know that these things the digital gates can actually be realized with either bipolar transistors or MOS transistors and so on. If you have a MOS transistor example, you can show that as well. From now on we will not worry about how it is implemented but what you can do with this digital variables. So, before actually getting into Boolean algebra and such, it is good to point out why we need to do, why are we interested in digital systems at all in the first place and of course there are lots of reasons as you know but it is good to put this all in one place and that is what we have done in this particular slide. So, a major advantage of the digital systems is that even if the original data gets distorted for example, if it gets transmitted in transmitting pure and optical fiber for example, you can always put a comparator and you can regenerate the original data and that is something that we cannot do in analog system. So, in analog system if there is corruption it is very difficult to get back the original data exactly whereas, in digital systems it is very easy and in fact that is why we have in optical fiber systems there is something called a repeater and the repeater does basically restoration of this data. So, that it can be transmitted further very easy to do in digital system. So, that is a very big advantage of digital transmission. There are several other benefits of using digital representation and there are probably so many that we really cannot release them all but these are the major ones. The biggest benefit is that we can use computers to process the data if we use digital systems and of course there used to be analog computers but they were nowhere as powerful as the digital computers today. So, you can use computers to process the data can store in a variety of storage media and we already are using this we have fendries and we have CDs and we have computer hard disk and we have what not your mobile phone etcetera. So, you can store in a variety of storage media that is another huge advantage of digital system you cannot do that with analog in the analog world. Another very important feature is that you can actually program the functionality of a digital system. For example, if you have a digital filter implemented on a DSP processor you can change the behavior of the digital filter simply by changing its coefficients and you can enter those coefficients to get a new behavior if you like. So, that is this programming aspect is very very important and today is many of many electronic systems today we will actually use this feature. So, all this is just to motivate the students about why they should pay attention to digital world, all right. Let us go ahead now these things we are not going to go through in this class because it is all pretty elementary but just to show just to tell you that these if you want to use these slides in your class it is at one place and you do not need to draw these things on board in case you want you want to just project these as you can use these. So, there is a NAND gate and OR gate and XOR gate and we are not going to go through these you know all of this. So, we will just go ahead all right now logical operations. So, we find that many of the students actually are already somewhat familiar with Boolean algebra when they come to this course. For example, they know what the AND operation is and so on but it is still better to do these things in more detail and in a sort of complete way. So, that the students get a good picture of the overall situation and there are many properties that we sort of take for granted but they are actually very fundamental and they should be just you know treated as such. The AND operation is commutative we take this for granted and that means A and B is B and A the AND operation is also associated I hope you can see this better now the OR operation is commutative OR operation is also associated. So, these are some very basic properties Boolean algebra given to us by George Boole 1815, 1864 quite a long time back and he has given us several theorems. The inverse of A inverse is A and this is a very trivial it looks very trivial now but if you want to systematically go about proving this you can construct a truth table. So, here is A what is a truth table? A truth table is a table with all possible variations of the input quantity. So, in this case the input is only 1 it takes on only 2 values 0 and 1. So, here I construct A bar 1 0 and A and the complement of that. So, this A bar bar is constructed from this A bar bar is actually constructed from the second entry and not from the first entry. So, A bar bar is the bar the inverse of A bar that is 0 here and 1 here and then now you can compare A the original one and A bar bar 0. So, and then they are the same and if that is the case then the 2 functions are considered identical and that is why we have A and A bar bar is as the same alright all this might sound trivial for this function but that is really the systematic way of doing things. Similarly, the following theorems can be proved and you know all of these things. So, we will not really stress that too much. D Morgan's theorems are very useful as you know and let us see what how we can derive these from the truth table approach. So, let us construct these things A let us take 2 variables A and B and exhaust all the possibilities 0 0 and 0 1 1 0 and 1 1 then construct A or B A or B bar of that A bar B bar and all of these entries and then let us see what happens. Now, you know all of these things and it actually sounds somewhat trivial but if a student is looking at these things for the first time it is not trivial and so if you just state the D Morgan's theorems in class saying that A plus B bar is the same as A bar and D bar the student feels that there is something some magic about it actually there is no magic you can derive these theorems from the truth table approach or from the first principle. So, here after we complete this table now let us look at this column A plus B the whole bar A bar dot B bar and you can see that this column and this column is identical and therefore, these 2 functions must be the same and that gives us the first D Morgan's theorem. Second if I look at A B bar I get 1 1 1 0 here and if I look at A bar plus B bar I get 1 1 1 0. Therefore, this and this must be the same. So, that is the way to really develop this in class so that students know that there is some system about it is not just some arbitrary theorem coming from somewhere. Now, the important thing is to point out at this stage that there are these things actually are applicable for more than 2 variables as well and we all know that but it is good to state this explicitly for the benefit of students. So, if you have 3 variables A B C and if you take the bar of all that A bar plus B bar plus B bar etcetera. Also if you can club things for example, here we have A plus B as 1 term and C as another term and if I take the bar of that I will get A plus B bar plus B bar and some of these things we will use later today. There are some more laws distributive laws and this law again can be instead of just stating it you can actually work it out in class by producing a table of this kind. So, here we have a table A B C and again the table is written so that all the various combinations are exhausted and the way to do this is to let C vary fastest like 0 1 0 1 then let B vary 0 0 1 1 and so on and then A vary the slowest 0 0 0 0 1 1. This will guarantee that you exhaust all the possibilities and it also turns out that if you take this as the L S B and this is the M S B then this is actually in the decimal order 0 to 7 alright. So, if I construct from these A B C values B plus C or B or C I get this column here and if I do A ended with this column then I get this column I can construct A and C from these using these entries and then I can construct A B or A C and then finally I show that this column is identical with this column and therefore this identity is valid alright. So, this is something that sort of looks like our algebraic identity if you have these are real numbers then we have the same identity. So, this is something that comes sort of naturally for the student the next one does not. So, let us look at that one the counterpart of this is somewhat non-intuitive because there is no there is there is no in particular this particular this law distributive law A plus A A or B and C with A or B ended with A or C. Now, there is no counterpart of this distributive law in our real number system and therefore this is something that is that can be somewhat counterintuitive to students. But again it is very simple to make up these tables make up the truth table and explain why that is so. So, construct these things as before A or B C is this column here A or B ended with A or C is this column here and then these columns are shown to be the same and that is why the identity is true. So, you can point out that this column and this column is the same alright. So, this is something that students do feel a little uncomfortable in the beginning because there is no counterpart of this in the real numbers. But of course, it is very a very important theorem as well or identity. So, let us go to the next slide alright. So, A or A B is A now this is a theorem we can follow two approaches here in fact, let us do this on paper. So, what we want to show is alright. So, there are two approaches that we can use number one we can use the truth table approach. So, let me so let us take all possible values of A and B construct A and B construct A or A B and then let us compare these various columns alright. So, A or A and B is one only both of them are one A or A B is one if either one of them is one. So, it is one here one here 0 here 0 here and now if you look at this column 0 0 1 1 and this column 0 0 1 1 they are the same and that actually proves the identity. That is one way of doing it the second way of doing that is using things that we have already done before right and without constructing a truth table. So, I can write A or A B as I can write A as A and 1 and keep this A B as it is and now I can use one of these theorems that we have looked at earlier and this then becomes A and 1 1 1 or anything is just 1 and that gives us all. So, often this kind of thing is more convenient rather than enumerating all the possibilities. The important point to note here is that this theorem is applied can be applied even if B is replaced by some other numbers some other term like that like that. So, it this is also A if it is replaced by a more complex expression this is also equal to A right. So, A plus A and something that would what A respect of what that something is it is already A alright. So, that is an important theorem and we will end up using it a little later. Let us get back to the slides if you have any problem reading these things that we that I am writing behind just let us know on the chat mode and then we will see what to do. Let us get back to the document. So, we have done this next we want to show that A and A or B is also A again this can be done by the truth table of by the truth table approach or we can use things that we have already done. So, A I can write I can expand this A and A plus A and B and then that gives me A plus A B and that gives me A. So, now note that we have we already have this result and we have used that result here to prove this result alright. So, there is actually something called the principle of duality and the what we have seen just now is an example of that same duality. So, let me just write this down. So, there is a duality principle and this is often not there in text book. So, it is interesting to talk about it right now alright. So, in this duality principle plus and and or and and are interchangeable 1 and 0 are interchangeable let us. So, let us see how. So, if you have one theorem you can actually derive another theorem just by using this principle of duality. So, this is a theorem that we already had right. So, let me just to make things easier let me put things in bracket here alright. So, what is the counterpart of or it is and. So, this or I am going to replace with and this in this bracket there is only one term. So, that remains as a in this bracket what is the counterpart of and it is plus. So, instead of this a and b I will write a or b and then of course the counterpart of a is a itself and. So, now, we have got from 1 theorem we have got another theorem and. So, in fact if we if we have proved this theorem this just follows by the principle of duality and that is a very kind of powerful principle that can be useful sometimes. So, that is what this slide says alright. Similarly, let us consider let us take another example say let us say we already know that a or a bar is equal to 1 and let us convert this into the dual theorem. So, what is r gets replaced by that gets replaced by and a remains a a bar remains a what about 1 1 gets replaced by 0. So, if you know this theorem you immediately know this theorem as well without even constructing its truth table and so on. So, just that is the principle of duality alright let us useful theorem. Let us let us let us do this let us see how to how to do that alright to. So, to show that a or a bar b is the same as a or b how do you do this we can use things that we already covered and this is where. So, as we have seen earlier let me just write this here if you have two things q and r you have p plus q r is p plus q p plus r this is one of the identities that we saw earlier. So, apply that to this particular term I get a what is p here p is a what is q q is a bar and what is r r is b. So, I get p plus q and p plus r and. So, that is a plus a bar is just one and then I get the right hand side. So, once you know a few things you can actually derive the others using those alright all this is the good introduction to Boolean algebra for the students it was spending some time on this in class what is the dual theorem of this let us see what that is. So, let us construct the dual theorem of alright. So, what is duality the plus gets replaced by and and one gets replaced by 0. So, let us apply that to this case and I am going to put these brackets just for convenience. So, the dual of r is and dual of a is a itself alright and here we have an and operation. So, that actually becomes r what about here we have a r operation that becomes and and that is what we get as the dual theorem alright. So, there is once you have this there is no need to even prove this you can just write it by duality. Let us get back to another one this is sort of trivial a b alright. So, the first one is trivial because we are sort of used to this, but the second one is is not and then again if you know the principle of duality you can easily derive that from the first one and you can you can do that later. Now, go ahead. Now, let us do this interesting problem or before that let us let us see what this r means because this r in English and r in logic are some sort of different. So, let a be the statement that I will be in Mumbai or I will be in Chennai on a certain date right. So, that is the statement a. Now, the question is how do you write this in in Boolean algebra? Let us define two things one is m or the statement m is defined or the variable m is true if I will be in Mumbai is true statement c or the variable c is true if the statement I will be in Mumbai is true. Now, if I the question is whether a is the a the statement a says that I will be in Mumbai or I will be in Chennai. So, it looks like I am talking about m or c let us see if that is actually the case. So, suppose I say that a is simply m plus c that is m or c what does it what does it mean. So, in if you write this as a logical statement what it actually means is I will be in Mumbai or in Chennai or both right and that is because our truth table for the r operation is like this. So, if you have so I have a equal to m plus c that is what we thought we should write and if I have m and c and a note that a is one if one of these is one a is also one if both of these are one right. So, what does it mean that means I will be in so what this statement means is that I will be in Mumbai or I will be in Chennai or I will be in both Mumbai and Chennai and of course that is not possible for most people. So, therefore, this interpretation actually is not correct and what we really mean in this case and you can think about that is m c bar or c m bar. So, think about this and you will say that this is actually the statement that we imply. So, it is good to point out that this logical r and English the plain English r sometimes r sometimes can be different. There are also examples where they are the same for example, here is the second example. The statement a is you will find Mr. Tandon or Mr. Goway in the lab at this time. These people actually are in our electronics lab. So, what I am saying is you will find one of them at this time. Now, suppose I write this suppose I define c as you will find Mr. Tandon in the lab at this time, G as you will find Mr. Goway in the lab at this time and now let me construct let me say that a equal to t plus g and this case actually this interpretation is correct. Because, I can what I actually mean is I can find either Mr. Tandon or Mr. Goway or both of them and that is why this particular interpretation is correct. So, sometimes the English r and logical r all are the same sometimes they are not. So, it is important to make this distinction clear to the students. Now, let us do some let us do a little entertainment for the students. So, I hope all of you can see this letters. So, the situation is like this India-Australia match is going on everybody is very tense and it turns out that India will win if one or more of the following conditions are met. So, what are those conditions? Condition 1, Tendulkar's course of century that of course, it is not an uncommon situation. Condition B, Tendulkar does not score a century and one fails to get wicket. So, in that case also India will win a match or Tendulkar does not score a century and Shevak scores a century. Remember that there are these and here logical and all right. So, how do you how do now it looks it looks rather complicated in an India-Australia match India will win if one or more of the following conditions are met. Tendulkar scores a century, Tendulkar does not score a century and one fails, Tendulkar does not score a century and Shevak scores a century. So, it is actually indeed possible to simplify this and let us do that. So, we can actually replace this complex looking statement with a simpler one and that it is made possible by the identities that we have looked at earlier. So, let us define these things T is Tendulkar's course of century S, Shevak's course of century W, one fails and I, India wins and let us see how we can simplify this. So, let us do this on paper so everybody can see better. So, let us define I as true if India wins, Tendulkar scores a century. So, that means this logical variable T is true if the statement that Tendulkar scores a century is true, S is true if Shevak scores a century and W is true if one does not take the case that this one fails. So, what we are actually saying in the statement is if you remember I is so India will win if one or more of the following conditions are made and there are three conditions. So, one condition, second condition and third condition. What is the first condition? First condition is Tendulkar's course of century. So, that is just T, second condition. So, how do I write I? It is a combination of three terms logical or of three things. First condition is Tendulkar's course of century. Second is Tendulkar does not score a century that is T bar and Shevak's course of century. So, T bar and S. Third condition Tendulkar does not score a century and one fails. So, that is and there and there also and in these are or the others are or. So, this sounds very complicated. So, let us see if we can simplify this. So, what let me write T as T or T I can do that and keep the rest of them the same. Now, let me combine this and this and let me combine this and this. So, what is what do I get T plus T bar S plus T plus T bar. So, now here we can use our the theorem that we saw earlier A plus B C is the same as A plus B and A plus C. So, we are going to use this theorem here to simplify matters. In this particular bracket what is A? A is T, B is T bar and C is S. So, I can write T plus T bar and T plus S. Here I can write T plus T bar and T plus. This simplifies further and let me just take this over here. So, T plus T bar is 1 and so this term is 1, this term is 1. I am left with T plus S plus T plus W. So, this is T plus T plus T is just T. So, T plus S plus W. So, this whole complicated statement that we began with actually is the same exactly equivalent to saying T plus S plus W. So, that is how these identities can help you sometimes to make some sense out of complex situations. So, let us get back. So, in words what does it mean? It means that India will win if one or more of the following hold then local strikes that is scores of injury. One fails, she walks scores of injury and definitely simpler to read than the earlier problem. Let us go ahead. Now, we come to some some nitty gritty of logical expressions and such. So, let us consider now we need to talk about min terms and max terms and that kind of stuff. So, consider a function x of three variables a b and p. So, as you know this is the sum of products form, but it has to the student does not know all of these things. So, therefore, it has to be sort of started at the beginning. So, I have taken an example here, just four terms and I have defined x 1 as a bar b c bar and so on. This form is called the sum of products and why is it called sum of products? Because if you just think of the real world this looks like a product, this looks like a product and this looks like a sum, the plus looks like a sum and that is why it called the sum of products. So, the sum corresponds to r and the product corresponds to and. This it has just to do with the way we think about real number. Now, how do we construct x from this description? That is very easy. So, what we do is enumerate all possible combination of a b c and how many combinations are there? There are two raise to three because each one of these can take either 0 or 1. Next, what we do is we can tabulate x 1. How do we tabulate x 1? We know that x 1 is 1 only if a is 0, b is 1 and c is 0 that is only possible. Similarly, we tabulate x 2 and x 3 and x 4 and now finally, if since x is 1 since x is just all of these, we know that x is 1 if any one of these things is 1, otherwise x is 0 and therefore, we can tabulate x. So, this systematic procedure actually shown in this next slide. So, let us just do this on paper and I am not doing this because you do not know how to do this, but I just wanted to show you how it could be done for students who will look at this for the first time. It is different than how you look at it. So, what is x? It is x 1 plus x 2 plus x 3 plus x 4 and that is a bar b b bar plus a bar p p plus a b bar c bar plus a b c bar. And what I am going to do now is enumerate all the possibilities here and that is how you actually describe a logical function. Let me write a little bigger so that. So, some of these 0s are appearing as 1s, but you can make out from the context. So, what is x? It is a bar b c bar. So, that is easy to make out. So, a must be 0, b must be 1, a must be 0, b must be 1 and c must be 0. So, x 1 is 1 only over here. So, that is how we write these min terms. It is 1 only here and it is 0 for all other conditions. So, you actually just need to think about one particular combination and others are just 0. x 2 is a bar b c. So, a must be 0, b and c must be 1 and that happens here. x 3 a b bar c bar. So, a must be 1, b and c must be 0. So, it is 1 here, 0 everywhere else. x 4 is a b c bar. So, 1 1 a should be 1, b should be 1, c should be 0. So, it is 1 over there and 0 everywhere else, etcetera. Now, let us construct x and for x, what we need to do is we just need to keep track of the 1s. So, x is 1 if either x 1 is 1 or x 2 is 1 or x 3 is 1 or x 4 is 1 and in this particular case, it does not happen that x 1 and x 2 are 1 together. So, we just need to worry about this distinct individual possibility. So, x 1 is 1 here. So, x must be 1 here, x 2 is 1 here. So, x must be 1 here, x 3 is 1 here. So, x must be 1 here and x 4 is 1 here. So, x must be 1 here and that is it and the rest, we do not even need to worry. We just put 0 there because that is what will happen. The reason we are doing this is because we want to look at an alternate form and that is the next slide. So, this is something we have already done. We may not be able to see this, but we already have it on paper. Now, let us consider another function and let me write that down here and that is in a different form and that is called the product of some form. So, because each one of these terms is in the some form and then there is a product and let us just construct this as well. So, y is a or b or c and a or b or c bar and a bar or b or c bar and a bar or a I need to write this is a product. Let me just reproduce this on the, let me reproduce this on the paper y is a or b or c and a or b or c bar and a bar or b or c bar and last one is a bar or b bar or c bar. Now, this is an entirely different form and let us construct this here. Let me call this first term as y 1. So, what will y, so let us again enumerate all these possibilities y 1 is this a or b or c and now we need to worry about when is y 0, when is y 0, y 0 only y 1 is 0 only if a is 0 and b is 0 and c is 0 and that happens at this place. And we do not even need to do anything further because we know that all other cases y 1 must be 1. So, that is y 1. What about the next term a plus b plus c bar? Let me call that y 1. So, what is y 1? So, y 1 is y 1 and y 1 is y 1. So, what is y 1? So, y 1 is y 1 and we do not even need to do anything further because we know that all other cases y must be y 1 must be 1. So, that is y 1. What about the next term a plus b plus c bar? Let me call that y 2. So, a plus b plus c bar is 0 only if a is 0, b is 0 and c is 1. So, a is 0, b is 0 and c is 1. So, this is 0 only here and in all other places it is 1. What about y 3? a bar plus b plus c bar. So, it is 0 only if a is 1, b is 0 and c is 1. So, it is 0 only here and everywhere else it is 1. y 4 is a bar plus b bar plus c bar. So, it is 0 only if a is 1, b is 1 and c is 1. That is here. Everywhere else it is 1. Now finally, let us construct y. What can we say about y? y is just y 1 and y 2 and y 3 and y 4. So, y is 0 if any one of these is 0. So, if y 1 is 0, y is 0, if y 2 is 0, y is 0, if y 3 is 0, y is 0, if y 4 is 0, y is 0 and that is it. We do not need to worry about anything else and the rest of the entries are just 1. Now, if you look at these two columns, you will notice that they are actually the same. So, what this means is that these two functions which actually look quite different x and y because they are in different form, they are actually the same functions. So, it is a good way to illustrate that the same function can look quite different depending on how you write it. Let us go ahead. So, all of these things are probably straightforward for you because you are used to it, but for a student looking at it for the first time, they are not. So, let us go ahead now. So, as I said, this way already covered. So, do not worry if you cannot see the letters. So, important thing is known that y is identical to x which we have seen earlier and this is an example of how the same function can be written in two seemingly different forms. In this case, the sum of products form and the product of some form and you might even write it in some other more complex form and it might still look different, but it might still be the same. So, what is the so called standard sum of products form? Let us look at that. So, let us consider a function x of three variables a b c, a b c bar plus a bar b plus a bar b c bar. Now, this form is called the standard sum of products and each individual term consisting of all three variables is called a min term. So, this is a min term, that is another min term and this is called the standard sum of products form. It is standard because each min term has got all three variables, each of the term has got all three variables and we have seen an example of enumerating this and constructing x. Now, we can actually in this particular case, we can combine these two terms, the second term and the third term and we can get a b c bar plus a bar b. This is also a sum of products form, but it is not in the standard format and why? Because this second term has got only two of the three variables and therefore, this form is not standard. So, you can similarly talk about a standard product of terms form. So, here is an example of a standard product of terms form and each one of this is now called a max term. So, this a plus b plus c is called a max term, a bar plus b plus c is called another maximum and so on and they are called maximum because they involve all three variables. Now, in this particular case as well, we can combine the second term and the third term using theorems that we have done before and we should go through this and convince yourself that is the case. So, what are we looking at? We are looking at a bar plus b plus c and a bar plus b bar plus c. So, if you notice this a bar plus c is actually common in both of these and that I have taken as p. So, it is looking like p plus b and p plus b bar and that turns out to be that can be further simplified and you need to just go through this figure out what theorem you have used and convince yourself that is the answer. So, again we have ended up with a product of fewer terms from three terms. Now, we have come to two terms and one of them is not a max term because it does not involve all three variables. So, this is also a product of sum form, but it is not a standard product of sum form. Now finally, we need to bring in at some point what the so called do not care condition and here is an example of do not care condition. So, let us say I am a very successful business person. I own let us say, for example and I want to design a box, an electronic box with inputs a, b, c and output s which will help me in scheduling my appointment because I am since I am so big and successful I do not have time to actually do all this thinking. So, I want an electronic box which will just give me the answer very quickly. So, what are these a, b, c conditions? The condition a is that I am in town and the time slot being suggested for the appointment is free. That means I do not have any other commitment at that time. Condition b is that my favorite pair is scheduled to play, let us say Tendulkar is going to play a match at that particular time and of course I am going to watch it on TV if I can afford. Condition c the appointment is crucial for my business and of course therefore I need to weigh all these various options and then schedule the appointment. Now, is the problem clear? So, I want to design a box with these inputs for example, this a will be true if at that particular suggested time I am in town and the time slot is free. b is true if Tendulkar is playing a match which I can watch on TV. c is true if the appointment turns out to be extremely crucial for my business. So, these are the various conditions and s is the output of this box and that is one if the appointment has to be scheduled and if the appointment is not to be scheduled then s will be 0. So, I want a box which will take a plus b a and b and c as input and s as the give me s as the output. So, the following two table summarizes the expected functioning of the box and let us try to understand what it is. What does it say? If a is 0 what does it mean that I am not in town or I am in town, but the slot that is suggested is not free for me that means I have something as some other commitment already. So, if a is 0 then it does not even matter what b and c are s must be 0. So, appointment cannot be scheduled simple that is where this do not care condition comes in. So, that means b it does not matter what it is c does not matter what it is s has to be 0 a if a is 1 and b is 0 what does it mean that means I am around I am in town I do not have any other commitment and b is 0 and tend to is not playing. Then I go ahead and schedule an appointment it does not matter whether the appointment is crucial for my business or it is just one of the ordinary appointment. Then I just make it then I just go ahead and schedule that means the box will do it. If a is 1 b is 1 and c is 0 what does that mean a is 1 I am in town the time is available b is 1 tend to playing c is 0 that means this appointment is not very crucial for my business it is it is something that I can sort of do without and maybe I have it some other time. In that case I will not schedule this appointment because I would like to watch tend to ok last case 1 1 1 what should I do in that case. So, I am in town the slot is available tend to playing, but the appointment is also crucial for my business in that case I will sacrifice the TV game and I will schedule the appointment. So, this is the logic that your box should implement and the important thing here is not whether these conditions are realistic or not, but the important thing is this x this x means it can be either 0 or 1 it does not affect this particular row that is the crucial point of this slide. So, yeah I think that is the logic that of this particular presentation let us go to the next one all right. So, let us continue with digital circuits and see how we can make make things simple if there is a complex expression and so on. So, and that brings us to Carnot maps now we can do Carnot maps in two ways one we can just tell the students what to do and what is the machinery and they will pick it up and they will do that in the exam that is, but that is at least in my view is not as satisfactory as explaining why it comes about. So, let us see if we can do that so, begin with Carnot map the Carnot map or briefly K map is a representation of the truth table of a logical function. So, that is what it is a K map can be used to obtain a minimal expression of a function in the sum of products form actually now this is the normal way a K map is used in most text books that is it we get a minimal expression of a function in the standard in a sum of products form, but it can also be used in the products of some form, but we will not look at that it is not very commonly used in at least the text books that I have seen. A minimal expression what is a minimal expression it has a minimum number of terms let us now only talk about sum of products. So, that means it has minimum number of terms min terms each with each with the minimum number of variables and it is important to note here that for some function it is possible to have more than one minimal expression that is more than one expression with the same complexity there are examples of that kind and maybe might even come across some in this presentation. Why do we want to minimize expression why do you want to come up with a minimal expression, because a minimal expression can be implemented with pure gates that is really the motivation for minimizing this function. So, that is just an introduction and this next slide is it illustrates only what a K map is all about. So, let me just and this is not something that we really need to go through, because all of you know this. So, it is just showing what goes where. So, we are essentially covering all the 1's and x's and not and then fill up the 0's. So, that 1 goes there and that x goes there and the 1 goes there. All right the most important aspect of all this is the way these things are numbered. So, this a b is 0 0 then 0 1 and normally in the binary counting we will say 1 0, but here we say 1 1 and 1 0 and why is this that of course, we have to we will see soon. So, after you put all the 1's and x's the rest of them are 0 and then you can fill up all the 0's and complete your K map. So, this is the truth table and this is the corresponding K map. So, this is a very crucial point in a K map the adjacent rows or columns differ only in 1 variable. For example, here a b is 0 0 1 and a b in the next column is 1 1. So, it is differing only in 1 column if it went from 0 1 to 1 0 then that would be differing in both variables and that is why we do not follow that order and why is this requirement that we will come to very soon. So, here is an example of a K map with 4 and so a b and c d in this case again a b goes from 0 0 0 1 1 change of variable here 0 1 to 1 1 again 1 change of variable 1 1 to 1 0 again 1 change of variable and notice that this 1 0 is actually adjacent to this 0 0 this 1 0 is actually adjacent to 0 0 etcetera. So, c d also the same thing 0 0 0 1 1 change of variable 0 1 to 1 1 1 change of variable and 1 0 to 0 0 again 1 change of variable. Now, let us consider the following functions written in the standard sum of products form and these functions as you will see are somewhat peculiar for example, this is there is a function x 1 of a single variable and it is a plus a bar and of course, we know that it is 1 x 2 it is a function of 2 variables and it has a b a b bar a bar b and a bar b and we know that this also is 1 and why is why is it 1 let us see. So, by using theorems and identity seen earlier we can show that all of these things actually are equal to 1 you can construct a 2 table for this and show that, but apart from that another way of explaining why all of these are 1 is the following. For example, if you consider x 2 it has got 4 min terms a b a b bar a bar b and a bar b a bar b bar 4 term and those are indeed the all the combinations that you have with 2 variables and therefore, one of them is bound to be 1 and therefore, the function must be 1. Similarly, in this function x 3 we have all 8 terms here and therefore, one of them will one of them has to be 1 for all conditions for any condition and therefore, the function is uniformly 1. So, what we are trying to show here is that if you have 1 you can either write it as a plus a bar or you can write it as a b plus a b bar plus a bar b plus a bar b bar. In other words you can write a 1 with 2 terms like this or 4 terms like this or 8 terms like this and all this has to do with Carnot maps. So, let us just remember this and proceed. So, the conclusion from this slide is that a 1 can be replaced by a suitable expansion or in 1, 2 or 3 or more variable and we will find this useful in understanding k maps. So, here let me take this example on paper. So, what we are doing is we are talking about a function x 1 or just one term which has got a b bar and we want to look at this x 1 as a function of 3 variables a b and c. So, let us write a b here and c here. So, this a b bar of course, we can write as a b bar and c plus c bar and why it can be do that because we have just like we have seen in the previous slide we actually write when we say this we are actually writing it as a b bar and it with 1 and that and it with that 1 we are replacing by c plus c bar. What it means is this a b bar this term now when is it 1 when a is 0 b is 0 sorry a is 1 b is 0 that is when this part is 1. But if I write it like this then this actually gives me 2 boxes. So, let me explain what I am doing a equal to 1 b equal to 0. So, we are in this particular column, but this term actually is sum of a b bar c and a b bar c bar. Now a b bar c is 1 in this box a b bar c bar is 1 in this box. So, this term which look like term consisting only of 2 variables in a a b c table it actually gives rise to 2 1s and of course the rest of them are 0. So, this we have got 2 raise to 1 boxes. So, let us just keep that in mind and go ahead. So, in short x 1 is composed of 2 raise to 1 mean terms here 2 y 2 raise to 1 because we have introduced one more variable that is c and that is why 2 raise to 1. Now consider a function x 2 of 3 variables and again this you may not be able to see. So, let me write it here. So, let us take this second example and see what that does and all this is very important because the logic behind corner maps actually comes from this. So, let us say x there is a term which is x let us call it x 2 and that is called that is given by just a. So, what does it look like in the a b c table it looks like this. So, x 2 is 1 if a is 1. So, that means it is 1 here and here and here and here and this 0. So, let me now write it in as a corner map. Let me see what this term will look like in a corner map. So, it is 1 whenever a is 1. So, it is 1 if 1 here it is 1 here it is 1 here and it is 1 and now since we have looked at in the in a previous slide we have looked at why how this can be expanded into 4 terms it is easy for the student to see and why did why did that happen because we can replace a as a and 1 we can replace by b c b c bar b bar c and b bar c bar all right. Now, each one of these things. So, this is nothing but a b c a b c bar etcetera right each one of these things is giving you one of these ones and that is why we have got from a from a single term we have got 4 ones and of course, this term is 0 otherwise. So, again the key is that there are there is a rectangle with 2 raise to in this case 2 raise to 2 boxes with 1 right and that is why we can actually finally of course, we are going to talk about the reverse process that is given this corner map what does that correspond to and. So, we have to identify this rectangle which has got 2 raise to something boxes in this case it is got 2 raise to 2 boxes and why is that 2 coming there because we have 2 variables here b and c and we are we are writing this one this one in terms of those 2 variables that is why that 2 has come over there all right. So, this so this has to do with eventually how we construct things back from a corner map let us before we proceed further let me take another case and let me write the corner map in a different way. So, instead of making let me write it from after 0 1 let me write it as 1 0 and some students do make this mistake even in exams and then they sort of suffer because of it what will this look like in this particular map it will look like a is 1 right. So, not the best example here let me take another example in this case they actually happen to be together let me take another example where that will not happen and then we will see why things need to be adjacent let me take a term like x equal to b and let me see what that looks like in this corner map a b and c. So, b is 1 so I have got 1 here 1 here 1 here 1 here and you see that these 4. So, instead of giving me this x equal to b if you had given me this corner map I would have been able to say that there is a rectangle with 2 raise to 2 terms and therefore it is it has got only 1 term and that by inspection I can make out is b. So, now suppose the map given to me was not like this, but a little different then let us see what happens. So, instead of 1 1 here suppose I had 1 0 and now the same function x equal to b will look like 1 here 1 here 1 here 1 here and now you see that these 3 these 4 1s are not adjacent to each other and that is that happened because we allowed more than 1 changes when we went from 1 column to the next. So, that is why it is very important I mean it is absolutely crucial to have crucial to have only 1 change going from 1 column to next. So, here we have 0 0 to 0 1 1 change 0 1 to 1 1 1 change 1 1 to 1 0 1 change and then going back 1 0 to 0 0 1 change that is not the situation over here. So, that is that is a very important point to make and it is a good example to show that this order is rather crucial we are going very slow. So, let me let me skip some of this thing, but just go through this slides on corner map and so the rest of the slide this rest of the presentation as some just as examples which you would be very familiar with. And it also talks about why things are why these n columns are actually adjacent to each other. For example, in this case there is a 1 here and there is a 1 here and although they look like they are not adjacent we know that this column and this column is adjacent and therefore, we can combine these. And you can show this by just rewriting this order again. So, instead of starting with 0 0 if I started with 1 0 then 0 0 then 0 1 then 1 1 then these 1s actually will come together. So, it is the same thing as saying that this 1 is actually adjacent to this 1 and therefore, these 2 can be combined. So, similarly these all these 4 1s can be combined and so on. So, these are just more and more examples. One very important thing is that the same the conclusion of this slide is that a minterm can be actually combined with more with others more than 1. For example, this 1 here has been combined with this 1 as well as this 1. And there is there is a reason for doing that. And that is because we can if you have an expression if you have a variable y I can always write y as equal to y plus y and that is what we have done here. We have write one of these we have written one of these terms twice I think it is this term which has come twice without changing the original expression and that is what this corresponds to. So, the rest of them are just examples which you can go through. Now the do not care condition as you know we can exploit suitably to get minimum expressions. So, that is the last slide of this presentation. Let me go to the next one. So, we will continue with combinatorial circuits and I think we may have to continue this after t as well. So, let us but we still have some 10 minutes. So, let us see what we can do. So, in this slide we start with decimal base or base 10 system and base 2 system and so on because we are going to talk about adders and all this of course is not news to you, but it may be news to some of the students. So, therefore, it is important to explain what is LSB, what is MSB and so on, what is LSB, what is MSB, what weightage it gets like 2 raise to 0, 2 raise to 1 and so on and what that number actually corresponds to decimal, the decimal number. Now addition of binary numbers is very similar to addition of base 10 numbers and here is an example which shows that and so there is in when we add numbers in normal decimal system, we do have this concept of carry sometimes the carry is 1, sometimes it is 0 and it is the same thing applies also to binary numbers. And this all this is being done because we want to point out that you need 2 different kinds of adders. In the first stage we do not there is no carry, it is always 0 and in the subsequent stages there could be a carry which can be 0 or non-zero and therefore, we need a half adder to implement this functionality and a full adder to implement that functionality. And then this just goes on to show the implementation and so on, the generic case and then what the full adder, how you will do this with a half adders and full adders and then some of these things as implementations. Now this is an important aspect of expression. For example, if you have only 9 gates available to you, let me just do this on paper because you may not be able to see. Suppose you had only 9 gates available to you, how do we then represent function like this? Let me just draw the function, let me just go to the next slide and show the function. So, there is a function like this a b plus b c t bar plus a bar d and we want to implement this using only 9 gates. So, that is possible and the way to do this systematically is like this. So, there is a function given. So, what do we know about 9 gates? Let us just write that here. Suppose I have an operation like a bar, how do I implement this? I can write this as a and it with n and then bar of that. So, a and a and a and a and of a is gives me a bar. What about a b a and b? How can I get a b? I can get it like this a b. So, there is a nand operation here and then there is a not a operation here which we already know how to implement with a not gate. What about a or b? Here we can use the demorganism. What is demorganism? We have two theorems. One is this and the other one is this. So, how do we get a plus b? I can do it like this. I can get a bar and then I can hand it with b bar and then I can take inverse of that. Let us just do one example and show that this can actually be done. You can implement a function using only nand gates. In fact, you can use it only with only in or gates as well and that we will skip. You can just look at the slide later on. So, this is the function that is given. The first thing to note is that this is looking like p plus q plus r. How do you implement p plus q plus r? You can implement it like this. So, what we can do is we can generate p bar, q bar, r bar and then feed all that through to a nand gate. So, p bar, q bar, r bar and then feed all of these things to a nand gate and then you will get p plus q plus r. So, that is that. Now, what is p bar? p bar is the same as a b bar and in this case, we are lucky. We can just do this directly. So, a b bar is nothing but that can already be done with a nand gate. That is a nand gate with b symbol. What about q? q bar would be b c d bar bar. So, this is also nand gate. It is nand of three things b c and there is a d bar here, but the d bar we can actually construct also using a nand gate. I can just do this. I can connect the inputs together of nand gate and put d here and then I get d bar here. So, that is the second one. What is r bar? r bar is a bar d bar. So, this is also nand gate with an input d and then there is an a bar which we need. So, a bar can be constructed again with an nand gate by simply tying these two together and that is all we can get. So, this is how we can implement this function using only nand gates. You can also implement the same function using only nand gates, but that we will leave as an exercise if we do not have all right. So, we will continue with combinatorial circuits when we get back after t.