mahashwetha
mahashwetha

Reputation: 71

minimum bits for a 2s complement of a number

I came across the question to find out 2's complement of -32 . how to determine in minimum no of bits how -32 is represented in 2's complements. Is it 1100000 or 100000

Upvotes: 0

Views: 436

Answers (1)

Kevin Winata
Kevin Winata

Reputation: 379

Easy way to compute 2's complement is adding 1 to its 1's complement. Using 7 bits (min for 32) 32 is 0100000, so -32 is 1011111 using 1's complement. With 2's complement, you add 1 so it becomes 1100000.

Upvotes: 3

Related Questions