You are on page 1of 20

Binary Arithmetic

Binary Arithmetic
• Basic of binary arithmetic
– Binary addition
– Binary subtraction
– Binary multiplication
– Binary division
Binary Addition

One bit addition:


0 0 1 1 augend /aw-jend/

+0 +1 + 0 +1 addend
----- ------ ------ ------
0 1 1 2 sum

10
carry

2 doesn’t exist in binary!

KFUPM
Binary Addition
• The four basic rules for adding digits are as
follows:
– 0+0=0  sum of 0 with a carry of 0
– 0+1=1  sum of 1 with a carry of 0
– 1+0=1  sum of 1 with a carry of 0
– 1+1=10  sum of 0 with a carry of 1

A B A+B Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Binary Subtraction
• The four basic rules for subtracting digits are
as follows:
– 0-0 = 0
– 1-1 = 0
– 1-0 = 1
– 10-1 = 1 ; 0-1 with a borrow of 1
A B A-B Borrow
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
Binary Multiplication
• The four basic rules for multiplying digits are as
follows:
– 0x0 = 0 A B A×B
– 0x1 = 0
0 0 0
– 1x0 = 0
– 1x1 = 1 0 1 0
1 0 0
1 1 1
• Multiplication is performed with binary numbers in
the same manner as with decimal numbers.
– It involves forming partial products, shifting each
successive partial product left one place, and then adding
all the partial products.
Binary Arithmetic
• Addition • Subtraction
Augend: 101101 Minuend: 101101
Addend: +100111 Subtrahend: −100111

Sum: 1010100 Difference: 000110

• Multiplication
Multiplicand 1011
Multiplier × 101
Partial Products 1011
0000 -
1011 - -
Product 110111
Binary Addition (by example)

11 3 100 4
+11 +3 + 10 +2
110 6 110 6

111 7 110 6
+ 11 +3 +100 +4
1010 10 1010 10
Binary Addition
Examples : Perform the binary addition of the binary
numbers 101010 and 010011:

1 0 1 0 1 0
+ 0 1 0 0 1 1
1 1 1 1 0 1
Binary Addition

Example: Q: How to verify?


1 111 A: Convert to decimal
carries
1100001111 783
+ 0111101010 + 490
-------------------------- -----------
sum
10011111001 1273

KFUPM
Binary Addition
• We can also perform the binary addition on more than
two binary numbers.
A B C A+B+C Carry
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
Binary Addition
Example : Perform the binary addition operation on
the following three numbers: 0010, 0001, 0111

0 0 1 0
0 0 0 1
+ 0 1 1 1
1 0 1 0
Binary Subtraction
• Borrow a “Base” when needed
1 2 = (10)2
0 2 2 0 0 2
1 0 0 1 1 0 1 = (77) 10
− 1 0 1 1 1 = (23) 10

0 1 1 0 1 1 0 = (54) 10

13
Binary Subtraction (by example)

11 3 11 3
-01 -1 -10 -2
10 2 01 1

101 5
-011 -3
010 2
Binary Subtraction
• Examples : Perform the binary subtraction of the
following numbers: 10101 and 01110

1 1 1
1 0 1 0 1
- 0 1 1 1 0
0 0 1 1 1
Binary Multiplication (by example)

11 3 101 5
x11 x3 x111 x7
11 9 101 35
+11 101
1001 +101
100011
Binary Multiplication
Example : Perform the binary multiplication of the decimal numbers 12 and 10.

The equivalent binary representation of the decimal number 12 is 1100.


The equivalent binary representation of the decimal number 10 is 1010.

1 1 0 0
× 1 0 1 0
0 0 0 0
1 1 0 0
Binary multiplication 0 0 0 0
does not involve the 1 1 0 0
concept of carry. 1 1 1 1 0 0 0
• Addition Binary Arithmetic
• Subtraction
Augend: 101101 Minuend: 101101
Addend: +100111 Subtrahend: −100111

Sum: 1010100 Difference: 000110

• Multiplication
Multiplicand 1011
Multiplier × 101
Partial Products 1011
0000 -
1011 - -
Product 110111
Binary Division
• Division in binary follows the same procedure
as division in decimal.

10 2 11 3
11 110 3 6 10 110 2 6
11 6 10 6
000 0 10 0
10
00
Binary Division
• Examples : Perform the binary division of the decimal
numbers 18 and 8.
The equivalent binary representation of the decimal number
18 is 10010.
The equivalent binary representation of the decimal number
8 is 1000.

1 0 0 0 ) 1 0 0 1 0 ( 1 0 Quotient
1 0 0 0
0 0 0 1 0
0 0 0 0 0
0 0 0 1 0 Remainder

You might also like