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 I'm not sure if I'm doing this right. If anyone can tell me what a borrrow-select is or can tell me where to find out or if you have any examples I would greatly appreciate it.
Amy3 Replies
- Altera_Forum
Honored Contributor
if 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 - Altera_Forum
Honored Contributor
this is the way i have been asked to build a subtractor and without using "-" or loops of any kind. but like i said i am having trouble finding any information about the borrow select so any info would help
- Altera_Forum
Honored Contributor
Is there is reason not to use the synthesis engine's '-'?