how can i swap input

Discussion in 'General Electronics Chat' started by mohsen, Oct 24, 2010.

  1. mohsen

    Thread Starter Active Member

    Oct 24, 2008
    37
    0
    my question is:
    i have two inputs each input is BCD 4-bit. going to perform subtraction in 2 full adder.
    when i have 6-4 = 2 there is no problem so far.
    the problem is
    when i have 4 - 6 = -2 is the problem.

    so what i need is swap the input that is instead of taking making the input 4 would be 6, and so on. for the whole BCD numbers.

    0011
    -
    0100
    --------
    ====> 0100 convert it then add it to Full Adder and make the (C0 = 1) will give me an error of the sum.
    that's why i want invert the input to get the right answer.

    so please if anyone have an idea of how to swap input by compare the input
     
  2. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
  3. mohsen

    Thread Starter Active Member

    Oct 24, 2008
    37
    0
    well, that's kinda help
    but if u can see the attachment
    i'm trying to compare first if A<B then the output of A3...0 becomes an output of B3...0 or else the output of A3...0 will stay in the same place of output A3...0
     
  4. mohsen

    Thread Starter Active Member

    Oct 24, 2008
    37
    0
    i got it, thank for the help
     
Loading...