Binary Addition and Subtraction
Arithmetic Operations Arithmetic operations in a computer are done using binary numbers and not decimal numbers and these take place in its arithmetic unit.
Binary Arithmetic Operations Binary Addition Binary Subtraction
Arithmetic Rules Addition i = 0 ii = 1 iii = 1 iv = 10 Subtraction i = 0 ii = 1 iii = 0 iv = 1
Binary Addition Two binary numbers can be added in the same way as two decimal numbers are added. The addition is carried out from the least significant bits and it proceeds to higher significant bits, adding the carry resulting from previous addition each time.
Binary addition Example
Addition Explanation Step 1 The Least Significant Bits are added, i.e., = 1 with a carry 0 Step 2 The carry in the previous step is added to the next higher significant bits, i.e., = 0 with a carry 1
Cont., Step 3 The carry in the above step is added to the next higher significant bits, i.e., = 0 with a carry 1 Step 4 The preceding carry is added to the next Most Significant bits, i.e., = 1 with a carry 1 Thus Sum=
Binary Subtraction The subtraction is carried out from the Least Significant bits and proceeds to the higher significant bits. When 1 is subtracted from 0, a 1 is borrowed from immediate Higher Significant Bit
Subtraction Example
Subtraction Explanation Step 1 The LSB in the first column are 1 and 1. Hence, the difference is 1 – 1 = 0 Step 2 In the second column, the subtraction is performed as = 0
Cont., Step 3 In the third column, the difference is given by 1 – 0= 1 Step 4 In the fourth column, the difference is given by 1 – 1 = 0
Subtraction Example
Explanation Step 1 The Least Significant Bits in the first column are 1 and 1. Hence, the difference is 1 – 1 = 0
Cont., Step 2 1.In the second column, it is not possible to subtract the 1 from 0. 3.So a 1 has to be borrowed from the next bit(4 th bit). 2.But since the 3 rd bit is also zero.
Cont., Step 2 Cont., 4.The borrowing of 1 from the 4 th bit results in 1 and 1 0 with weight 4 in the 3 rd column and 0 in 4 th column as shown above 5.Now, the subtraction is performed as 1 0 – 1 = 1
Cont., Step 3 In the third column, the difference is given by 1 – 1 = 0 Step 4 In the fourth column (MSB), the difference is given by 0 – 0 = 0 Thus the difference between two binary numbers is
The End ……Thank You……