Forum Discussion
Altera_Forum
Honored Contributor
17 years agoborrow-select subtractor
I am now trying to build a borrow-select subtractor based on a ripple-borrow. I am pretty sure that I have my ripple-borrow correct but I havn't been able to find much info on the borrow-select and ...
Altera_Forum
Honored Contributor
17 years agoif you can do addition (you will for sure find more information about it), you can use following trick :
A - B = A + (-B) = A + ((~B) + 1) or A minus B equals A plus the 2-compelment of B, and the 2 complement of B is (bitwise) inversion of B plus one. The bitwise not will take no logic, because it will be sucked into the LUT. The extra plus one will take no extra logic, because you can set the carry-in signal of the counter to one (and thus actually add one). Stefaan