The idea is to use the 555 as an inverter by putting the threshold pin to Vdd and using the trigger pin as input. Doing so you get the inverted input at the output pin but XORs and NANDs need transistors in series. No problems, instead of the output we can use the discharge pin because it is simply a npn and wire them in series, but… there is still a problem. The emitter of the internal discharge npn is grounded with the whole chip, so i used some external pnp to enable/disable the 555 chip just by putting the Vcc pin to Vdd or gnd.
The adder can be used as a subctractor as well. The subtraction of two values is done by summing one value to the 2′s complement of the other. The 2′s complement is the 1′s complement plus 1 and the 1′s complement is the inversion bit by bit of the binary value (e.g. the 1′s complement of 1011 is 0100 and the 2′s complement is 0101), so the subtraction is simple and can be achieved by inverting the B value and the plus 1 with the carry in of the LSB set to 1.
The circuit has 1 switch, actually there are 3 switches because i didn’t find a big switch with 5 sections, to select the sum (A+B) or the sub (A-B) mode.
The output is the sum, or the sub, with the carry out.
In the sum mode the carry out has the meaning of overflow, while in the sub mode depends on the input values. Here‘s a table with inputs and expected output values.
Some videos: (sorry for the video but i had to keep the camera with my hand while handling the jumpers with the other one)
The image of the circuit assembled on a breadboard (actually 3 breadboards) with ICs and BJTs labeled:
The eagle scheme: