Rules of Binary Addition
Adding in binary is significantly simpler than adding in decimal when you keep in mind the following tips or guidelines. Let’s take a look at the rules of binary addition.
Rule 1: 0+0=0; Carry =0
Rule 2: 0+1=1; Carry =0
Rule 3: 1+0=1; Carry =0
Rule 4: 1+1=0; Carry
We can summarize this as:
Binary Addition Table
The table of adding two binary numbers 0 and 1 is given below:
In this table, x and y are the two binary numbers. So when we give the input for 𝑥=0 and 𝑦=0,
then the output is equal to 0. When 𝑥=0 or 1 and 𝑦=1 or 0, then 𝑥+𝑦=1. But when both x and y are equal to 1, then their addition equals 0, but the carryover number will equal to 1, which means basically 1+1=10 in binary addition, where 1 is carried forward to the next digit.
Solved Examples
1. Solve: 111002+101012
Solution:
Therefore, 111002+101012=1100012
2. Find 1101102+11112.
Solution:
Therefore, 1101102+11112=10001012
3. Add 1102+1112+1012
Solution:
To perform the addition of three binary numbers, add two binary numbers together and then add the resultant value with the third one.
Let’s add 110+111 first.
Now, let’s add the third binary number to the resultant value of addition of the first two.
Therefore, 1102+1112+1012=100102
Half Subtractor
The half subtractor is also a building block for subtracting two binary numbers. It has two inputs and two outputs. This circuit is used to subtract two single bit binary numbers A and B. The ‘diff‘ and ‘borrow’ are two output states of the half subtractor.
Block diagram
Truth Table
The SOP form of the Diff and Borrow is as follows:
Diff= A’B+AB’
Borrow = A’B
In the above table
Full Subtractor
The Half Subtractor is used to subtract only two numbers. To overcome this problem, a full subtractor was designed. The full subtractor is used to subtract three 1-bit numbers A, B, and C, which are minuend, subtrahend, and borrow, respectively. The full subtractor has three input states and two output states i.e., diff and borrow.
Block diagram
Truth Table
- ‘A’ and’ B’ are the input variables. These variables represent the two significant bits that are going to be subtracted.
- ‘Borrowin‘ is the third input which represents borrow.
- The ‘Diff’ and ‘Borrow’ are the output variables that define the output values.
- The eight rows under the input variable designate all possible combinations of 0 and 1 that can occur in these variables.
Note: We can simplify each of the Boolean output functions with the help of the unique map method.
The SOP form can be obtained with the help of K-map as:
Diff=xy’ z’+x’ y’ z+xyz+x’yz’
ADVERTISEMENT
Borrow=x’ z+x’ y+yz
Construction of Full Subtractor Circuit:
ADVERTISEMENT
The above block diagram describes the construction of the Full subtractor circuit. In the above circuit, there are two half adder circuits that are combined using the OR gate. The first half subtractor has two single-bit binary inputs A and B. As we know that, the half subtractor produces two outputs, i.e., ‘Diff’ and ‘Borrow’. The ‘Diff’ output of the first subtractor will be the first input of the second half subtractor, and the ‘Borrow’ output of the first subtractor will be the second input of the second half subtractor. The second half subtractor will again provide ‘Diff’ and ‘Borrow’. The final outcome of the Full subtractor circuit is the ‘Diff’ bit. In order to find the final output of the ‘Borrow’, we provide the ‘Borrow’ of the first and the second subtractor into the OR gate. The outcome of the OR gate will be the final carry ‘Borrow’ of full subtractor circuit.
The MSB is represented by the final ‘Borrow’ bit.
The full subtractor logic circuit can be constructed using the ‘AND’, ‘XOR’, and NOT gate with an OR gate.
The actual logic circuit of the full subtractor is shown in the above diagram. The full subtractor circuit construction can also be represented in a Boolean expression.
Diff:
- Perform the XOR operation of input A and B.
- Perform the XOR operation of the outcome with ‘Borrow’. So, the difference is (A XOR B) XOR ‘Borrowin‘ which is also represented as:
(A ⊕ B) ⊕ ‘Borrowin’
Borrow:
- Perform the ‘AND’ operation of the inverted input A and B.
- Perform the ‘XOR’ operation of input A and B.
- Perform the ‘OR’ operations of both the outputs that come from the previous two steps. So the ‘Borrow’ can be represented as:
A’.B + (A ⊕ B)’