digital comparator

Discussion in 'General Electronics Chat' started by shivashankari.c14, Apr 29, 2010.

  1. shivashankari.c14

    Thread Starter New Member

    Apr 6, 2010
    Hi tel me the concept of digital comparator and how it works?Also suggest some ic for the digital comparator..........Thank u
  2. hgmjr

    Retired Moderator

    Jan 28, 2005
    It sounds like you are referring to what is called a magnitude comparator.

    Here is a link to the datasheet for such a device. See if this is what you had in mind.

  3. t06afre

    AAC Fanatic!

    May 11, 2009
    In a simpler form it would be the xnor gate. You find more about the xnor gate using Google
  4. kkazem

    Active Member

    Jul 23, 2009
    Hi all,
    In order to get a digital magnitude comparator, we first need to know the format of the digital signal. For this example, lets say we're using a single hexidecimal digit = 4 binary digits. There will be two sets of this 4-bit input, we'll call them A & B. A relatively simple way for this type of input is to use a 4-input and gate. It's easy to connect up. Bit 0 from A goes to the 1st of 4 each, two-input And gates, next, the Bit 0 from B goes to the other input of the 1st And gate. Just repeat the process for all 4 bits from both A&B inputs and the output of the 4-input and gate will be high when the magnitudes of A & B are the same. Another way of course, is to use a microprocessor, like a PIC chip, read input A into the accumulator, and do a logical and function on the memory location of input B.

    As far as the first method goes, since you can combine and gate outputs by using another and gate, you can make the magnitude comparator for as many bits as you need. If you use a microprocessor or DSP, you'll have to work around the maximum number of bits it's designed for, by using software, if your magnitudes exceed the processor's number of bits. For example, if you have an 8-bit processor, but need a 16-bit magnitude compare, you can still do this, but you have to get clever with your software if using assembly language.

    Kamran Kazem