Now, let us have some examples for these complex gates assume I want to compare two numbers if they
are equal and believe me, this small circuit is used everywhere and logic design everywhere in electronics
as well.
There is a separate circuit in every CPU that checks this small thing right here.
So let's assume that we have two numbers and I want to check if they are equal.
So how can we check that?
Let us design this with x n the black box should look something like that.
I have two numbers that I want to compare.
Each number is four bits, right?
So my first number here is for bits as you one, eight, three, and my second number is also forbids
busy.
What do you want me to be?
Three.
And I want the circuit to shoot one here at the output if these four equals these four.
Otherwise I wanted to shoot zero.
Let's see.
Now, remember, the X no gate is the gate that checks if two numbers or two bits are equal, right.
So I want to check if this bit equals this, but this one equals this one.
This one equals this one and this one equals this one.
Is that correct?
If all of these four bits are equal, then.
Well, I can have an output of one, so I need four X nor Gates to do that.
Right.
One, two, and three, four, I want to check A zero and B zero, a one, B one, A to be two and A
three be three.
And I'm going to have four results right here.
Right, if those four results, all of them have shorted one meaning, yes, these two are similar and
these two and these two and these two, well then I should be getting an output.
So how can I combine a result if all of them together are shooting one?
Well, I need an answer.
So you combine this result.
I'm going to need an end gate like that.
And here is my.
So this is how I could compare two numbers I need for next door gates and one and gate, the external
gate is going to compare the individual bits.
If they are equal, then if all the individual bits are the same, then I should add one.
Now, if any of this is not equal meaning, let's say that here I have one zero one zero, but here
I have one zero one one.
So here I have one one.
It means that this is a three right here is not going to shoot one because, well, these two numbers
are not similar.
So I will get a zero right here, meaning that this gate will not shoot at all.
Right.
It means that these two numbers are not equal.
And by that, we have designed a small circuit in order to compare to numbers.