In 8-bit two's complement arithmetic, compute the result of the following addition: A = 10011001, B = 11010111. What is the resulting 8-bit binary value?
Step-by-step Solution:
Convert both numbers to decimal (two’s complement form)
\[
A = 10011001_2
\]
MSB = 1 ⇒ negative number
Invert bits:
\[
01100110_2 = 102_{10}
\]
Add 1:
\[
102 + 1 = 103
\]
\[
\Rightarrow A = -103
\]
\[
B = 11010111_2
\]
MSB = 1 ⇒ negative number
Invert bits:
\[
00101000_2 = 40_{10}
\]
Add 1:
\[
40 + 1 = 41
\]
\[
\Rightarrow B = -41
\]
Add them
\[
A + B = -103 + (-41) = -144
\]
In 8-bit two’s complement, range is:
\[
-128 \text{ to } +127
\]
Since
\[
-144 < -128
\]
\[
\Rightarrow \textbf{Overflow occurs}
\]
Compute the 8-bit result (binary addition)
\[
10011001
\]
\[
+11010111
\]
\[
= 1,01110000 \quad (9 \text{ bits})
\]
Drop the carry beyond 8 bits:
\[
01110000
\]
Final Result
\[
{01110000_2}
\]
Overflow occurred.
Actual mathematical result = (-144),
Stored 8-bit value = (+112).