4bit adder/subtract....

Discussion in 'Homework Help' started by stam, Nov 21, 2004.

  1. stam

    Thread Starter New Member

    Nov 21, 2004
    2
    0
    Hi guyz,

    i have a question on how to create a 4bit adder/subtract with gates...

    I want for examples to do this:

    0101
    + 0010
    ----------
    0111

    and this:

    0010
    - 0101
    --------------


    I found a schematic on the last page of this http://www.cs.umass.edu/~verts/cmpsci201/s...Subtractors.pdf but i didn't understand many things...

    Can anyone help me?
    :blink: :blink: :blink: :blink:
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    Hi,

    My Signetics LSTTL manual says that the LS83 is a four bit adder. Just present the bits and the output is the sum. If you want to subtract and all you have is an adder, then you have to compliment one number to make it negative. That turns the addition into a subtraction. I believe computers still do this internally.

    That chip is ancient, by the way. It has power like the old 7490, with Vcc to p5 and ground to p12. Hope you don't need to actually use one.
     
  3. stam

    Thread Starter New Member

    Nov 21, 2004
    2
    0
    Thanks for replying! :)

    I asked my teacher today and he told me that i must do the hole thing with an LS83, X-OR gates and some NOT...

    The problem is with subtract, when the second number is bigger than the first one, so the result will be negative...

    I studied LS83 and made a schematic but the above problem is still there... :( :(



    [attachmentid=243]
     
  4. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    Hi,

    When you're adding a complimented number, you get the right result when you pull the CARRY IN line high:

    Carrry: 1
    A: 0010
    B: 1101 (compliment of 0010)
    sum: 0000 (ignore the CARRY OUT)
     
Loading...