How to fix the designed calculator circuit using Logisim

diagramdigital-logic

I am trying to design a calculator circuit that adds 2 four-bit 2's-complement binary numbers as its input and outputs an 8-bit 2's-complement number when the control bits equal 01.

Here's what I have done so far using a software called Logisim. I am really stuck when I found out that I cannot put the other 4 output buttons (colored in blue) in my full adder. I am stumped on how to approach this problem now.

I have tested a few 2's-complement numbers and got the output I wanted and some 2's-complement numbers that did not go so well like (having 0100 as the first input and 0110 as the second input did not give me 1010 but gave me 1011.

block diagram

I just need help, suggestions and guidance on how to move forward.

Best Answer

You have a 4-bit full adder, so far OK. Then you connected a control input to the carry-in of the lowest bit. When you keep that control at 0 you still have your 4-bit adder. When you put it at 1 you will get the addition + 1, just as you described. Putting an inverter after the first output bit will 'solve' this ONLY for additions that had a 0 in the lowest bit (go figure out why).

If you want the control = 1 to give you the addition, and control = 0 must give 'something else, does not matter what' you could put the inverter in the control line.

BTW a 4-bit added will give you a 5-bit result. If you need an 8-bit 2s-complement result look up 'sign extension'. (This smells of homework, so I won't give away everything.)