Download presentation
Presentation is loading. Please wait.
Published byHortense Thompson Modified over 9 years ago
1
Binary Addition and Subtraction
2
Arithmetic Operations Arithmetic operations in a computer are done using binary numbers and not decimal numbers and these take place in its arithmetic unit.
3
Binary Arithmetic Operations Binary Addition Binary Subtraction
4
Arithmetic Rules Addition i. 0 + 0 = 0 ii. 0 + 1 = 1 iii. 1 + 0 = 1 iv. 1 + 1 = 10 Subtraction i. 0 - 0 = 0 ii. 1 - 0 = 1 iii. 1 - 1 = 0 iv. 10 - 1 = 1
5
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.
6
Binary addition Example 1111 1010 1 00 1 15 10 25
7
Addition Explanation Step 1 The Least Significant Bits are added, i.e., 0 + 1 = 1 with a carry 0 Step 2 The carry in the previous step is added to the next higher significant bits, i.e., 1 + 1 + 0 = 0 with a carry 1
8
Cont., Step 3 The carry in the above step is added to the next higher significant bits, i.e., 0 + 1 + 1 = 0 with a carry 1 Step 4 The preceding carry is added to the next Most Significant bits, i.e., 1 + 1 + 1 = 1 with a carry 1 Thus Sum= 1 1 0 0 1
9
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
10
Subtraction Example 1 1101 100 1 0 0 10 13 9 4
11
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 - 0 = 0
12
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
13
Subtraction Example 2 1001 0111 0 01 1 100 9 7 2
14
Explanation Step 1 The Least Significant Bits in the first column are 1 and 1. Hence, the difference is 1 – 1 = 0
15
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.
16
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
17
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 0 0 1 0
18
The End ……Thank You……
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.