Two’s Complement

(integer representation)

 

This method is used to represent negative numbers.

 

Tens complement of a number is worked out by adding “1” to the nines complement.

 

For example

                            

 

9

9

9

8

6

4

+

 

 

 

 

 

 

1

 

 

9

9

9

8

6

5

 

 

This is the 10s complement of 135

 

Twos complement of a number is worked out by adding “1” to the ones complement

 

For example

 

 

0

1

1

1

1

0

0

0

+

 

 

 

 

 

 

 

 

1

 

 

0

1

1

1

1

0

0

1

 

 

This is the 2s complement of 1000 0111

 

The eight bit representation of 2s complement for 8 to –8

 

 

8

 

 

 

0

0

0

0

 

1

0

0

0

 

7

 

 

 

0

0

0

0

 

0

1

1

1

 

6

 

 

 

0

0

0

0

 

0

1

1

0

 

5

 

 

 

0

0

0

0

 

0

1

0

1

 

4

 

 

 

0

0

0

0

 

0

1

0

0

 

3

 

 

 

0

0

0

0

 

0

0

1

1

 

2

 

 

 

0

0

0

0

 

0

0

1

0

 

1

 

 

 

0

0

0

0

 

0

0

0

1

 

0

 

 

 

0

0

0

0

 

0

0

0

0

 

-1

 

 

 

1

1

1

1

 

1

1

1

1

 

-2

 

 

 

1

1

1

1

 

1

1

1

0

 

-3

 

 

 

1

1

1

1

 

1

1

0

1

 

-4

 

 

 

1

1

1

1

 

1

1

0

0

 

-5

 

 

 

1

1

1

1

 

1

0

1

1

 

-6

 

 

 

1

1

1

1

 

1

0

1

0

 

-7

 

 

 

1

1

1

1

 

1

0

0

1

 

-8

 

 

 

1

1

1

1

 

1

0

0

0

 

   

Hosted by www.Geocities.ws

1