How to Compare 2 Numbers Using 4bit Adder

Discussion in 'Homework Help' started by athulascc, Mar 27, 2015.

  1. athulascc

    Thread Starter Member

    Aug 15, 2014
    86
    1
    hi\
    I need to compare Number A and B.
    I can recognize equal state Capture.JPG .

    Also I know if A>B carry out will be 0.

    but how to recognize A<B?
     
  2. athulascc

    Thread Starter Member

    Aug 15, 2014
    86
    1
    please help me assp

    I think if A>B then answer is positive therefore Cout=0 , since for A=B Cout=0 when Cout=0 ; A>B or A=B

    otherwise A<B

    correct?
     
  3. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Can you subtract the two numbers, and look at the carry?
     
  4. athulascc

    Thread Starter Member

    Aug 15, 2014
    86
    1
    yes. they have given hint
    B3 B2 B1 B0 - A3 A2 A1 A0 + 2^4
    < 2^4
     
  5. athulascc

    Thread Starter Member

    Aug 15, 2014
    86
    1
    I know substractor does not show answer well when it is out of range or negative.

    so I think only looking at carry out is not enough
     
  6. WBahn

    Moderator

    Mar 31, 2012
    17,748
    4,796
    In your first post you said that you know how to recognize A=B and you know how to recognize A>B (though I'm not convinced you do, but let's assume). Well, then if you determine that A=B is not true AND you determine that A>B is not true, what does that leave as the only possible result?
     
    absf likes this.
Loading...