1 / 13

Comparators

Comparators. What is it?. A comparator is circuitry that compares two inputs A and B, determining whether the following conditions are true or false A = B A > B A < B A  B A  B A  B. Two will do. Actually the first two will suffice, since the others are easily related to these

emurdock
Download Presentation

Comparators

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Comparators

  2. What is it? • A comparator is circuitry that compares two inputs A and B, determining whether the following conditions are true or false • A = B • A > B • A < B • A  B • A  B • A  B

  3. Two will do • Actually the first two will suffice, since the others are easily related to these • A < B  (NOT(A > B)) AND (NOT(A = B)) • A  B  (A > B) OR (A = B) • A  B  NOT(A > B) • A  B  NOT(A = B)

  4. One-bit comparator

  5. Gate version

  6. Comparing word equality • To compare if two words are equal, you pair up the bits holding the same position in each word, and each individual pair must be equal for the words to be equal. • 1100 and 1110  {(1,1),(1,1), (0,1), (0,0)} are not equal • 1100 and 1100  {(1,1),(1,1), (0,0), (0,0)} are equal

  7. Comparing word inequality • Assume unsigned integers, then • If the most significant bit of word A is greater than the most significant bit of word B, then word A is greater than word B. • If the most significant bit of word A is less than the most significant bit of word B, then word A is less than word B. • If the most significant bit of word A is equal to the most significant bit of word B, then we must compare the next most significant bits.

  8. And so on • If the most significant bits are equal, one compares the next-most significant bits. • Then if the next most significant bits are equal, one compares the next-next-most significant bits, and so on. • It seems that one must know the outcome of testing the more significant bits before one proceeds to the less significant bits.

  9. Timing issues • In terms of circuitry, this would seem to require many layers, the output of one layer being fed into the next layer. • There would seem to be as many layers as there are bits in the word. • Each layer of circuitry requires time to settle into the desired state. • More layers means more time.

  10. Scaling • If the comparing is to be done in one clock cycle, this clock’s period restricts the size of the word that can be compared. • It is said that such circuitry “does not scale,” that is, changing the word size produces (timing) problems not seen in the smaller word size.

  11. Combinatorial scaling • Recall that combinatorial logic is expressible in terms of a truth table. • Recall our procedure to realize a truth table as a circuit: we focus on the true (1) outputs, etc. • Thus logical circuits really require only three layers: inverting the inputs, ANDing inputs or inverted inputs, ORing the output of the AND gates

  12. Complexity • Sometimes the price one pays to have a circuit that scales is loss of simplicity. • There are fewer layers, but more going on in a given layer. • There are other possible problems, • The scaling circuit may have a given input attached to many gates. • A given gate may have many inputs. • Potential power problems.

  13. 4-bit comparator

More Related