Express the negative value -27 as a 2’s complement integer using eight bits. Rep
ID: 3880326 • Letter: E
Question
Express the negative value -27 as a 2’s complement integer using eight bits. Repeat, using 16 bits. Repeat, using 32 bits. What does this illustrate with respect to the properties of sign extension as they pertain to 2’s complement representation.
Write the results of the following additions as both 8-bit binary and decimal numbers. For each part, use standard binary addition.
A) Add the signed magnitude representation of 7 to the signed magnitude representation of -7.
B) Add the 2’s complement representation of 7 to the 2’s complement representation of 7.
Explanation / Answer
1st bit is sign bit
-27 in 8 bits = 1110 0101
-27 in 16 bits =1111 1111 1110 0101
-27 in 32 bits = 1111 1111 1111 1111 1111 1111 1110 0101
This illustrates that by padding the left side with ones, the negative sign and the value of the original number are maintained. This property is sign extension property.
A)
In Sign Magnitude Keep the sign bit in the MSB, the calculate the binary of the magnitude and keep those in the remaining 7 bits.
7 = 0000 0111
-7 = 1000 0111
---------------------------
ignore the sign MSB bit .Both the values are equal after MSB is ignored. So perform the following
000 0111
000 0111
-----------------
000 0000
Now keep the sign bit of the either magnitude value ,i.e., of -7 which is 1 or of 7 which is 0.
=> Answer is 0000 0000 or 1000 0000
And this represents 0 here.
0 has 2 forms in Signed Magnitude 0000 0000 and 1000 0000.
And 0 has one form in 2's complement.
ANS = 0
B) 7 = 0000 0111
-7 = 1111 1001
---------------------------
0000 0000
9 th overflow bit is discarded as carry coming in to the MSB isa same as carry going out of the MSB. So, No overflow case.
ANS = 0
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.