Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Kindly explain me truth table of Half subtractor and Full Subtractor

Status
Not open for further replies.

moonnightingale

Full Member level 6
Joined
Sep 17, 2009
Messages
362
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,298
Activity points
3,832
I understand adders but i am confused with subtractors
kindly explain me as i was not clear from wikipedia
file is atatched
 

Attachments

  • Subtractor.jpg
    Subtractor.jpg
    48 KB · Views: 125

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
 

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

Ok excellent answer but one last query
what is the reason for

0 -1 -1 = D=0 and B=1. B should be 1 that is clear but why D is 0 when difference is -2
what is logic for that
 

Hi,

You only have two bits to encode three 1-bit numbers being subtracted.

Possible outcomes of subtraction are 0, 1, -1, -2.

DB Meaning
00 difference is 0
10 difference is a positive 1
11 difference is a negative 1
01 difference is negative 2

The only time you can get a 0 for difference and a 1 for borrow is when your answer is -2.

Btw, a good way to do signed arithmetics is with two's complement representations; just like in algebra (3-4 = 3+-4) it is easier to perform additions than subtractions.
 
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.
 
Last edited:

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.

In many places, bout is written as bin and bin as bout (actually they were switched in the above post for better understanding). If bin is written among inputs in truth table then it means it is input to the circuit and connects it to the lower significant bit subtractor. It still represents the borrow going out to the previous stage but as is it is connected to the input therefore known as bin. Same reason for bout if it is written among outputs. It's up to you what you use as they are simply symbols.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top