EveryCircuit
Powering up...
Circuit
Public
Private
Unlisted
Save

4 bit full Adder Subtractor

@BigKhalPablo
8 years ago
https://everycircuit.com/circuit/5340876462358528
The 4 first (up left) logic inputs are var A. The 4 next are B. The 9th input is the add/sub select. If 0 , the output will be A+B in hex. If 1, it will beA-B. The red led indicates carry out. The addition is simple, if your result gets bigger than F (15 in hex) the display show the 4th less significant bits and the led gets on. The substraction works makind the A2 complement of B that is -B + 1. The xor gates make (if the 9th input is on) B -> (-B). And the carry in is activated in the first full adder, so -B + 1. The carry out is connected to the red led. In subtraction you always get carry out (in case A>B). If B>A you will get the complement (1001->0110+1=0111) and no carry out. If A=B you will get 0000 as result and carry out.
Comments
Post