I'm working on building a simple 1-bit adder/subtractor.
I can get the adder to work alone and the subtractor to work alone. When I add the switch (XOR gate) I can only get one of them to work at a time. Right now (the attached image) is in adder only. I know I need another NAND gate somewhere in that but i can't seem to figure out where.
My current attempt: http://img88.imageshack.us/img88/8246/adsub.png
Can anyone give any tips/suggestions/hints?
I can get the adder to work alone and the subtractor to work alone. When I add the switch (XOR gate) I can only get one of them to work at a time. Right now (the attached image) is in adder only. I know I need another NAND gate somewhere in that but i can't seem to figure out where.
My current attempt: http://img88.imageshack.us/img88/8246/adsub.png
Can anyone give any tips/suggestions/hints?