CO Notes (Arithematic Operations)
CO Notes (Arithematic Operations)
CO Notes (Arithematic Operations)
with Examples
The binary addition & subtraction is similar to the decimal number system. But the main
difference between these two is, binary number system uses two digits like 0 & 1 whereas the
decimal number system uses digits from 0 to 9 and the base of this is 10. There are some specific
rules for the binary system. Like when we add & subtract binary numbers then we must be very
careful while carrying otherwise borrowing digits because these will occur more frequently. This
article discusses an overview of the addition & subtraction of binary numbers in detail below.
What is Binary Addition & Subtraction?
If a computer is accomplished in handling 5-bit numbers like -1101 where the minus is a sign bit
and remaining digits are magnitude bits then this 5-bit number can be represented like 11101.
Here in this digit, the first digit ‘1’ specifies the negative sign as well as remaining 4 digits are
the magnitude of the numbers.
Binary Addition
Binary addition technique is similar to the normal addition of decimal numbers excluding that as
an alternative value of 10 digits, it carries on a 2 value.
For example, as we compute 7+9 manually, then the answer is 16. So we know that the result has
to write like two digits 1 and 6. The main reason to write down the result like 1 6 is, the addition
of 7 + 9 is greater than the single digit. So the result cannot be denoted through a single digit
because the largest single digit is ‘9’.
Similarly, whenever we would like to sum two binary numbers, only we will have a carry if the
product is bigger than 1 because, in binary numbers, 1 is the highest number. The binary addition
rules are given in the following truth table of subtraction.
A B A+B Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
In the above tabular form, the initial three equations are the same for the binary digit number.
The addition of binary numbers step by step is explained in detail. For binary addition take an
example of 11011 & 10101.
1 1 1 1 (Carry)
1 1 0 1 1 (27)
(+) 1 0 1 0 1 (21)
____________
1 1 0 0 0 0 (48)
If the minuend is smaller than the subtrahend, then this method is used by just switch their
positions and memorize that the effect will be a -ve number. The binary subtraction rules are
given in the following truth table of subtraction.
A B A-B Borrow
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
For example, in the binary subtraction, subtract the subtrahend from minuend. Take an example
of subtrahend (11011)2 and minuend (1101101)2. For subtraction, arrange these two like the
subtrahend should be below the minuend. The example of this is given below.
1101101
– 11011
To get the same number of digits in subtrahend, add zeros where it requires.
1101101
– 0011011
________
1010010
In the above binary subtraction example, the subtraction was achieved from the right side to the
left side with the help of tabular form which is shown in the above. Here the step by step binary
subtraction rules is explained below.
If the input 1 0 = 0 & borrow is. So 1 1 = 0 then borrow to the next step is 0.
If the input 1 1 = 0 & borrow is 0. So 0 0 = 0 then borrow to the next step is 0.
Final step, If the input 1 0 = 0 & borrow is 0. So 10 = 1, then borrow to the next step is 0.
0011011
1’s complement can be achieved by converting 0’s to 1’s and 1’s to 0’s. So the result will be like
the following.
1100100
+ 0000001
_________
= 1100101
Now add the subtrahend‘s 2’s complement & minuend.
1101101 (subtrahend)
+ 1100101 (2’s complement)
________
(MSB) (1)1010010
In the above result, ignore the MSB (most significant bit) of the outcome. If there is no
additional bit, you did a mistake while adding the digits.
Overflow
Overflow Rule for addition
If 2 Two's Complement numbers are added, and they both have the same sign (both positive or
both negative), then overflow occurs if and only if the result has the opposite sign. Overflow
never occurs when adding operands with different signs.
i.e. Adding two positive numbers must give a positive result
Adding two negative numbers must give a negative result
Overflow occurs if
(+A) + (+B) = −C
(−A) + (−B) = +C
(−7) 1001
+(−6) 1010
------------
(−13) 1 0011 = 3 : Overflow (largest −ve number is −8)
If the carry into the sign bit position differs from the carry out from the sign bit position then an
overflow has occurred.
Carries 0 1 overflow
Carries 1 0 overflow
The circuit:
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: