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

The output Y of a 2-bit comparator is logic 1 whenever the 2-bit input A is greater than the 2-bit input B. The number of combinations for which the output is logic 1, is

The correct answer is

6

Comparator Function Explained

A 2-bit comparator is a digital circuit that compares two 2-bit binary numbers, say input A and input B, and determines their relationship (i.e., whether A > B, A < B, or A = B). In this specific problem, we are interested in finding the number of input combinations for which the output Y is logic 1, which occurs when input A is strictly greater than input B (A > B).

Input Combinations for 2-bit Numbers

Since both input A and input B are 2-bit numbers, each can represent values from 0 to 3 in decimal. Let's denote the 2-bit input A as \(A_1A_0\) and input B as \(B_1B_0\). The possible decimal values for A and B are:

  • 00 (0 in decimal)
  • 01 (1 in decimal)
  • 10 (2 in decimal)
  • 11 (3 in decimal)

The total number of possible input combinations for (A, B) is \(4 \times 4 = 16\).

Determining Logic 1 Output (A > B)

We need to list all possible combinations of A and B and identify the cases where A is greater than B. For these cases, the output Y will be logic 1. Let's examine each possible value of A and see which values of B make A greater than B.

Input A (Decimal) Input A (Binary) Input B (Decimal) Input B (Binary) Condition (A > B) Output Y
0 00 0 00 False 0
0 00 1 01 False 0
0 00 2 10 False 0
0 00 3 11 False 0
1 01 0 00 True 1
1 01 1 01 False 0
1 01 2 10 False 0
1 01 3 11 False 0
2 10 0 00 True 1
2 10 1 01 True 1
2 10 2 10 False 0
2 10 3 11 False 0
3 11 0 00 True 1
3 11 1 01 True 1
3 11 2 10 True 1
3 11 3 11 False 0

Counting Combinations for Logic 1 Output

From the table above, we can count the number of instances where the condition A > B is true, and consequently, the output Y is logic 1:

  • When A = 1 (decimal), B must be 0 (decimal). (1 combination: (A=01, B=00))
  • When A = 2 (decimal), B can be 0 or 1 (decimal). (2 combinations: (A=10, B=00), (A=10, B=01))
  • When A = 3 (decimal), B can be 0, 1, or 2 (decimal). (3 combinations: (A=11, B=00), (A=11, B=01), (A=11, B=10))

Summing these up:

Total combinations for Y = 1 = 1 + 2 + 3 = 6.

Therefore, there are 6 combinations for which the output of the 2-bit comparator is logic 1 (A > B).

Was this answer helpful?

Important Questions from Comparators

  1. X = X1X0 and Y = Y1Y0 are 2-bit binary numbers. The Boolean function S that satisfies the condition “If X > Y, then S = 1”, in its minimized form, is

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