comparator

Thread Starter

zulfi100

Joined Jun 7, 2012
656
Hi,
I dont know about comparator. I saw the circuit but its difficult to understand. Kindly guide me about comparator. I have got following question:
The binary numbers A=1100 and B=1001 are applied to the inputs of a comparator. What would be the output levels?

Zulfi.
 

nepdeep

Joined Sep 14, 2011
140
As far as I know....depends on the comparator....is it the comparator that compares the greatest or smallest or equal....depending on the type comparator gives either true(high) or false(low) result
 

tshuck

Joined Oct 18, 2012
3,534
Which is compared to which? Is A compared to B, or B compared to A? A simple comparator tells you if input X is greater than input Y...
 

WBahn

Joined Mar 31, 2012
33,186
And does the comparator treat the input as unsigned binary or signed binary? If signed binary, what representation is assumed?
 

Thread Starter

zulfi100

Joined Jun 7, 2012
656
Hi,
Thanks for the replies but i have additional questions.

Kindly guide me about the output levels also. I think there should be only one output level and output would be in terms of 0 and 1. But how we get this value? Kindly guide me.

Zulfi.
 

WBahn

Joined Mar 31, 2012
33,186
Hi,
Thanks for the replies but i have additional questions.

Kindly guide me about the output levels also. I think there should be only one output level and output would be in terms of 0 and 1. But how we get this value? Kindly guide me.

Zulfi.
Then please kindly answer the questions that have been asked about the comparator you are asking about.
 

Thread Starter

zulfi100

Joined Jun 7, 2012
656
Hi,
Thanks for asking for the feed back
Which is compared to which? Is A compared to B, or B compared to A?
I think A is compared to B.
And does the comparator treat the input as unsigned binary or signed binary? If signed binary, what representation is assumed?
The document does not say about signed numbers.
The binary numbers A=1100 and B=1001 are applied to the inputs of a comparator. What would be the output levels?
A>B

Kindly guide me.


Zulfi.
 

WBahn

Joined Mar 31, 2012
33,186
In your first post you said that you saw the circuit. But you are asking us to explain to you a circuit we have not see. If it is a standard part, give us the part number so that we can look it up. Otherwise please post the circuit schematic. It's important that we be talking about the same circuit.
 

Thread Starter

zulfi100

Joined Jun 7, 2012
656
Hi,
I saw the circuit on web initially (wiki) which i was not able to understand as it had lot of electronics. Then i saw the circuit (datasheet) provided to me by ScottWang earlier in this thread. I am referring to that circuit in my answer. I want to get answer for the following question:

The binary numbers A=1100 and B=1001 are applied to the inputs of a comparator. What would be the output levels?

Which i thought is A>B but i am not able to undersatnd about the use of signed numbers in this context as the circuit provided by Scottwang (datasheet) does not discuss it.

Kindly guide me. I am grateful for you people in taking interest in my problem. Well done.

Zulfi.
 

ScottWang

Joined Aug 23, 2012
7,505
The answer is at the fifth line of the truth table that I linked, that is item 2 for compares.

The meaning of A>B=1 is represent a high level, 0 is a low level.

|A3 = B3 | A2 > B2 | x | x | x | x | x | 0 | 0 | 1 | ← The last 1 = high level.
 

WBahn

Joined Mar 31, 2012
33,186
Okay, so you are talking about an MC14585. Fine.

Notice the name of the device - "4-Bit Magnitude Comparator"

It compares magnitudes, thus the four bits are an unsigned integer.

The logic diagram is given in the data sheet, so you can always just walk your inputs through the logic and see what the outputs will be.
 

Thread Starter

zulfi100

Joined Jun 7, 2012
656
Hi,
Yes i found. I would say its the second entry. I now realize that we have to compare the individual bits. But in the exam do we need to remember the entire table? Its simple to notice that 12(i.e A)> 9 (i.e B). If we had 9 (i.e A) & 12 (i.e. B) then A>B=0, A=B equals to 0 and A<B=1. Should we tell all the three outputs???

Zulfi.
 

WBahn

Joined Mar 31, 2012
33,186
If you understand the function of the circuit, then answering in terms of the functionality should be fine unless the question specifically (or within the context of the exam) is looking for a more low-level answer. Yes, I would say you should give all three outputs. You should probably also specify what the other inputs to the circuit should be in order for your answer to be valid.
 

ScottWang

Joined Aug 23, 2012
7,505
If you understand the function of the circuit, then answering in terms of the functionality should be fine unless the question specifically (or within the context of the exam) is looking for a more low-level answer. Yes, I would say you should give all three outputs. You should probably also specify what the other inputs to the circuit should be in order for your answer to be valid.
Talking about a digital comparators, they should be using bin to compares for each bit step by step, they comparing from the Most significant bit of 4 bits, that is the Leftmost bit as b3, and b2,b1,b0.

The answering is according to conditions of the inputs and outputs, if in your exam already setup the input and ouput bits conditions.

During A,B two nibbles comparing when which b3 of nibble is bigger one, then that nibble is the bigger one, so the I/O as this:
1. The input as : A>B
a) A3=1.
b) B3=0.
c) The other inputs just don't care.

2. The output :
a) A<B = 0.
b) A=B = 0.
c) A>B = 1

Otherwise you should go to compare the next bit - b2.

In another way.
1. The input as : A<B
a) A3=0.
b) B3=1.
c) The other inputs just don't care.

2. The output :
a) A<B = 1.
b) A=B = 0.
c) A>B = 0.

Otherwise you should go to compares the next bit - b2,

Using the way as above to comparing b2,b1,b0.

Byte = 8 bits
Nibble = 4 bits.
One Byte = Two nibbles.
 

Thread Starter

zulfi100

Joined Jun 7, 2012
656
Thanks a lot, all of you for giving me so much time. Its really appreciating that you people tried to clear my concepts.

Zulfi.
 
Top