# 8-Bit 2's Complement addition and subtraction Circuit

Discussion in 'Homework Help' started by Arbitrator, Mar 20, 2011.

1. ### Arbitrator Thread Starter New Member

Mar 10, 2011
16
0
i have been trying to complete this question for over 4 hours now. i was wondering if someone can head me in right direction.
is this circuit i created ANYTHING like what it's meant to be?
if so i think i know where i went know, the adders have random data bits, i don't know what to change them to. would the be the problem or is the whole circuit not good?

anyways, any help will be appreciated.

File size:
185.8 KB
Views:
239
2. ### Arbitrator Thread Starter New Member

Mar 10, 2011
16
0
does anyone know why it isn't working? i still can't figure it out.

3. ### Arbitrator Thread Starter New Member

Mar 10, 2011
16
0
or can someone give me a step by step, how to get correct result? so i can go through the steps and see where i went wrong.

4. ### MrCarlos Active Member

Jan 2, 2010
400
134
Hello Arbitrator

Let me ask you some questions:

I guess through S You say the circuit, which add or subtract .. Right?
Px and Ux are the numbers that would add or subtract .. Right?

I do not understand what are the small boxes at the bottom of the diagram.

You adder-subtracter is 8 BIT's. You add or subtract 8 P's to another 8 U's ... Right?
What is obtained in the output, if you add or subtract this combination of BIT's?.
P's = 00010000 (= 16).
U's = 00000010 (= 02).

If small boxes on the bottom of the diagram are half-adder, it is likely that this will not be working well.
XOR gates at the top of the diagram appear to be well connected. With them you get the 2's complement required for carrying out the subtraction.

're simulating the circuit in the personal computer?
If yes, what is the software you use?

5. ### Arbitrator Thread Starter New Member

Mar 10, 2011
16
0
yes and yes. The small boxes at the bottom of the page are adders. i think the program i use on my home computer uses half and full adders just as 1 box (adders)
Yes, if i try that it dosn't work since all connects aint connected properly.
the same boxes on the top of the diagram are inputs.
yes i use a logic simulator called 'Logisim'
i don't think it is working because the output of the XOR gates are not compatible widths with the adder, but i am not sure why the carry is not working from one adder to the next.

6. ### MrCarlos Active Member

Jan 2, 2010
400
134
Hello Arbitrator

If the half-adder is not compatible with the XOR gates then use the attached circuit.

It is not complete, only have 2 half-adder for 2 BIT's.
I guess you can be completed.

I have a question about the software you use (Logisim). I acquired recently. now: how I can keep the buttons enabled? ...

File size:
1.4 KB
Views:
74
Arbitrator likes this.
7. ### Georacer Moderator

Nov 25, 2009
5,151
1,266
For the sake of troubleshooting, do you care to produce the 2's complement of the second number separately of the actual addition? Use 1 row of full-adders to add the 1 needed to produce the 2's complement.

Then add the two numbers separately by using another row of full-adders.

I don't have Logisim, so I can't help you with the block compatibility issues.

Arbitrator likes this.
8. ### Arbitrator Thread Starter New Member

Mar 10, 2011
16
0
okay, i downloaded newest version so i could open your file. It is abit different, although the buttons are only used to flicker on then off so like a traffic light circuit or something, use pin if you want to keep it enabled. (Ctrl + 4) it should be between A (test tool) and Output pin (Ctrl + 5) . Also the output should be output pins (ctrl + 5) apart from that it is good, and i will try get mine working when i got time next.
Thank you.

Last edited: Mar 25, 2011
9. ### Arbitrator Thread Starter New Member

Mar 10, 2011
16
0
yes i want it depending what goes numbers goes through s it either does addition or subtract in 2's complement and comes out with 2's complement answer.
in Logisim half adders and full adders are the same. i just had a try just then and it fixed most of orange lines but change output of XOR to red.
thank you for help anyways.

10. ### mannycc New Member

Dec 11, 2010
17
1
Hi Arbitrator, you have to assign a value on s whether 1 or 0 to make the circuit work. By the way why connect the s to Cin?

Cheers