buffalo101
Newbie level 5
Hi,
I'm resuming my project of making a 4x4 bits BCD adder/subtracter.
The first nibble will be either 0 (positive) / 1 (negative), followed by 3 more bits for holding 3 digits. I have some left over schematics since last time I wanted to complete this: I have a full 1 digit BCD adder with CIn / COut, but I can only work with positive numbers. Any suggestions on how to accomplish 1+3 digits addition/subtraction?
Edit: I will design the circuitry for this. My approach would probably be this:
Since I already have a ModeSelect signal implemented, I could work around that. I would use both the numbers' sign and a comparer circuit to position them in a fashion that suits my existing circuit. Currently, if I select a subtraction, the second digit's complement is added to the first digit.
a) If the numbers are both positive, regular addition (5+3).
b) If one of the numbers is negative, subtract the smaller number from the bigger number by adding the negative number's complement to the first number (-3 + 5 = 5-3 ; -5 + 3 = 3 - 5) (???)
c) If both the numbers are negative, regular addition with a negative sign.
I'm resuming my project of making a 4x4 bits BCD adder/subtracter.
The first nibble will be either 0 (positive) / 1 (negative), followed by 3 more bits for holding 3 digits. I have some left over schematics since last time I wanted to complete this: I have a full 1 digit BCD adder with CIn / COut, but I can only work with positive numbers. Any suggestions on how to accomplish 1+3 digits addition/subtraction?
Edit: I will design the circuitry for this. My approach would probably be this:
Since I already have a ModeSelect signal implemented, I could work around that. I would use both the numbers' sign and a comparer circuit to position them in a fashion that suits my existing circuit. Currently, if I select a subtraction, the second digit's complement is added to the first digit.
a) If the numbers are both positive, regular addition (5+3).
b) If one of the numbers is negative, subtract the smaller number from the bigger number by adding the negative number's complement to the first number (-3 + 5 = 5-3 ; -5 + 3 = 3 - 5) (???)
c) If both the numbers are negative, regular addition with a negative sign.
Last edited: