 Namaste welcome to the session design of combinational logic circuit. At the end of this session students will be able to design a combinational logic circuit. In this session we are going to see combinational logic circuit and we are going to design a substractor circuit. So before proceeding further take a pause here and recall what is combinational logic circuit which we have discussed in the last session. So I think you have recalled what is combinational logic circuit. So combinational logic circuit has n number of inputs let us consider A0 to An-1 and m number of outputs let us consider Y0 to Ym-1. So in case of combinational logic circuit outputs at any instant of time depends on the inputs present at that instant only. So it means that output of a combinational logic circuit does not depend upon previous or past values of input or output. So there is no need of memory so it has no memory element. In case of combinational logic circuit there will be no effect of sequence in which inputs are applied on the output. So these are properties of combinational logic circuit. So let us design a substractor circuit. So there are two types of substractor circuits half substractor and full substractor. In today's session we are going to discuss about half substractor. So what is a half substractor? So it is also a combinational logic circuit which substracts second single bit binary number from the first single bit binary number. So before designing substractor circuit one should know binary subtraction rules. So let us see. So 1-1 gives us difference 0 and no borrow. So in case of 1-0 difference is 1 and there will be no borrow 0-0 difference is 0 with no borrow. When it is 0-1 it is not possible to substract 1 from the 0. So here we have to take borrow and then difference will be 1. So based on these rules we can draw the block diagram. So here in this block diagram we have a and b as two single bit inputs and it will give output as difference as d and borrow out as b-0. In the next step we are going to write truth table for the half substractor. So in the truth table it will include all the possible combination of inputs and respective output. So as we have two single bit inputs a and b so there will be four combination such as 0-0, 0-1, 1-0 and 1-1. So for 0-0 there will be no difference and borrow out. When a is 0 and b is 1 we require here borrow. So borrow out is 1 and it will give us difference as 1. So when a is 1 and b is 0 we will get difference as 1 and borrow as 0. And when a and b both are 1-1 difference and borrow out will be 0-0. So after observing this truth table we can conclude that we are getting difference for two combinations. First combination is when a and b are 0-1 and second combination is when a and b are 1 and 0 respectively. And we are getting borrow out for the combination when a is 0 and b is 1. So from this truth table we can write logic equations for half substractor. So logic equations are written for all the outputs. So here we have two outputs first output is difference. So let us write equation for difference. So difference d is equal to a bar b plus a b bar. So it is written also as summation m in the bracket 1, 2. Now let us write equation for borrow out. So as we are getting borrow out for only one combination. So equation becomes borrow out b o is equal to a bar b also written as summation small m in the bracket 2. So based on logical equations we can draw logic circuit for half substractor. So again let us consider these two equations difference d which is obtained as a bar b plus a b bar. So this is nothing but XOR operation. So this equation can be written as a XOR b and borrow out b o is equal to a bar b. So from these two equations we require two gates one is XOR and other one is AND gate along with that we require one NOT gate. So let us draw logic circuit for the half substractor. So a and b input are given to the XOR gate which give us difference and when a is given to the NOT gate and applied to the AND gate along with b input as it is this will give us borrow out. So this is logic diagram for half substractor. So let us simulate the same circuit in a software called as PROTIS. So in PROTIS we can select here schematic capture where we can draw the half substractor by clicking on P where place component. So I am selecting here 7486 which is XOR gate. So after selecting that place it at a proper position. Let us give name to this component as XOR. Again let us place a component which is AND gate 7408. Select a 7408 from the list and place it at a proper position. So again let us change the name of this component as AND gate. Now one more component which is required is NOT gate 7404. Select a 7404 from the list. Place it at a proper position. Let us change the name as NOT gate. Now we require two inputs a and b. So here you have to put it as a logic state from which we can give input as a and b. So let us change the name here as a and b. So we have here two binary inputs a and b. Now after this we have to make connections. So select wire and make a proper connection to XOR gate we require a and b. The same input a is applied to NOT gate from NOT gate to make connection to the one of the input of AND gate. Then let us connect b to second input of AND gate. Then to observe the output we require oscilloscope here. So choose oscilloscope here. Now you can see here there are four channels a b c d. So I am connecting output of difference to channel a and output of bar out to the channel b. So just click on the run button. So you can see here output of oscilloscope yellow as a output b as blue output. So yellow output is giving us difference and blue output is giving us as bar out. So when both are 0 0 a and b so output is 0 0 when a is 1 b is 0 you can get 1 and 0 output. So you can see here when both are 1 1 we are getting 0 0. When a 0 b is 1 we are getting both difference and bar out 0 0 these are references thank you.