Categories

## Q2: Obtaining HIGHER COMPARATOR using LOWER COMPARATOR

Q- Implement the function of 10-bit comparator using 4-bit comparators.

Ans: We can implement this as follow:

Categories

## Obtaining HIGHER COMPARATOR using LOWER COMPARATORS

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 & Bat 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.

Categories

## 2-bit COMPARATOR

Similarly we can have 2 bit comparator and the table to list all the combinations at input and their corresponding outputs is as:

A             B             f (A>B)  f (A=B) f (A<B)

00           00           0              1              0

01           00           1              0              0

10           00           1              0              0

11           00           1              0              0

00           01           0              0              1

01           01           0              1              0

10           01           1              0              0

11           01           1              0              0

00           10           0              0              1

01           10           0              0              1

10           10           0              1              0

11           10           1              0              0

00           11           0              0              1

01           11           0              0              1

10           11           0              0              1

11           11           0              1              0

And we get the equations for all three outputs from the K-maps as

We can also obtain these equations orally as for A1A0 to be greater than B1B0 either A1 is greater than B1 (i.e. A1=1 & B1=0) or A1 is equal to B1 (or A1is not less than B1 i.e. (f(A1<B1))’ = (A1’B1)’= (A+ B1‘) & A0 is greater than B0 (i.e. A0=1 & B0=0).

Hence the equation we get is f (A>B) = A1B1‘+ (A1 + B1’) A0B0’ = A1B1‘+ A0 B1’B0’+ A1A0B0

We can also get the equation orally similar to the above case. Now we can implement the above equation easily. Similarly we can implement other higher comparators

Categories

## 1 bit COMPARATORS

Here we’ll be designing circuits to compare different binary numbers.  Suppose we have two numbers A & B at the input and 3 output as A>B, A=B, A<B and only one of the three outputs would be high accordingly if A is greater than or equal to or less than B.

1-bit comparator: Let’s begin with 1 bit comparator and from the name we can easily make out that this circuit would be used to compare 1 bit binary numbers. If we list all the input combinations at the input then we get the following table describing the corresponding outputs.

A             B             f (A>B)  f (A=B) f (A<B)

0              0              0              1              0

1              0              1              0              0

0              1              0              0              1

1              1              0              1              0

And now we find the equations using K-maps each for f (A>B), f (A=B) and f (A<B) as follow: