Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

kindly explain me comparator question

Status
Not open for further replies.

moonnightingale

Full Member level 6
Joined
Sep 17, 2009
Messages
362
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,298
Activity points
3,832
I have understood solution of book as he has used exclusive Nor gates.
But lets suppose somebody is not knowing abt gates, how he will start to solve this question on paper. i mean how to make its table. i am confused abt it.
 

Attachments

  • Q1.jpg
    Q1.jpg
    82.6 KB · Views: 110

Each xor gate has the following truth table:
Ax Bx Out
0 0 1
0 1 0
1 0 0
1 1 1
So if Ax=Bx then the output is always 1

The AND gate has the followig truth table:
A B C D out(X)
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 0
1 0 1 0 0
1 0 1 1 0
1 1 0 0 0
1 1 0 1 0
1 1 1 0 0
1 1 1 1 1

So the only condition X is 1 is when all inputs to the AND gate are 1, which can only happen if A = B
 

A point of clarification. The gates on the left of your diagram are NOT xor gates, they are Ex-NOR gates. That being said, the truth table that Colbhaidh listed is correct for the Ex-NOR gate.
 

Here is an interactive comparator you can play around with: **broken link removed**. The circuit is different from yours, but the article should help you see things.
 

Hi, you could try a Karnaugh map to create an optimized combinatorial circuit:

b3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
b2 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0
b1 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0
b0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
-------------------------------------
aaaa
3210
0000 1
0001 1
0011 1
0010 1
0110 1
0111 1
0101 1
0100 1
1100 1
1101 1
1111 1
1110 1
1010 1
1011 1
1001 1
1000 1
NOTE: the 1s should be on the diagonal of the map; they did not paste property :(


x = (a3bara2bara1bara0barb3barb2barb1barb0bar) + ....

As you can see, this gets ugly very fast.

How about comparing individual bits?
b 0 1
a
0 1 0
1 0 1

From the map we have: bCompare = abar*bbar + ab

This is an exclusive NOR function

Since we need to compare four pairs of bits:

nibbleCompare = b0Compare & b1Compare & b2Compare & b3Compare

This is the circuit in your picture.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top