Home › Practice › RTL Design › Borrowing across columns

Borrowing across columns

EasyRTLcombinationalarithmetic

In long subtraction every column may owe a borrow to the column on its right, and may need to borrow from the column on its left.

Concept first. A column of a subtraction sees three things: the bit a on top, the bit b below it, and the borrow coming in from the right (call it bin). It must compute a - b - bin. The answer is one difference bit plus a borrow out for the next column. Work out a few cases by hand: 1-0-1 = 0 with no borrow, 0-0-1 needs a borrow, 1-1-1 needs a borrow too. When does the column need to borrow? When what it takes away is more than what it has.

What to build.

Solve in your browser →

No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.

More in this track

← Borrowing in one columnTwo half adders make a full adder →