DiamondV
- 103
- 0
I don't understand the second row of the truth table. If A is 0 and B is also 0 how is there a carry of 1 and a sum of 1. 0+0=0
anorlunda said:There are three inputs to that table, not two. They are A, B, and C-in.
DiamondV said:Where does the 1 of carry in come from?
anorlunda said:It comes from the previous digit. Each binary digit when added creates a carry bit to the next most significant digit.
anorlunda said:Add 0011 plus 0001.
First digit 1+1 yields sum 0 carry 1.
Second digit 1+0+carry = 1+0+1 yields sum 0 carry 1.
Third digit 0+0+carry = 0+0+1 yields sum 1 carry 0
Fourth digit 0+0+carry = 0+0+0 yields sum 0 carry 0
Total sum 0100.
Does that help?
Ah. so for the first addition of your example of 1+1, I go to the A=1 and B=1 in the table and get the sum from there and also then use the carry out of that addition as the carry in of the next addition of 1+0 +carryin of 1anorlunda said:You are reading the table wrong. Each row in the table represents one of the eight possible combinations of A, B, and carry for a single binary digit. Each row is not the result of the row above.
To add 0011+0001 you must apply the entire table four times.