8-Bit 2's Complement addition and subtraction Circuit

Thread Starter

Arbitrator

Joined Mar 10, 2011
16
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.
 

Attachments

Thread Starter

Arbitrator

Joined Mar 10, 2011
16
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.
 

MrCarlos

Joined Jan 2, 2010
400
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.
Are they half-adder?

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?

Thank you for your attention
 

Thread Starter

Arbitrator

Joined Mar 10, 2011
16
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.
 

MrCarlos

Joined Jan 2, 2010
400
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? ...

Thanks for your patience.
 

Attachments

Georacer

Joined Nov 25, 2009
5,182
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.
 

Thread Starter

Arbitrator

Joined Mar 10, 2011
16
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? ...

Thanks for your patience.
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:

Thread Starter

Arbitrator

Joined Mar 10, 2011
16
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.
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.
 

mannycc

Joined Dec 11, 2010
17
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
 
Top