# Thread: One's Complement of a Number

1. ## One's Complement of a Number

Find the one's complement representations, using bit strings of length six, of the following integers:

(a) 22
(b) 31
(c) -7
(d) -19

The book only explains how but gives no examples, and our professor never covered it in class. Any help is much appreciated.

2. ## Ones complemet

Hello Aryth
Originally Posted by Aryth
Find the one's complement representations, using bit strings of length six, of the following integers:

(a) 22
(b) 31
(c) -7
(d) -19

The book only explains how but gives no examples, and our professor never covered it in class. Any help is much appreciated.
To find the six-bit ones complement:

• If it's a positive number, simply write down the six bit binary number that represents the denary number
• If it's negative, write down the binary representation, and then change all the zeros to ones, and ones to zeros.

So the answers to (a) and (c) are:

(a) 010110

(c) 7 is 000111 in binary. So -7 is 111000 in ones complement

I'll leave you to do the other two.

3. I appreciate the help.