2.1 Binary Arithmetic


We are very familiar with different arithmetic operations, addition, subtraction, multiplication, and division in a decimal system. Such operations may be performed in a binary system, where only two digits, 0 and 1 exist.

Binary Addition

The rules of binary addition are given below:

Augend + Addend = Result

1) 0 + 0 = 0 (Carry = 0)
2) 0 + 1 = 1 (Carry = 0)
3) 1 + 0 = 1 (Carry = 0)
4) 1 + 1 = 0 (Carry = 1)

To add two binary numbers, the procedure is the same as in adding two decimal numbers. Example 2.1 illustrates the method of adding two binary numbers.

Example 2.1: Add the two binary numbers: 1101 and 1011.


2.1 Binary Arithmetic


Solution:

So, the result of addition is 110002.
Addition starts from the LSB and it proceeds to higher significant bits, adding the carry resulting from the addition of the two previous bits each time.

Binary Subtraction

The rules of binary subtraction are given below.
Minuend – Subtrahend = Result


2.1 Binary Arithmetic


1) 0 - 0 = 0 (Borrow = 0)
2) 0 - 1 = 1 (Borrow = 1)
3) 1 - 0 = 1 (Borrow = 0)
4) 1 - 1 = 0 (Borrow = 0)

Binary subtraction is also similar to the method of decimal subtraction.
The subtraction starts from the LSB and proceeds to the higher significant bits.
Example 2.2 illustrates the method of subtracting two binary numbers.

Example 2.2: Perform the subtraction for following binary numbers:
a) 1101 - 1001    b) 1101 - 1011

Solution:
So, the result of subtraction is 0100.

2.1 Binary Arithmetic


So, the result of subtraction is 0010.

When borrow is 1 this is to be subtracted from the next higher binary bit as in decimal subtraction.
In this method, we borrow a 1 from a higher significant position when the minuend digit is smaller than the corresponding subtrahend digit.
When a digit is smaller in the minuend than that in the subtrahend we add 2 (the base of the binary system) to the minuend digit mentally and we perform the subtraction (in this case 1 from 2) in decimal and write down the result in the corresponding column.
Since we have added 2 to the column, we have to add 1 to the subtrahend digit in the next higher order column.
This process is to be carried on for all of the columns whenever the minuend digit is smaller than the corresponding subtrahend digit.


2.1 Binary Arithmetic


Binary Multiplication

Binary multiplication is much simpler than decimal multiplication.
In a binary system, each partial product is either zero (multiplication by 0) or exactly the same as the multiplicand (multiplication by 1).
The rules of binary multiplication are given below.

Multiplicand x Multiplier = Result

1) 0 x 0 = 0
2) 0 x 1 = 0
3) 1 x 0 = 0
4) 1 x 1 = 1

The multiplication operation is done by the repeated additions of all partial products to obtain the full product.
Example 2.3 illustrates the multiplication method.


2.1 Binary Arithmetic


Example 2.3: Multiply the two binary numbers: 0101 and 1011.
Solution:
So, the result of subtraction is 0010.

Binary Division

In binary division, the same procedure is performed as in decimal division. The rules of binary division are given below.


2.1 Binary Arithmetic


Dividend ÷ Divisor = Quotient

1) 0 ÷ 0 = (Not Allowed)
2) 0 ÷ 1 = 0
3) 1 ÷ 0 = (Not Allowed)
4) 1 ÷ 1 = 1

To perform binary division, the following steps are performed:
1. Align the divisor (Y) with the most significant end of the dividend. Let the portion of the dividend from its MSB to its bit aligned with the LSB of the divisor be denoted X.
2. Compare X and Y.
a) If X >= Y, the quotient bit is 1 and perform the subtraction X-Y.
b) If X < Y, the quotient bit is 0 and do not perform any subtractions.
3. Shift Y one bit to the right and go to step 2 and so on.

Example 2.4 illustrates the division method.
Example 2.4: Divide the following binary numbers:
a) 1101 and 100    b) 11010 and 101.


2.1 Binary Arithmetic



So, the result of Division is 112 and reminder is 1.



2.1 Binary Arithmetic



So, the result of Division is 1012 and reminder is 1.