1. State the job precisely
Let A = A₁A₀ and B = B₁B₀ be unsigned two-bit values, each ranging from 0 to 3. A₁ and B₁ are the most significant bits. Create three outputs: G for A > B, E for A = B and L for A < B. For binary inputs, exactly one output must be 1.
2. Compare the most significant bits first
If A₁ = 1 and B₁ = 0, A is greater regardless of the lower bits. If A₁ = 0 and B₁ = 1, A is smaller. Only when the upper bits match do A₀ and B₀ decide the result.
Define X₁ as A₁ XNOR B₁ and X₀ as A₀ XNOR B₀. An XNOR output is 1 when its inputs are equal.
E = X₁ AND X₀
L = (NOT A₁ AND B₁) OR (X₁ AND NOT A₀ AND B₀)
The second term in G and L is gated by X₁: lower bits matter only when the upper bits are equal.
3. Verify all input pairs
| A₁A₀ | B₁B₀ | G | E | L |
|---|---|---|---|---|
| 00 | 00 | 0 | 1 | 0 |
| 00 | 01 | 0 | 0 | 1 |
| 00 | 10 | 0 | 0 | 1 |
| 00 | 11 | 0 | 0 | 1 |
| 01 | 00 | 1 | 0 | 0 |
| 01 | 01 | 0 | 1 | 0 |
| 01 | 10 | 0 | 0 | 1 |
| 01 | 11 | 0 | 0 | 1 |
| 10 | 00 | 1 | 0 | 0 |
| 10 | 01 | 1 | 0 | 0 |
| 10 | 10 | 0 | 1 | 0 |
| 10 | 11 | 0 | 0 | 1 |
| 11 | 00 | 1 | 0 | 0 |
| 11 | 01 | 1 | 0 | 0 |
| 11 | 10 | 1 | 0 | 0 |
| 11 | 11 | 0 | 1 | 0 |
4. Work through a case
For A = 10 and B = 01, the upper bits differ: A₁ = 1 and B₁ = 0. Therefore G = 1, E = 0 and L = 0. For A = 10 and B = 11, the upper bits match, but A₀ = 0 and B₀ = 1. Therefore L = 1.
5. Draw the circuit from the equations
Use XNOR gates to obtain X₁ and X₀. Build the equality output with an AND gate. Build each greater/less output with two AND terms feeding an OR gate, adding the required input inversions. Label the bit order and output meanings; gate symbols alone do not explain the design.
Check yourself
- Can you explain why comparing the lower bits first gives a wrong answer for A = 10, B = 01?
- When A = B, do both G and L evaluate to 0?
- Have you stated that the inputs are unsigned? Signed two-bit values have a different ordering.
Source relationship
The official BEC302 Model I includes a comparator design task at Q3(a), Module 2. This note is our own explanation of that topic; it does not establish an actual exam appearance or prediction.
See the model-paper topicAuthor: VTU Prep · Academic reviewer: not yet assigned · Source checked 3 November 2026. Report corrections through About & contact.
