 So, this lecture today's class we will look at some of the fundamental building blocks of microprocessor or microcontroller ok. We will start off with combinatorial circuits or combinational design you know logic design and then we will move on to sequential and then you know memory blocks and things like that in the few further classes as to go. So, we will focus on combinational logic circuits in today's class ok. So, let me get these right ok. So, let us see if you talk of logic design ok. So, we will start with some of the fundamental basics I am presuming here you all are aware about you know basic logic gates and or not you know not that kind of gates ok. So, now with those gates we want to design some kind of a logic ok. So, you want to have a solution given to a given problem basically using some of the resources that are available with us ok that is typically a design process for any design ok. So, in the logic design specifically what we do is given a task ok we convert it into some kind of a you know mapping into 0s and 1s ok that is called encoding and there are several different ways possible say you say switch is light is on is one light is off is your 0 like that you can have many different mappings possible ok. Then you establish some kind of a mathematical relationship that is required based on the laws or logic that you like to kind of incorporate into system and then select the good design or good mathematical relationship ok depending upon what else what are the requirements ok that is typically the logic design process ok. So, let us see simple like you know logic that you have learnt again little bit revision here, but it is good to do so that we can kind of get some fundamental aspects of this you know logic or design of the logic touched upon ok. So, say for example, and logic you can simply implement by these two switches that you see here. So, A and B both switches are on then the light bulb lights and that lighting of the bulb is called as 1 then you can have R logic where your this circuit is put in this kind of a fashion when A is on A is switched on and R B switched on then also like know your light bulb close ok. So, so this is and an R logic implemented ok as you can see here ok A is 1 B is 1 your light is you know light is on that means that that is what I physically consider to be that physical mapping of physics into mathematics is 1 ok is is what I define as 1. So, switch on I define as 1 and then like you know light on I define as 1 then like you know I can kind of come up with this you know abstract mathematical problem into physical world problem ok. Now, the problem with this is now light is on, but now I cannot use that light on as 1 as an input to any other device ok. So, there that is where like know you have a you know problem like know we cannot scale then like know this logic ok. So, we switch is based kind of a thing we cannot scale and that is where like you see ok what is the element that can be used here to switch the next switch on ok or there when that is 1 like now I want the switch to be closed what is this element here and that is where people started kind of you know using this solenoids to do that job ok. And this is a way like know this whole area started developing into you know now you have multiple kind of solenoids which are kind of doing switching like this and then some some interesting things are happening in a circuit and then there are delays related to that there are mechanical motion inertia is a lot of lot of these problems are there ok, but these problems now you know that ok these problems have been taken care of by design of like you know this switching that is happen in that happens in the transistors. So, to say like you know the CMOS kind of a design ok, but let us look at what is this mapping typically is you know in from the physical world to the binary world you can have you know relay logic where your circuit is open and closed you can have different states defined CMOS logic you can have 0s and 1s 0 to 1 volt is considered as a 0 state and 2 to 3 volts is considered as state 1 ok. Transistor transistor logic 0 to 0.8 volts is considered as 0 and 2 to 5 volts is considered as 1 like that you can have multiple kind of you know definitions here for you know state 0 and state 1. These are the typically given definitions for different different kinds of you know elements or technologies that you want to say ok. So, now we want to design for example, a combinational logic for a calendar kind of a problem if this is a this is given how do you kind of come up with a circuit which is come consisting of this gates typically different and gate or gate or some other kind of gates and solve this problem. What is the problem statement here that given a month and number of. So, now given a month and a leap year flag as input ok. These are the two inputs and you need to find out you know number of days in a month as output ok. So, number of days in a month we want them as output here. So, this application can be different applications, but we are just looking at this as a problem statement from the design of logic perspective ok. So, given a month means how many months are possibility for each of the inputs. So, we will have 12 months ok. So, 12 possibilities for the input. Then a leap year flag ok how many inputs can be there there can be two inputs whether it is a leap year or it is not leap year like that. So, you need to kind of find out all the like all the possible inputs that that could be there for the system and then like you know you map them on to some kind of outputs and then you need to now define some abstract zeros and ones kind of a combination to define like you know these months like say there are 12 months. So, you need 12 different kind of a binary numbers to represent each month ok. So, so we can come up with many different kind of a possibilities, but typically like you know you you say ok I will have like you know 4 bits used as a binary input for a month thing. So, that like I will start 0 0 0 0 as defined as a January month like that I define like you know in terms of these 4 bits different different months ok. And then leap year flag can be 0 or 1 ok depending upon if it is a leap year it is it is 1 and if it is not a leap year it is 0. And then number of days output I can have could be possibility 28, 29, 30 and 31. 4 possibilities only exist for number of days ok. See look we are not representing number here that ok we want 30 as a number to be represented as binary no need ok because we we know that we are not like you know having any month which will have only 2 days or 5 days ok. So, we do not need to represent 0 to 31 as a entire like you know spectrum of numbers as a output ok. Are you getting my point here this is very important thing that to to see ok what are the distinct outputs that that we we are interested in ok. And then there are only 4 distinct outputs that are that we are interested in ok. So, like that one can think about and and now one can start writing a table ok table of inputs and outputs ok. So, how do you kind of develop that table you put all the inputs on one side and all outputs on the other side and start writing their values ok. So, input January month ok 0 0 0 0 ok like that you can start and then you you see that this is typically a chart that will come ok. So, month 0 0 0 0 and then you know you you you will have leap flag does not you do not care because whether it is a leap year or not leap year you always have you know fixed number of days in in January month. So, for example, here they have used the 0 0 0 1 as a January ok and and this is getting represented here ok. So, so you can have your own definition ok no nobody prevents you to say that ok my 0 0 0 0 should be January ok and then you will get this output here as 31 days as one output here ok. Like that you you can develop this kind of a table ok and once this table is developed then you can use you know the combinational logic circuit laws ok. You know that you know Carnot map or you have many different kind of a ways of you know getting these circuits for each of the output ok. So, for example, for this d d 28 output you can use you know some of the products kind of a thing or products of the some kind of a thing like you have lot of options possible here ok. So, so that is how one goes about getting like you know this combinational logic problem converted ok abstract problem given as a calendar problem converted into some kind of a mathematical problem of a digital logic design ok. So, this is what is a fundamental basis of all kind of a you know combinational logic design. So, here the important thing to note is that there is no notion of memory here ok given some kind of a combination of inputs you will have a combination of outputs ok. So, whatever conditions that we we are saying are not based on like you have to remember something that ok previously this was something and now it is something different you know nothing out like you know based on the previous thing that the output is changing you know there is no memory or notion of memory in entire of this discussion ok. So, given the this kind of a fixed values here for binary inputs you will have fixed binary outputs here ok. The combination of these like you know uniquely defines your combination of like you know outputs ok. So, that is a kind of a way one can design. So, see now here you can see that ok d d 28 d these are 4 kind of outputs I could have converted this problem into just 2 outputs as also because 2 binary numbers I can represent 4 different combination 0 0 0 1 1 0 and 1 1 ok. So, I can say my 0 0 if it is output then that is 28 months 28 days in a month ok or 0 1 is output 29 days in a month like that I can say and then this output could have been reduced ok and that would have saved me some circuits ok like that one can kind of think about. So, we will not get into the details about how do we do the saving or how do we kind of like you know develop the circuits which are optimized you know we are not getting into all that here. Here our basic idea is to understand is fundamentals how these different different combination logics are developed ok and like that there are now one can you know use this you know this is some of products kind of a rule that I have used here to get for the output for d 28 and then it is in the combination of you know and and not kind of gates ok. So, like that you get all these things developed here and you finally, express everything as some kind of a you know logic expressions ok and in this logic expressions can be converted into a circuit ok. You can convert them into a circuit by before simplification after simplification is all like you know you are you have lot of leeway to play there you can use Carnot maps or De Morgan's law to simplify things and get to some kind of a desired output in the desired form actually ok. So, so these are like you know different you know circuits that are for different outputs here ok. So, now there are these kind of questions you can ponder over ok you can see these questions and ponder over them and think about like know what I what could be the answer for such a such a question ok. And then this is a say d 30 output circuit for d 30 output and think like that ok. So, like that you can start developing now these kind of a logic expressions and logic circuits for many many different kind of combination and logic elements ok. So, we will see some of them, but I am going to go little faster through that. So, that you know the idea is to you know you can pause at any point of time and then like know go through these examples solve them on pen and paper and then like know look at the solution that will help you you know internalize the concepts very well ok, but I am going to go little faster to kind of you know the because fundamentally there is nothing different there ok. All are like in this kind of a combination of like you know some kind of a solutions here that you know the once you know this process that you express each of the outputs ok in the form of these inputs by using the sum of the products kind of a rule or some some other kind of a rule depend upon what the problems gives a simplification to. Then one can kind of start developing this first expression and then use some kind of a digital circuit laws to simplify this in more details ok. So, that is what is I am leaving it for you to kind of learn yourself and develop that ok. By the way even if you do not know to how to simplify and how to kind of get some circuits is ok. There is a it is not a requirement for understanding microprocessors. See it is like when you start using computer you do not know what is inside how it is really processing everything, but you can still use computer and like know write your codes in say C language ok. So, C language you learn and like know you do not worry about how it really processes things of each of the C language command inside ok it is like that ok. So, even if you do not know how these circuits are doing their job you is enough to know that by using some kind of a rule like this or some kind of a circuits like this like your output can be produced. So, that is what is a most important kind of a understanding here. So, the way this calendar example is done now we will see say some addition application if you want to do. So, half adder and full adders are which are useful in arithmetic logic unit in the microprocessor. Then multiplexers you can develop ok. They are useful in developing you know multiple channel interfaces for analog to digital conversion. There is one of the interface for micro controller microprocessor. Then comparators again useful in arithmetic logic units. So, these are some few kind of examples only which we have taken, but you know there are many many different kinds of these circuits that can be possible. And one can do lot of operations say logical operations and you know this addition operations, comparison operations like that that those all operations can be done by using these combinational logic circuits ok. So, these are the at the heart of all these microprocessors particularly arithmetic logic unit in microprocessor. And you have the seven segment display one of the examples we have which is an output device where like this seven segments will give you some kind of a representation of a number to display to a user. So, if you are aware about like you know these devices already you do not need to kind of go through this part already ok. So, you just because this is just a same kind of application of our combinational logic fundamentals ok. So, we say for example, now this half adder ok. So, there are these two numbers a and b binary numbers when you want to add together and then like you know it should have a carry ok. So, how what is the expression for you know carry and sum ok. So, if a is 0 b is 0 and my carry is 0 and sum is 0 if a is. So, like that you fill out fill out this table ok. You pause here and fill out and then again see that it will be like this. And then for implementing these you can find out this Boolean expression and once you get this Boolean expression you can get corresponding circuit related to that ok. So, there is a XOR gate coming up here. Then like that you can have a full adder ok. So, you have a carry in also now ok. So, a b and carry in also is there. So, that you can now multiplex it and get more some more the more of these going ok. So, then you go ahead with the same process for for these you know now you have three inputs and now you see what are your outputs. So, again pause here and then proceed. You will get this as outputs and then you can find out corresponding expressions for that then those expressions can be converted into circuits by using AND gates and OR gates and AND NOT gates and thing like that ok or XOR gates and thing like that ok. So, like that this is a implementation one of the implementations of the adder. Then this is another kind of a expression where you you do not want to use XOR gate. So, you have to have some simplifications done to get to these points and thing like that ok. So, you have this circuit coming up exactly the same kind of a implementation carried out by this circuit also and previous circuit also, but now there are some kind of a other simplifications in particularly here there are no XOR gates in this case ok. So, like that you can have some conditions put and find out circuits satisfying those conditions. So, there is a levels of implementation that that will also be another kind of a constraint that can come in ok. So, so we will not get again into details of these, but one can go into these different different kinds of aspect. So, these are the third implementation of the full adder kind of circuit. So, there are some kind of fundamental thumb rules for implementation of the circuits coming up mainly from the circuit design perspective which we are not too much interested in getting there. Because we just that full adder works like this is sufficient for us to know. Then you have a multiplexer ok. So, multiplexer has this you know input 0 and input 1 ok. So, two data inputs are there I O I O and 1 and control input is A depending upon value of A the one of the inputs is selected here ok. So, so you can see that this condition like say for example, I O is 0 and I this one is also 0 and value of A is 0 or 1 depending upon that if A is 0 I will select I 0 as a Z and if A is 1 I will select I 1 as a Z ok. So, like that that circuit will come up here ok. So, you fill up the entire table and then we will proceed. So, you will see this table something like this ok. So, even A is 0 it is selecting this input A is 1 it is selecting this input ok. So, so this inputs are like know these two cases could be possible where input is same I O and I O I 1 has some values which are same, but A is different ok. So, A is 0 it will select I think this is different is there. So, depending upon A is 0. So, A is 0 it should select I O or I 1 depending upon like know we will see what is getting selected here ok. So, here A is 0 it is selecting I 1 here and A is 1 it is selecting this here. So, here again same thing yeah. So, A is 0 it is selecting I 1 A is 1 it is selecting I 0 ok like that. So, so does not matter you can have your own way of having this also, but this is one particular kind of a definition like know depending upon A you are selecting the output and then you can directly write in terms of you know Z is I 0 or I 1. So, you can write it like this also directly. So, this implementation of this is again you can convert this into a circuit ok and you can have you know scaling of this multiplexers possible ok. So, 4 is to 1 multiplexer is here you have 4 inputs and 1 output is there ok. And out of these 4 you know 1 will be selected depending upon the select pins ok the select pins are inputs. So, now to have 4 inputs one of the 4 inputs selected you need to have 2 select pins and then you will have corresponding expression for Z ok. And so, this will not worry about this. So, think about this other problem this is a separate problem that you can use multiplexer instead of your AND or gates for implementation of some of the logic circuits or logic tables ok. So, this is a way the multiplexer can be implemented and you can give this I 0 I 1 I 2 at these are the inputs that are coming and then these are the select pins and depending upon the select pins you can have multiplexer implementation the Z output is coming ok. So, like that you can have many different other examples ok. So, maybe you can go through these selectors yourself this is go through this slides yourself you know this is same kind of a process we are repeating over and over again ok. So, then in a similar way you can have definition of comparator ok. So, you want to compare 2 numbers which are represented by one number is AB and other number is CD ok. So, AB are like you know 2 binary kind of bits of one number AB and bits of the other number are C and D ok. And then you need to kind of give the output if it is less and if it is more like you know you can have some kind of outputs that are possible. So, you can think of you know this implemented the truth table for this will come up something like that ok. So, AB and CD they are equal then this will be 1 if they are less if they are more that will be 1 like that it will have these 3 inputs coming out coming out a 3 outputs coming out of this circuit ok. Given based on these 2 or 4 inputs in terms of bits and then you will get this entire table represented and then you can find out further like you know how its circuit could be. Now, there are these other kind of output elements called 7 segment display ok. This is very important for mechatronics people ok. Because lot of these displays can be programmed with this understanding of the 7 segment display. This is nothing in this just a combinational kind of logic here ok. And you want to display say one here you need to see ok what are the these elements of this display to be you know these are basically ADDs they should be lightened up ok to display 1 or 0 or whatever value you want to display here. Depending upon that you will have multiple outputs and then you can have additional thing problem saying that ok look my binary number needs to be getting represented here ok. 8 binary numbers or 10 binary numbers from 0 to 9 should get displayed here starting from 0 0 0 0 to 1 0 0 1 ok. They need to get displayed here and appropriate kind of a fashion then like you know how do I kind of program this circuit which can do that ok. So, this is like you know BCD to 7 segment control decoder kind of circuit that we can design by considering this logic table now. We can fill up this logic table and again the same process is to be carried out and one can get like a big circuits to kind of implement this logic ok. And then so, these are so, these are these are different kinds of circuits that are possible and they are like you know done in the in the as a basic kind of circuits for these different elements. And then these elements now can be further put together to create your entire microprocessor ok. So, so, this is for example, you want to display 2 you want this LED and this LED this LED this LED and this LED to glow. So, that is what is given here ok. So, 2 is 1 0 representation in binary you know ABCD 4 numbers are represented like that and then you are corresponding you know this 7 segment display LEDs are glowing they are said as 1 and then you can get this number coming up there ok. So, to so, like that you can fill up entire table in the similar kind of a fashion and once this table is filled up then you can look at one output here and in terms of 4 inputs like know what combinational circuit will come up is what you can consider. So, so, one can do that I mean this very what you say simple, but tedious kind of a job when we go for like know this kind of a big circuits multiple such elements ok. So, these are these are the big expressions that are coming up here for example ok. So, now like know we will stop here for now and we will take up in the next class these sequential circuits ok.