To create a logic circuit that accomplishes addition and subtraction with carry.
Design and draw the schematic for a 4-bit Adder/Subtractor.
Use 4x 1-bit adders rather than a single 4-bit adder and connect the carry-out into the next carry-in
Be sure to add an output that will show the result of Carry.
The data sheet for the 74LS83 is similar to the 4-bit Logisim adder. Find the datasheet online and use it as a reference.
The circuit will perform A+B or A+(-B) to perform subtraction.
Remember A-B = A+(-B) = A+ (B’ +1). where (B’ + 1) is the 2’s complement of B.
Create a blank table as shown below to record your prediction and results. Add the rest of the required test cases (3-7).
We will test the simulation circuit by doing the following additions & subtractions:
3 + 2 = 5
3 - (+2) = 1
4 + 3 = 7
3 - (+4) = -1
5 + 7 = 12
–4 – (+4) = -8
–4 + (-4) = -8
An example of the chart is shown below:
Note that the most significant bit (A3, B3, or S3) act as sign bits, 0 indicating a positive number, 1 indicating a negative number.
Be sure to use 2's complement when working with negative numbers, or subtraction.
Draw the circuit you designed in Section 1 of the Prelab in Logisim, if you have not done so already.
Create your circuit using the provided 74LS283 4-bit adder.
Connect the +5V and GND to the chip.
Connect 1 switch for each bit of A (4 in total) to the appropriate inputs on the 74LS283 chip.
Similarly, connect 4 more switches to represent B to the appropriate inputs on the 74LS2`83.
Connect C0, the "carry-in", to GND.
Connect each of the sum outputs to their own LED (4 in total).
Connect C4 to another LED to represent "carry-out"
To test the circuit, the following procedure will be useful to confirm the wiring has been done properly:
Confirm each step works properly before moving to the next.
Set A3 .. A0, B3 .. B0 to all 0’s and confirm SUM0 .. SUM3 and CARRY are 0’s. (0000 + 0000 = 0000).
Try a few test cases of your choosing to ensure addition is working (0001 for A and 0001 for B should show 0010 on the LEDs for eg.)
Once you are satisfied that the behaviour matches that of an adder you can move on to the tests.
Test your circuit using the table of test numbers prepared in Section 2 of the Pre-lab.
Remember to take the 2's complement of negative numbers or numbers to be subtracted.
We won't be using a second chip (XOR) to implement the 2s Complement for us due to complexity.
Comment on the design, did your circuit perform as expected? Did SUM0 .. SUM3 always provide the correct answer?
Explain the function of the Carry output LED in two cases:
When used for addition of numbers that result in a sum over 15.
When used for subtraction resulting in a negative number.
What is the maximum valid value that can be represented by the circuit for each operation?