# Designing a 2-bit Comparator with NOR gates

• peroAlex
In summary, @phinds pointed out that this problem has incorrect notation and @berkeman verified the notation. @berkeman also verified that his minimal circuit should be different than what he has uploaded.
peroAlex
At our class on digital structures, this assignment has been given. It's a preparation for upcoming lab work, and I'm not sure my design is correct. Is anyone please willing to check it out?
1. The problem statement, all variables, and given/known data
Design a two-bit comparator using NOR gates exclusively. Your circuit should yield 1 when ## A \geq B ##.

## Homework Equations

I'm not sure any equations can be put here.

3. The Attempt at a Solution

I uploaded multiple files which are directly excreted from a PDF file I have to attach to my assignment. I hope it is not pesky!
I began by writing a truth table. In the next step, I proceeded with writing down conjunctive normal form (CNF) and minimizing it in the next step. To obtain the minimal conjunctive normal form (MCNF), I did use Mathematica to aid me with simplification. To obtain the logical formula that resembles NOR gate operation, MCNF has to be negated twice and solved using de Morgan theorem.
In the last step, circuit design. Using KiCad, I drew a circuit that implements only NOR gates.

If you see any fallacies, please let me know. I hope you're having a wonderful Saturday!

#### Attachments

2.5 KB · Views: 864
13.5 KB · Views: 845
9.8 KB · Views: 2,289
Why do you have any inputs other than A and B ? I think you are making this into something it is not.

peroAlex and berkeman
Yeah, what are A3 and A4 in your Drive3 diagram?

peroAlex
First, I shall reply to @phinds. A task we were given states that inputs A and B consist of two bits, namely A1, A0 and B1, B0. I should also note I have no experience building circuits, so it is possible my comprehension of the problem is completely fallacious.

@berkeman, thank you for pointing out my superficial mistake! It should be
A1 ... A1
A2 ... A0
A3 ... B1
A4 ... B0
I will check my derivation again, it could be I missed more than that.

OK, I checked my derivation again, this time using a much more appropriate notation. In Mathematica, I've written down this expression (please check the truth table):
(a1 || a0 || b1 || (! b0)) && (a1 || a0 || (! b1) || b0) && (a1 || a0 || (! b1) || (! b0)) && (a1 || (! a0) || (! b1) || b0) && (a1 || (! a0) || (! b1) || (! b0)) && ((! a1) || a0 || (! b1) || (! b0))
I simplified it and obtained (a0 || a1 || ! b0) && (a0 || ! b0 || ! b1) && (a1 || ! b1). This means that my circuit should look completely different!

peroAlex said:
First, I shall reply to @phinds. A task we were given states that inputs A and B consist of two bits, namely A1, A0 and B1, B0.
And yet you have used the NEGATIVE of a couple of those as thoughthey were part of your allowed inputs.

Those are easily made using a NOR gate as an inverter so not a major problem. The other problem is worse.

CWatters said:
Those are easily made using a NOR gate as an inverter so not a major problem. The other problem is worse.
Of course, which is what he should have done. I'm just point it out to him. He seems to think they are part of the allowed input, not that he has to derive them.

## 1. How do I design a 2-bit comparator with NOR gates?

To design a 2-bit comparator with NOR gates, you will need to use a combination of NOR gates and inverters. Start by drawing a truth table for all possible inputs and outputs. Then, use Karnaugh maps to simplify the Boolean expressions for each output. Finally, implement the simplified expressions using NOR gates and inverters to create the desired 2-bit comparator.

## 2. What is the purpose of a 2-bit comparator?

A 2-bit comparator is used to compare two 2-bit binary numbers and determine if they are equal, or if one number is greater than or less than the other. This is useful in many digital circuits, such as in arithmetic operations or in control logic.

## 3. What is the difference between a 2-bit comparator and a 4-bit comparator?

A 2-bit comparator can compare two 2-bit binary numbers, while a 4-bit comparator can compare two 4-bit binary numbers. This means that a 4-bit comparator can handle a larger range of numbers and is more complex in its design.

## 4. Can I use other logic gates to design a 2-bit comparator?

Yes, you can use other logic gates such as AND, OR, and XOR gates to design a 2-bit comparator. However, using NOR gates is a common and efficient method for designing a 2-bit comparator.

## 5. How do I test if my 2-bit comparator is functioning correctly?

You can test your 2-bit comparator by inputting different combinations of 2-bit binary numbers and comparing the outputs to the expected results based on the truth table. Additionally, you can use a digital logic analyzer to observe the signals and ensure they are functioning as expected.

Replies
4
Views
5K
Replies
2
Views
1K
Replies
7
Views
11K
Replies
9
Views
2K
Replies
10
Views
3K
Replies
4
Views
4K
Replies
1
Views
2K
Replies
4
Views
3K
Replies
5
Views
2K
Replies
6
Views
2K