Digital design

Thread Starter

rds1975

Joined Aug 30, 2004
8
Hi

Can somebody help me in solving this problem ?

Express the negative value –27 as a 2’s complement integer using 8 bits. Repeat,
using 16 bits and 32 bits respectively. What does this illustrate with respect to the
properties of sign extension as they pertain to 2’s complement representation.

Thanks and regards
 

Kingcosmos

Joined Sep 23, 2004
5
Originally posted by rds1975@Sep 21 2004, 12:56 AM
Hi

Can somebody help me in solving this problem ?

Express the negative value –27 as a 2’s complement integer using 8 bits. Repeat,
using 16 bits and 32 bits respectively. What does this illustrate with respect to the
properties of sign extension as they pertain to 2’s complement representation.

Thanks and regards
[post=2589]Quoted post[/post]​
It has been a while so let me see. In order to show -27 in 2's complement you need to write out +27 in binary (using 8 bits):

00011011

Then change all 0's to 1's and all 1's to zeroes:

11100100

Then add 1:

11100100 + 1 = 11100101

Therefore 11100101 is -27 in 2's complement.

Repeat using 16 bits and 32 bits. As to the answer of your question I am not sure. I would answer it by saying that all negative numbers in binary have a 1 as a sign bit. :blink:
 
did you know that most scientific calculators show negative numbers in the 2s compliment? So if you are as lucky as I was, you can just type in -27, then hit your decimal to binary button, and the problem is solved. (I use texas instruments)
 
Top