Download presentation
Presentation is loading. Please wait.
Published byArchibald Simmons Modified over 8 years ago
1
PHY 201 (Blum) Comparators
2
PHY 201 (Blum) 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
PHY 201 (Blum) Two will do Actually the first two will suffice, since the others are easily related to these – A B)) AND (NOT(A = B)) – A B (A > B) OR (A = B) – A B NOT(A > B) – A B NOT(A = B)
4
PHY 201 (Blum) One-bit comparator InputOutput AB=> 0010 0100 1001 1110
5
PHY 201 (Blum) Gate version
6
PHY 201 (Blum) 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
PHY 201 (Blum) 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
PHY 201 (Blum) 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
PHY 201 (Blum) 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
PHY 201 (Blum) 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
PHY 201 (Blum) 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
PHY 201 (Blum) 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
PHY 201 (Blum) 4-bit comparator
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.