1-bit Full Adder & Subtractor
- TYelectronics
- Jul 27, 2023
- 1 min read
One of the main components of a CPU is its ability to add and subtract binary numbers, and that function if performed by an ALU (arithmetic logic unit). So what I have built here is the arithmetic part, as it can only add and subtract.
To start with I searched up the Logic diagram for an Adder/Subtractor, and designed it using NAND gates in the form of three XOR gates and a NAND gate.

On the left we have the inputs A and B as well as the carry in/borrow pin and finally we have the control pin. When the control pin is set low it acts as an Adder, and when it's set high it acts as a Subtractor. When cascading 1-bit adders to make an 8-bit adder, the adder for the LSB needs the have the carry in pin connected with the control pin, so that when it is in subtractor mode it can perform the 2's compliment conversion.
Now we need to make the schematic.

There are a lot for BJT's but luckily its mainly copy and past with some alterations.
For the layout, that took a bit of time.


Now for some testing.
In this setup we have the Adder/Subtractor on the left (in Adder mode). And on the right we have two buffered LEDs which show the Sum (Right) and the Carry out (Left). And below the LEDs we have the input switches A and B.
As you scroll through the pictures you can see that.
0+0=00.
1+0=01.
0+1=01.
1+1=10.
Next up I'll be building more Adder/Subtractors so that I can do larger calculations.
Comments