 Comparator and parity checker. At the end of this session, student will be able to design ALU Comparator and Parity Checker. ALU provides fast arithmetic and logic functions. It handles larger words and it is a key part of many CPUs. This is one of the ALU unit 74181. So, here you can see A0 to A3. This is first input B0 to B3. This is one more input and this is optional input that is carry input. If we want to carry the last carry then we can make it on. Then we are having select input S0 to S3 means 4 bit inputs are there and it will be create 16 inputs. Then mode M it will be having different modes. Then this is the output and this is again supplementary outputs are there. We will see one by one how they are creating ALU unit. Now, as we have seen that selection modes are there S3, S2, S1, S0. So, we are having this 16 inputs. Then mode this is the mode control. So, when mode is high we are getting output logic functions and mode is low we are getting arithmetic function. Again in the arithmetic we are having with carry or without carry. So, we will see one by one. So, for this selection mode we will select it first A0 to A3 and B0 to B3. The inputs will be there for that when all S3, S2, S1, S0 all are 0 that time whatever the A input is given the invert it is inverting. So, this is the logic function for the inverter input A. Then next is there it is giving A plus B bar. So, this is the NOR function. Then next is there low, low, high, low at that time you are getting A bar B. So, these are different logic functions we are able to calculate with the help of this selection and this 7, 4, 1, 8, 1 ALU unit. Now for arithmetic functions as I said it is with carry or without carry. So, when CN is high there is no carry and CN is low with carry. What is the requirement of this carry is when we are having only nibble functions inputs are there. So, when we have to add with carry so it is automatically going for plus 1. So, arithmetic functions when all lows are there so it is as it is input is showing without carry but with carry it is showing that A plus 1. Now one more we will see that when it is S3 is low and other is high that time it is showing that functionality A B bar minus 1. And here it is showing with carry so it is A B bar. So, here we can calculate 2's complement also with the help of this combination low, low, high, high. So, it is having a minus 1 so it is a giving us 2's complement. So, there are 16 combination for the selection so that we can calculate 16 logic function 16 without carry and 16 with carry. So, total 48 arithmetic logic functions are there. So, for example, we are having here addition of A and B. A is 97 and B is 29 so these are 8 bits. But in this case we are having only a single nibble addition so at a time we can add 4 bits. So, here we are setting when lower bit addition we are doing we are putting mode is equal to 0. So, it will go to the arithmetic then S is equal to 1 0 0 1. So, this is nothing but addition in this operation we can see that A plus B is there. Then for this lower bit we put C n bar is equal to 0 here it is showing everything over here in this table. So, this is the A it is having mode 0 for arithmetic 1 0 0 1 it is for this addition selection. Then this is the lower nibble of A lower nibble of B and carry is put as 1 means it is with the no carry. So, it is giving output here. So, like this we are again doing the most significant. So, A B here we are considering carry and we are doing this total addition. So, next is example is of on the same numbers we are doing the minus. So, 0 1 1 0 that is the selection mode we are putting that then A and B and without carry we are doing this operation for the minus. And this is a one more function we are showing here example that is B it is again doing that plus and then here minus. So, there is one more function with the IC that is the comparator. So, here comparator is shown 7 4 8 5. So, here again we are using A 0 A 1 A 2 and A 3. So, total 4 bit numbers are there A 1 and B is 4 bit numbers. So, what is the function of this digital comparator digital comparator is comparing whatever the inputs are given. So, here we can see there are three different outputs it is showing A is greater than B A is equal to B or it is A is less than B. So, between any two numbers it is showing the comparison and as per that it is giving the output. So, if it is true then it is giving output as 1. So, here pin diagram is shown from 1 to 16. So, every pins number and its functionality is given. So, if it is A is greater than B A is equal to B like this and this is the truth table of this digital comparator. So, here we can see 1 or 2 example here 0 0 and B is at that time 0 0 means it is A is equal to B. So, here this A is equal to B is 1. Next if we see this example A is 1 0 and B is 0 means A is greater. So, here A is greater. So, these are output of the digital comparator. So, when our number is more than 4 bit that time we can cascade this digital comparator. So, this is the comparator 7485 here you can see that 7485 1 2 3 4 5. So, how your number is there or your requirement is there you are putting the digital comparator in the cascading and then total again you are connecting one more comparator here and the output will be this cascading output of this all this number. Now, we will see one more circuit or functionality that is a parity checker that is 74180. So, what is a parity checker? First we will see that parity checker is nothing but it is a circuit that checks the parity. So, it is called as a parity checker. So, when even parity is there means number of one in any number are in even numbers then it is called as a even parity. And when any number is there and it contains odd number of ones in that number then it is called as a odd parity. So, this parity checker 74180 will show that if your number is odd parity or even parity. So, the truth table is given over here. So, accordingly you are having the number that any number here 8 bit number is there. So, a b c d e f g that is any number it is providing to this and then if we are going to check if parity is even or odd. So, accordingly it is giving the output of that number and this two more pin are there for having cascading. If we want to cascade that parity checker I see then we can cascade with the help of this numbers. So, one question is there what is the use of above circuit? Here I am showing circuit is 74180. So, what is the use of this circuit? So, this circuit is nothing but parity checker as just explained about this parity checker. So, whatever the number given to you with the help of this IC it will provide you output if that number is having either even parity or odd parity.