0% found this document useful (0 votes)
23 views4 pages

Addition of Two S Complement Numbers

This document discusses addition of two's complement numbers in 3 steps: 1) It explains how to represent a number in two's complement form by taking the one's complement and adding 1. 2) It provides examples of adding two negative numbers represented in two's complement form. The process involves extending the most significant bit to match operand sizes before adding. 3) It gives additional examples of adding two's complement numbers along with step-by-step workings and verifications of the results.
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)
23 views4 pages

Addition of Two S Complement Numbers

This document discusses addition of two's complement numbers in 3 steps: 1) It explains how to represent a number in two's complement form by taking the one's complement and adding 1. 2) It provides examples of adding two negative numbers represented in two's complement form. The process involves extending the most significant bit to match operand sizes before adding. 3) It gives additional examples of adding two's complement numbers along with step-by-step workings and verifications of the results.
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/ 4

Addition of Two’s Complement Numbers

Prepared by
Bhanu Prakash Reddy
TA

Verified by
Dr. Vikramkumar Pudi
Assistant Professor

February 1, 2021

1 Radix Complement
The r’s complement of an n‐digit number N in base r is defined as rn − N for N ̸= 0 and as 0 for N = 0. Comparing
with the (r - 1)’s complement, we note that the r’s complement is obtained by adding 1 to the (r - 1)’s complement,
since rn − N = [(rn − 1) − N ] + 1. Thus, the 10’s complement of decimal 2389 is 7610 + 1 = 7611 and is obtained
by adding 1 to the 9’s complement value. The 2’s complement of binary 101100 is 010011 + 1 = 010100 and is
obtained by adding 1 to the 1’s‐complement value.
The following problems provides the brief idea to perform the Two’s complement of a number and Addition
of the two’s complement numbers.
Two’s complement of number
The process of representation as follows,
• Consider the Positive number,
• calculate the 1’s complement,
• Add 1 at LSB.
Example Represent −19 in Two’s complement form

Given number = −19


−19 = −(010011)
1′ s complement (010011) = 101100
Add 1 at LSB = 101101
−19 = 101101

HINT
Alternative method to calculate the twos complement of number.
• Find the binary 1 position from LSB side of a number.
• If any digit equal to binary 1, then keep the bit as binary 1 and do the ones complement of the remaining
numbers after the binary 1 bit position.
By using above process the two’s complement of −19 as follows,

−19 = −(010011)

1
here the LSB bit is 1, then keep the LSB bit as 1 and do the one’s complement of remaining numbers.

−19 = −(010011)
−19 = 101101

Example: Represent the following binary number in 2’s complement form 01100011000
By using above hint, first find the binary 1 digit at LSB side, if any binary 1 is present then keep the bit as it is and do
the 1’scomplement process to the remaining bits after that bit. The calculation of 2’s complement as shown figure 1.

01100011000
10011101000
1's Complement Equal bits
Figure 1: 2’s Complement of 01100011000

2 Addition Problems
2.1 ADD -19 and -7

−19 = −(010011) = 101101 (1)


−7 = −(00111) = 11001 (2)

when performing the addition of any numbers first one can calculate the size of the final result which is equals to
maximum operand size plus one. Here the maximum input size is 6 bit, then the final result will be 7 bit wide.
In general if the operands A and B of size M and N, then the size of the addition of A and B is equal to
maximum size {M,N}+1.
The addition of equations 1 and 2 as follows,

−19 = 101101 (3)


−7 = 11001 (4)

The size of the inputs are not equal and to avoid the overflow problem we need to extend the MSB bit in both operands
until the size reaches to size of the final result, here the final resultant size is 7bit.
In the above figure red colour digits indicates the extension of the sign bit.

2
1 1 0 1 1 0 1 = -19
1111001=- 7
1 1 1 0 0 1 1 0 = -26
Discard the bit
1 Extention bit
Figure 2: Addition of -19 and -7

Verification

1100110 = −1 × 26 + 1 × 25 + 1 × 22 + 1 × 21 (5)
= −64 + 32 + 4 + 2 (6)
= −26 (7)

2.2 ADD 1001 and 10101

11 1 carry bits
1 1 0 1 0 1 = -11
111001=- 7
1 1 0 1 1 1 0 = -18
Figure 3: Addition of -11 and -7

2.3 ADD -86 and -14


The figure 4 shows the addition of −86 & − 14. The verification of the final result as shown in below.

carry bits
1111 1
1 1 0 1 0 1 0 1 0 = -86
1 1 1 1 1 0 0 1 0 = -14
1 1 1 0 0 1 1 1 0 0 =-100
Figure 4: Addition of -86 and -14

3
Verification

110011100 = −1 × 28 + 1 × 27 + 1 × 24 + 1 × 23 + 1 × 22 (8)
= −256 + 128 + 16 + 8 + 4 (9)
= −256 + 156 (10)
= −100 (11)

2.4 ADD -14 and -15


The figure 5 shows the addition of −14 & − 15.

carry bits
11
1 1 0 0 1 0 = -14
1 1 0 0 0 1 = -15
1 1 0 0 0 1 1 = -29
Figure 5: Addition of -14 and -15

2.5 ADD -46 and -85


The figure 6 shows the addition of −46 & − 85.

carry bits
1111 1
1 1 1 0 1 0 0 1 0 = -46
1 1 0 1 0 1 0 1 1 = -85
1 1 0 1 1 1 1 1 0 1 =-131
Figure 6: Addition of -46 and -85

You might also like