Page 1 of 1

Resolved : 8bits adder has bad response

Posted: Mon Feb 15, 2016 4:18 am
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 16901 times
This is the main board to substract B to A:
adder2.png
adder2.png (46.89 KiB) Viewed 16901 times
Woaaah!! 0-0=3 a Quantical adder !!!!
And another try:
adder3.png
adder3.png (45.97 KiB) Viewed 16900 times
00101110-11010000=101011110
God, result not goood!!!!

Re: 8bits adder has bad response

Posted: Mon Feb 15, 2016 11:17 am
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

Re: 8bits adder has bad response

Posted: Mon Feb 15, 2016 9:39 pm
by megs
ok, there it is.
additionneurs.CircuitProject
(107.07 KiB) Downloaded 1234 times

Re: 8bits adder has bad response

Posted: Mon Feb 15, 2016 10:27 pm
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.

Re: 8bits adder has bad response

Posted: Mon Feb 15, 2016 10:39 pm
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 16886 times
Thanks to you!

Re: Resolved : 8bits adder has bad response

Posted: Tue Feb 16, 2016 11:48 am
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.

Re: Resolved : 8bits adder has bad response

Posted: Tue Feb 16, 2016 11:54 am
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.

Re: Resolved : 8bits adder has bad response

Posted: Thu Feb 18, 2016 1:46 am
by megs
Yes i use splitter now for 8bit+ components, it is very helpfull to clarify design. thks again.