Page 31 - Touhpad Ai
P. 31
= 32+16+0+4+0+1
= 53
So, 110101 = 53 10
2
Binary Arithmetic Operations
Binary arithmetic involves performing mathematical operations using only 0s and 1s. The main operations are addition,
subtraction, multiplication, and division, which form the foundation for all digital computations.
Binary Addition
Binary addition works similarly to decimal addition but follows these rules:
u 0 + 0 = 0
u 0 + 1 = 1
u 1 + 0 = 1
u 1 + 1 = 0 (carry 1 to the next higher bit)
The steps to perform binary addition are as follows:
1. Align the numbers vertically.
2. Start adding from the rightmost bit.
3. Apply the rules above for each column.
4. Carry over any extra 1 to the next column.
Example 1: 1001 + 1011
1 1 1
1 0 0 1
+ 1 0 1 1
1 0 1 0 0
The addition of 1001 and 1011 is 10100.
Example 2: 1110 + 111
1 1 1
1 1 1 0
+ 0 1 1 1
1 0 1 0 1
The addition of 1110 and 111 is 10101.
Binary Subtraction
Binary subtraction uses borrowing when the top bit is smaller than the bottom bit.
u 0 − 0 = 0
u 1 − 0 = 1
u 1 − 1 = 0
u 0 − 1 = 1 (borrow 1 from next left bit)
The steps to perform binary subtraction are as follows:
1. Align the numbers vertically.
2. Subtract each column from right to left.
3. Borrow 1 from the next higher bit when necessary.
Basic Concepts of Artificial Intelligence 29

