Twos Complement                                                                               

 

This is what you were taught before: 

Convert to ones complement and add 1.

 This idea works, but only for negative numbers. 

If you were asked to prove that your answer is correct, would you be able to?

 

Consider this approach to twos complement.

 

*      You will need to know how many bits they are using to represent the number.  From now on, we will use an 8-bit representation.

 

*      In twos complement the left most bit is negative.  This is very important to note.

 

*      Therefore, the column headings will look, as follows:

 

 

 

Column Headings

-27

26

25

24

23

22

21

20

-128

64

32

16

8

4

2

1

 

 

 

 

 

 

 

 

 

 

 

*      Fit the 1s into the cells that will help to make the number.

 

EXAMPLE 1

 

Convert -6010 to its twos complement representation.

 

Column Headings

-27

26

25

24

23

22

21

20

-128

64

32

16

8

4

2

1

 

1

1

0

0

0

1

0

0

 

            Therefore, -128 + 64 + 4 = -6010

 

-6010 in its twos complement form is 110001002

 

EXAMPLE 2

 

Convert 4010 to its twos complement representation.

 

Column Headings

-27

26

25

24

23

22

21

20

-128

64

32

16

8

4

2

1

 

0

0

1

0

1

0

0

0

 

            Therefore, 32 + 8 = 4010

 

4010 in its twos complement form is 001010002

 

Make a Free Website with Yola.