 Hello everyone, Myself Prithviraj P. Thambay working as an assistant professor in Department of Electronics Engineering at Valjean Institute of Technology, Solapur. Let us today learn about digital comparators. We will design one bit comparator. So at the end of this session, students will be able to examine the working of digital comparators. Also, they can design one bit comparator. So let us understand what is a comparator. So comparator is a commissive device which is used to compare two n-bit binary numbers which determines whether one number is greater than or equal to or less than the other number. So it basically compares relative magnitude of digital digits starting from most significant position until a pair of unequal digits received, reached. So let us design a one bit comparator. So step one is the specification or the requirement. So one bit comparator has two inputs, both are one bit and three outputs. So here you will see that in the block diagram, you have a0, b0, two bits and you have output. So a0 is greater than b0 or a0 is equal to b0 or a0 less than b0. Next step is the truth table. Now let us derive the truth table for this one bit comparator. So truth table contains two input columns and three output columns. And it also defines the required comparison between the two input numbers. So let us calculate the total number of possible comparisons you can have with two one bit binary numbers. Yes, so we have four comparisons. So the derived truth table looks like this. So this is the first case where a0 and b0 both the values are 00 and both are equal. So that's why we have a0 is equal to b0 output is equal to 1. And remaining a greater than b and a less than b are 00. Next case is a0, b is 1. Here you will start b is greater than a. So that's why third output which is a less than b is 1. Third case a is 1, b is 0. Here a is greater than b. That's why a is equal to b and a less than b are 00. Last case where again a and b are equal but the value here are 11. So again a equal to b output is equal to 1 and the remaining outputs a greater than b and a less than b are 00. Now we have a truth table with us. Now let us go for the third step simplification. So for simplification we require K maps. So derived simplification Boolean function for each output as a function of input variables with the use of K map and this truth table. So let us derive the output of first output a0 is greater than b0. Now a0 greater than b0 output column looks like this. So we required here two variable K map which is made up of four squares. Now after putting these values in the K map you will see that there is no pairing possible because there is only one midterm. That's why only one group and the equation for this group is a0 b0 bar. Now let us go for the next output a is equal to b. So we have here two midterms again two variable K map after placing the midterms in the K map you will see that there is again no pairing possible. That's why we have here two groups g1 and g0. So for g1 the equation is a0 bar b0 bar and for g2 you have a0 b0. So your final equation will look like a0 bar b0 plus a0 b0. Third output a less than b so the truth table will look like this. Again here we have only one midterm. So after placing these in the two variable K map you will see that there is no pairing possible. That's why we have a single group here and the equation for this is a0 bar b1 b0. So the equation is a0 b0 bar so the equation is a0 bar b0. So a0 less than b0 output equation is a0 bar b0. Now last step is the implementation step. So we required here to draw a logic diagram by using gates. Now let us implement this or let us calculate the total number of basic gates required to implement all these three functions. So if you observe these carefully for a0 greater than b0 you required one AND gate. You required one AND gate and one INVERTER. For a0 is equal to b0 you will see that here you have two AND terms and one OR term and two INVERTERs for a0 and b0. And for a0 less than b0 again you required one AND gate and one INVERTER. Now let us calculate total number of basic gates. So you required two INVERTERs one, two, three, four AND gates and one OR gate. So the total count is 7. So this total count is equal to 7. But can you still reduce this number count? So instead of basic gates can I use a XNOR gate here? So yes you can use XNOR gates so that the total number of gate counts gets reduced. So yes here the equation is a0 bar b0 plus a0 b0 which is nothing but a XNOR gate. a0 XNOR b0 is for your a is equal to b and a0 bar b0 is for your a0 less than b0. So total number of gates here are now one, two, three, four and five. So instead of seven you have designed the same circuit one bit comparator using only five gates. Thank you.