Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Hi, by the looks of it:
Borrow is set when the answer is negative
Difference is set when the magnitude of the difference is 1.
A 0 D (difference) and a 1 B (Borrow) means -2.
0 - 1 = -1 D=1, B=1
0 - 0 - 1 = -1 D=1, B=1
0 - 1 - 0 = -1
0 - 1 - 1 = -2 D=0, B=1
1 - 0 - 0 = 1 D=1, B=0
I understand adders but i am confused with subtractors
kindly explain me as i was not clear from wikipedia
file is atatched
full subtractor subtracts two numbers x and y taking into account that a borrow might also have been given to the previous stage. it also includes the possibility of input borrow i.e. borrow coming from the next higher significant stage if it is needed.
the truth table is very simple to understand if u foolow this approach
x y bout z bin
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 1
1 0 0 1 0
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
bout (borrow going out) is borrow going to the lower significant stage subtraction and bin (borrow coming in) is the borrow coming from the higher significant if needed.
for 0 0 1, x which is already 0 has to give a 1 to the previous stage (bout) thus making itself smaller than y(=0). Thus it needs a borrow from the next stage. Once x gets the required borrow (bin) 1, it becomes 10 and now it can give a bout to the previous stage (and itself become 10 - 1 = 01) as well as proceed with the subtraction with y to produce the difference z = 1
another case: 0 1 1
x(=0) has to give a bout and also has to undergo subtraction. thus it takes a bin =1 and becomes 10. now it can give a bout (and itself becoming 10 - 01 =01) as well as undergo subtraction (1-1=0). thus difference(z) =0.
the basic concept is: difference = x-bout-y
and bin is = 1 when x cant give the bout as well as subtract on its own.