Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
17 years ago

borrow-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.

Amy

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored 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's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored 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