4-bit Parallel Adder -> Subtractor

Discussion in 'Homework Help' started by ishanz, May 26, 2008.

  1. ishanz

    ishanz Thread Starter New Member

    Joined:
    May 22, 2008
    Messages:
    5
    [​IMG]

    I just drew this up real quickly in Photoshop. So the objective is to use the IC and four inverters to create a subtractor circuit that'll do the following operation:

    A4 A3 A2 A1 - B4 B3 B2 B1

    So would I just invert all the B's on the circuit?
  2. mik3

    mik3 Senior Member

    Joined:
    Feb 4, 2008
    Messages:
    4,846
    Location:
    Cyprus, but now in UK (GMT+0)
    Connect the outputs of 4 XOR gates to B1-B4. Connect one of each XOR's gate input to C1. The other four inputs on the XOR gates (one input per gate) are your new inputs for B1-B4. When you apply high logic to Cin the circuit will subtract A-B , when you apply low logic to Cin the circuit will add A+B.
  3. ishanz

    ishanz Thread Starter New Member

    Joined:
    May 22, 2008
    Messages:
    5
    Is there a way to just do it with inverters? The worksheet we were given only says "Use the IC below and 4 inverters to subtract..."

    I was trying to figure out how on earth to do the 2's complement method with this, are using the XOR gates the only way?
  4. Caveman

    Caveman Active Member

    Joined:
    Apr 15, 2008
    Messages:
    471
    Location:
    Austin, TX
    Hint:
    A - B = A + 2's complement of B
    2's complement of B = B' + 1
  5. mik3

    mik3 Senior Member

    Joined:
    Feb 4, 2008
    Messages:
    4,846
    Location:
    Cyprus, but now in UK (GMT+0)
    Ok then. Connect 4 NOT gates on the B inputs and apply a high logic to Cin input.

    With this modification you invert all the bits and add 1 as the 2's complements requires. The circuit will do the function A-B.
  6. ishanz

    ishanz Thread Starter New Member

    Joined:
    May 22, 2008
    Messages:
    5
    So the carry-in high is basically the 1 that is added when a 2's complement is performed?

    I believe I understand now, thanks a bunch to the both of you! Hopefully I'll be ready for the exam come tomorrow.
  7. mik3

    mik3 Senior Member

    Joined:
    Feb 4, 2008
    Messages:
    4,846
    Location:
    Cyprus, but now in UK (GMT+0)
    yes the carry in is the 1 we add n the 2's complement.
Similar Threads
Forum Title Date
Homework Help MUX-based 4-bit Parallel Adder Dec 11, 2013
Homework Help help! 4-bit parallel addition in gray code Apr 1, 2010
Homework Help code converter that converts 4-bit binary to 4-bit gray code Monday at 7:31 PM
Homework Help Making 4-bit ALU with full adder and 8x1 mux Apr 14, 2014
Homework Help Multisim 4-bit counter Feb 13, 2014

Share This Page