Design problem: How do you detect if two 8-bit numbers/signals are equal

Here, the problem involves detecting if each bit of a signal is equal to corresponding bit of the other signal and then generating a resultant. First of all, the circuit which provides equivalence of 1-bit is nothing but an XNOR gate as explained here. So, we require 8 XNOR gates to judge equivalence of individual bits. Even if one of the bits is "0", it means the numbers are not equal, which can be obtained by ANDing the eight bits together.



Alternatively, we can use an XOR gate as well. An XOR gate provides output as "1" if the two inputs are not equal as explained here. Even if one of the 8 individual XOR gates provides output as "1", it will mean that the numbers are not equal, which can be obtained by NORing the eight bits together.



Can you judge which of these can be implemented with less area and power?

4 comments:

  1. The implementation with xnor will have less area & power. Is that correcT?

    ReplyDelete
    Replies
    1. Hi PJ

      Yes, correct thinking, since AND Gate is involved there instead of NOR gate. But overall, it depends upon the implementation as well since internally you may find a way implement 8-input NOR gates with NMOS dominant logic as well. :-)

      Delete
  2. If any one output of the nor gate is 0 we need not check the other values. Thereby reducing power.

    ReplyDelete
    Replies
    1. Hi

      It doesn't work this way. The complete logic has to be always there. And will evaluate in real-time all the bits for equality.

      Even if we assume that it can be done. The same argument that if any output of XOR gate is 1, we do not need to check for other values. So, this cannot be taken as an argument for one being better than the other in my opinion. We can discuss more. :-)

      Delete

Thanks for your valuable inputs/feedbacks. :-)