Binary Arithmetic
Binary Arithmetic
C
OPERATION But first,
What is ARITHMETIC?
S
The mathematics of integers, rational
numbers, real numbers, or complex
numbers under addition, subtraction,
multiplication, and division.
4 Arithmetic Operations
1. Binary Addition
2. Binary Subtraction
3. Binary Multiplication
4. Binary Division
Step 2: In the second step, we have to start from the right side. Then
we can add the two numbers.
Step 3: If any carry comes means, then it must be added to the next
digit numbers.
1 1 1
1 1 0 1
+ 1 1 1 1
1 1 1 0 0
Example:
1 1 1 1 1 1
1 1 0 1 1 1 1
+ 1 0 0 0 1
1 0 0 0 0 0 0 0
Example:
1 1
1 1 1
1
11 11 1 1
+1 1 0 11 0
1 1 1
1 0 0 0 0 0
BINARY SUBTRACTION
Binary subtraction is to be performed by
using binary addition. The subtraction of
binary numbers is done in the 2-
complement notation and then adding the
numbers in order to reduce complexity.
STEPS:
Step1: we change the second binary number, 0 is replace by 1
and 1 is replace by 0.
-0 1 1 1 subtrahend
1 0 0 0 1’s complement
+ 1
1 0 0 1 2’s complement
11 0 0 0
= (1)1 0 0 0
-
1 0 0 1 minuend
1 1 1 0 subtrahend
0 0 0 1 1’s complement
+ 1
+
0 0 1 0 2’s complement
(0) 1 0 1 1
0 1 0 0
+ 1
0 1 0 1
= -1 0 1
BINARY SUBTRACTION
0 10
1 1 0 1
- 1 0 1 1
0 0 1 0
0 10
1 10
1 0 0 1 1 1
- 0 0 1 0 1 1
0 1 1 1 0 0
0 10 0 10
1 0 1 0 1 1 1 0
- 0 0 0 1 1 1 0 1
1 0 0 1 0 0 0 1
0 1
10 10
1 0 0 1
- 1 1 1 0
0 1 1
1 0 0
+ 1
- 1 0 1
0 10
1 0 1 1
- 1 1 1 1
1 0 0
0 1 1
+ 1
- 1 0 0
BINARY MULTIPLICATION
is actually much simpler than decimal multiplication. In the case
of decimal multiplication, we need to remember 3 x 9 = 27, 7 x 8
= 56, and so on. In binary multiplication, we only need to
remember the following,
0x0=0
0x1=0
1x0=0
1x1=1
Example:
1 0 1 1
1 1 0 1
1 1 0 1 1
1 0 0 0 0
1 1 0 1 1
1 0 1 1
1 0 0 0 1 1 1 1
1001 111111
x 10 x 101
0000 111111
1001 000000
10010 111111
100111011
BINARY DIVISION
The division process of binary numbers is carried out in
simple division while the binary numbers are subtracted
in their 2 - complemented notation.
Example:
10 0 1 1 Answer:
1 1√1 1 1 0 1 1 10011 r.10
11
1
0
10
0
10 1
11
10 1
1 1
1 0
Example: Answer:
1 1 11
100√1 1 0 0
100
10 0
100
0
Example: Answer:
1 1 11
101√1 1 1 1
101
10 1
101
0