0% found this document useful (0 votes)
110 views20 pages

FDS E2 PDF

Here are the key steps to subtract binary numbers using 2's complement: 1) Take the 2's complement of the subtrahend 2) Add the minuend and the 2's complement of the subtrahend 3) The result is the difference in 2's complement form For example, to solve 10010(18) - 11100(28): 1) 2's complement of 11100 is 00100 2) Add the minuend and complement: 10010 + 00100 = 10110 3) The difference is 01010 in 2's complement form, which is -10 in decimal.

Uploaded by

Bikash Chhetri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
110 views20 pages

FDS E2 PDF

Here are the key steps to subtract binary numbers using 2's complement: 1) Take the 2's complement of the subtrahend 2) Add the minuend and the 2's complement of the subtrahend 3) The result is the difference in 2's complement form For example, to solve 10010(18) - 11100(28): 1) 2's complement of 11100 is 00100 2) Add the minuend and complement: 10010 + 00100 = 10110 3) The difference is 01010 in 2's complement form, which is -10 in decimal.

Uploaded by

Bikash Chhetri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

2.

Binary Arithmetic Operation

2.1 1’s Complement Operation


2.2 2’s Complement Operation
2.3 Addition Operation
2.4 Subtraction Operation
2.5 Multiplication Operation

Bikash Chhetri
1’s Complement Operation

• 1’S complement of a binary number is simply found by changing all 1s


by 0s and all 0s by 1s.

Binary Number 1’s Complement


1010 0101
11010 00101
110111 001000
1011011 0100100
Q. Find the 1’s complement of following binary
number.
a. 001
b. 11011
c. 1010111
d. 10101110
e. 0000110
2’s Complement Operation
• Simply the 2’S complement of a binary number is found by adding 1
to the 1’S complement of that number.

Convert the following binary numbers to their 2’S Complements.


a. 101
Solution
a. 010 → 1’S Complement of the binary number 101
+1 → adding 1
011 → 2’S Complement of the number 101
Q. Find the 2’s complement of following binary
number.
a. 101010
b. 001100
c. 11011011
d. 10111101
e. 011101111
2.3 Addition Operation

There are four steps in binary addition, they are written below
0+0=0
0+1=1
1+0=1
1 + 1 = 0 (carry 1 to the next significant bit)
Q. Addition Operation
1. 11001
+ 00110
1 11 11

2. 111011
+110110
2.4 Subtraction Operation

Here are four simple steps to keep in memory


0–0=0
0 – 1 = 1, borrow 1 from the next more significant bit
1–0=1
1–1=0
Q. Subtraction Operation
a. 10101010
- 10100010
00001000
2.5 Multiplication Operation

Here are four simple steps to keep in memory


0×0=0
1×0=0
0×1=0
1×1=1 (there is no carry or borrow for this)
1111
*110
Subtraction using 1’s Complement

1. (110101)2 - (100101)2

1’st Complement of 100101 => 011010

Addition:
110101
+011010
Ignore 1001111
+1
010000 Final Answer
Subtraction using 1’s Complement

1. (101011) 2 - (111001) 2

1’s Complement of 111001 => 000110


Addition:
101011
+ 000110
110001 1’s Complement of 110001 => 001110
Question
1. 10010 – 111000
2. 10001 – 1001001
3. 100100 – 1100
4. 10011 - 1011
Subtraction using 2’s Complement

1. (110101)53 - (100101)37

1’s complement of 100101: 011010


2’s Complement: 011010
+ 1
011011

Addition:
110101
011011
Ignore 1010000

Answer: 010000(16)
Subtraction using 2’s Complement
(101011) - (111001)

2’s complement of 111001: 000110


+1
000111

Addition:
101011
+000111
X 110010
2’s complement of 110010: 001101
+1
001110
Answer: - 001110
Question:
1. (100100) - (1100)

100100 - 001100
2’s complement: 110011
+1
110100
Addition: 100100
+ 110100
1011000
Answer: 011000
Q. 10010(18) - 11100(28)
step:1 2’s complement 11100 : 00011
+ 1
00100
Addition: 10010
+00100
10110
2’s complement of 10110: 01001
+ 1
01010
Answer= (-01010) (-10)

You might also like