All Exams Test series for 1 year @ ₹349 only
Question

A single bit comparator compares two numbers A and B and produces three outputs
Y 1(if A = B), Y 2(if A > B) and Y 3(if A < B) as given below:

A. Y 1= A ⊙ B; Y 2=AB̅; Y 3= A̅ B

B. Y 1= A ⊕ B ;Y 2  = AB; Y 3  =A̅ B̅

C. Y 1 = A + B; Y 2=A ⊕ B; Y 3=A ⊙  B

D. Y 1  =A̅  B̅  + AB; Y 2= A B̅ ; Y 3= A̅  B

Choose the correct answer from the options given below:

The correct answer is

A and D only

Understanding Single Bit Comparators

A single bit comparator is a combinational logic circuit that compares two single binary digits, A and B. It produces three outputs indicating the relationship between the two bits:

  • Y1: Output is high (1) if A is equal to B (A=B).
  • Y2: Output is high (1) if A is greater than B (A>B).
  • Y3: Output is high (1) if A is less than B (A<B).

Let's analyze the possible input combinations for A and B and determine the required output for Y1, Y2, and Y3. Since A and B are single bits, they can each be either 0 or 1.

Truth Table for a Single Bit Comparator

We can create a truth table to map the inputs (A, B) to the desired outputs (Y1, Y2, Y3).

A B Condition Y1 (A=B) Y2 (A>B) Y3 (A<B)
0 0 A = B 1 0 0
0 1 A < B 0 0 1
1 0 A > B 0 1 0
1 1 A = B 1 0 0

From the truth table, we can derive the Boolean expressions for each output:

  • Y1 (A=B) is 1 when A=0, B=0 OR A=1, B=1. This corresponds to the logical expression $\bar{A}\bar{B} + AB$. This is also the definition of the XNOR operation ($A \odot B$).
  • Y2 (A>B) is 1 only when A=1, B=0. This corresponds to the logical expression $A\bar{B}$.
  • Y3 (A<B) is 1 only when A=0, B=1. This corresponds to the logical expression $\bar{A}B$.

So, the correct Boolean expressions for a single bit comparator are:

  • Y1 = $A \odot B$ or $\bar{A}\bar{B} + AB$
  • Y2 = $A\bar{B}$
  • Y3 = $\bar{A}B$

Analyzing the Given Options

Now let's compare these derived expressions with the given options:

Option A:

  • Y1 = $A \odot B$ (Matches correct Y1)
  • Y2 = $A\bar{B}$ (Matches correct Y2)
  • Y3 = $\bar{A}B$ (Matches correct Y3)

Option A provides the correct expressions for all three outputs of a single bit comparator.

Option B:

  • Y1 = $A \oplus B$ (Incorrect for Y1; $A \oplus B$ is true when A != B)
  • Y2 = $AB$ (Incorrect for Y2; $AB$ is true when A=1 and B=1)
  • Y3 = $\bar{A}\bar{B}$ (Incorrect for Y3; $\bar{A}\bar{B}$ is true when A=0 and B=0)

Option B is incorrect.

Option C:

  • Y1 = $A + B$ (Incorrect for Y1; $A+B$ is true when A=1 or B=1 or both)
  • Y2 = $A \oplus B$ (Incorrect for Y2; $A \oplus B$ is true when A != B)
  • Y3 = $A \odot B$ (Incorrect for Y3; $A \odot B$ is true when A = B)

Option C is incorrect.

Option D:

  • Y1 = $\bar{A}\bar{B} + AB$ (Matches correct Y1, which is equivalent to $A \odot B$)
  • Y2 = $A\bar{B}$ (Matches correct Y2)
  • Y3 = $\bar{A}B$ (Matches correct Y3)

Option D also provides the correct expressions for all three outputs of a single bit comparator, using an equivalent form for Y1.

Therefore, both Option A and Option D correctly describe the outputs of a single bit comparator.

Conclusion on Correct Options

Based on the analysis, options A and D correctly define the outputs of a single bit comparator ($Y_1$ for equality, $Y_2$ for A>B, and $Y_3$ for A<B).

The question asks to choose the correct answer from the options provided, which are combinations of A, B, C, and D. The analysis shows that A and D are correct. Looking at the given options for the final answer, the one stating "A and D only" aligns with our findings.

Revision Table: Single Bit Comparator

Input A Input B Output Y1 (A=B) Output Y2 (A>B) Output Y3 (A<B) Option A Logic Option B Logic Option C Logic Option D Logic
0 0 1 0 0 Y1=1, Y2=0, Y3=0 (Correct) Y1=0, Y2=0, Y3=1 (Incorrect) Y1=0, Y2=0, Y3=1 (Incorrect) Y1=1, Y2=0, Y3=0 (Correct)
0 1 0 0 1 Y1=0, Y2=0, Y3=1 (Correct) Y1=1, Y2=0, Y3=0 (Incorrect) Y1=1, Y2=1, Y3=0 (Incorrect) Y1=0, Y2=0, Y3=1 (Correct)
1 0 0 1 0 Y1=0, Y2=1, Y3=0 (Correct) Y1=1, Y2=0, Y3=0 (Incorrect) Y1=1, Y2=1, Y3=0 (Incorrect) Y1=0, Y2=1, Y3=0 (Correct)
1 1 1 0 0 Y1=1, Y2=0, Y3=0 (Correct) Y1=0, Y2=1, Y3=0 (Incorrect) Y1=1, Y2=0, Y3=1 (Incorrect) Y1=1, Y2=0, Y3=0 (Correct)

Additional Information: Digital Comparators

Comparators are fundamental building blocks in digital logic used for comparing the magnitudes of binary numbers. While a single-bit comparator handles just two bits, multi-bit comparators compare numbers with two or more bits. Multi-bit comparators can be built by cascading single-bit comparators or using dedicated integrated circuits.

For comparing multi-bit numbers (e.g., A = An-1...A1A0 and B = Bn-1...B1B0), the comparison logic starts from the most significant bit (MSB). For A to be greater than B (A>B), either the MSBs are unequal with An-1 > Bn-1, or the MSBs are equal and the next lower bits satisfy the condition An-2 > Bn-2, and so on. Similar logic applies to A<B. A=B if and only if all corresponding bits are equal (Ai = Bi for all i from 0 to n-1).

The outputs of a comparator are typically used in control systems, arithmetic logic units (ALUs), and sorting networks.

Was this answer helpful?

Important Questions from Encoder

  1. A 4-bit priority encoder has inputs $D_3, D_2, D_1$, and $D_0$ in descending order of priority. The two-bit output AB is generated as 00, 01, 10, and 11 corresponding to inputs $D_3, D_2, D_1$, and $D_0$, respectively. The Boolean expression of the output bit B is ___________.

  2. For an encoder, if the number of output lines is m, then the number of input lines will be _______ .

  3. The three outputs \(x_{1}x_{2}x_{3}\) from the \(8 \times 3\) priority encoder are used to provide a vector address of the form \(101x_{1}x_{2}x_{3}00\). What is the second highest priority vector address in hexadecimal if the vector addresses are starting from the one with the highest priority ?

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App