Q-Can we implement higher comparator 4-bit comparator using 2-bit comparators.
Ans: Yeswe can implement the above required as follow:
Firstly lower two bits of A & B are compared and then next bits and then next. We feed the result of first 2 bits to lower bit of next comparator. Then we feed the result of this comparator to lower bit of next comparator. This way with the use of 3 2-bit comparators we get 4-bit comparator.
e.g. Compare A=10112 and B=10102
We firstly compare 11 (A1A0) and 10 (B1B0) and we get a HIGH at f (A>B). Hence we put a HIGH at A0 & a LOW at B0 and A2 & B2 at A1 B1 pins of next comparator. So if A2 is greater than B2 then we get a high at f(A>B) for 3 bits and if A2 is less than B2 then we get a high at f(A<B) for 3 bits and if A2 is equal to B2 then we compare A0 and B0. Similarly we repeat this and get the result.
Similarly we can obtain other higher bit comparators.