Resolved : 8bits adder has bad response

If you have something to say about LogicCircuit program or you know how to improve it please share it here.
Post Reply
megs
Posts: 6
Joined: Sat Feb 06, 2016 7:14 am

Resolved : 8bits adder has bad response

Post by megs »

hi again,
i am trying to experiment substration between two 8bit binary numbers. 1 bit adder is working perfectly. when i chain it to 8bit adders, some error where done:

this is my adder 1 bit, and the 8bit adder:
adder.png
adder.png (100 KiB) Viewed 9883 times
This is the main board to substract B to A:
adder2.png
adder2.png (46.89 KiB) Viewed 9883 times
Woaaah!! 0-0=3 a Quantical adder !!!!
And another try:
adder3.png
adder3.png (45.97 KiB) Viewed 9882 times
00101110-11010000=101011110
God, result not goood!!!!
Last edited by megs on Mon Feb 15, 2016 10:43 pm, edited 1 time in total.
User avatar
admin
Site Admin
Posts: 406
Joined: Sun Jun 14, 2009 10:53 pm
Contact:

Re: 8bits adder has bad response

Post by admin »

Well, it is hard to say anything by pictures. It would be better to attach your project file also.
In general, I would recommend verifying such circuits with filters in the truth table. Please read this page: http://www.logiccircuit.org/TruthTable.html for more details. This way you can verify your design.
On the other note, please consider using splitters to build multi bit wires it should make your circuits more compact. You can read this page: http://www.logiccircuit.org/splitter.html
megs
Posts: 6
Joined: Sat Feb 06, 2016 7:14 am

Re: 8bits adder has bad response

Post by megs »

ok, there it is.
additionneurs.CircuitProject
(107.07 KiB) Downloaded 462 times
User avatar
admin
Site Admin
Posts: 406
Joined: Sun Jun 14, 2009 10:53 pm
Contact:

Re: 8bits adder has bad response

Post by admin »

Your circuit is not connected. Look at the B inputs of the first adder.
Don't assume that unconnected input equivalent to 0.
Hope it helps, but let me know if you any other questions.
megs
Posts: 6
Joined: Sat Feb 06, 2016 7:14 am

Re: 8bits adder has bad response

Post by megs »

Effectively, there is not 0 default value for pin not connected, i think program try to get a value with hasardous memory location because object on pin does not exist. We must connect them to à constant value. May it be an interresting evolution to program to take a default value 0 when a pin is not connected. it take heavy place to put constant on circuit. If these error is not corrected, getting value on hasardous memory location should crash entire program when trying to access to external memory allocated to another app.
adder3.png
adder3.png (56.75 KiB) Viewed 9868 times
Thanks to you!
User avatar
admin
Site Admin
Posts: 406
Joined: Sun Jun 14, 2009 10:53 pm
Contact:

Re: Resolved : 8bits adder has bad response

Post by admin »

Thank you for suggestion, but this is by design behavior. Moreover various logic gates treating unconnected inputs differently.
For example AND gate will look for any input equal to 0 to return 0 result, while OR gate will for any input that is equal to 1 to return 1. This behavior is actually very similar to actual circuits.
User avatar
admin
Site Admin
Posts: 406
Joined: Sun Jun 14, 2009 10:53 pm
Contact:

Re: Resolved : 8bits adder has bad response

Post by admin »

Oh, and one more thing. I’d suggest to start using multi bit wires and split them right at the moment where such splitting it necessary and combine as soon as possible. This way you will need to connect only one constant instead of many like you have.
megs
Posts: 6
Joined: Sat Feb 06, 2016 7:14 am

Re: Resolved : 8bits adder has bad response

Post by megs »

Yes i use splitter now for 8bit+ components, it is very helpfull to clarify design. thks again.
Post Reply