- #1
shamieh
- 539
- 0
I don't understand something.
Perform the following operations involving eight-bit 2's complement numbers and indicate whether arithmetic overflow occurs.
If I have
\(\displaystyle
01110101
+11011110
\)
I know that the second term is negative because there is a 1 in front.
Now, because it is negative do I need to
1) Take the second term and invert it making it: 00100001.
2) then do I need to add the original form of it.. so: 11011110 + 00100001 = 11111111
3) Then add 1 to it? 11111111 + 1 = 11111110
4)Then go back to my original problem and put
01110101 + The new number? --> 111111110
and I know that if I have two positive numbers (both most left bit begins with zero, then I won't have overflow). But how will I know if I have overflow with these numbers?
Will my final answer be... 01010110 ? It doesn't make sense I follwoed this guys steps exactly and It just doesn't work
Perform the following operations involving eight-bit 2's complement numbers and indicate whether arithmetic overflow occurs.
If I have
\(\displaystyle
01110101
+11011110
\)
I know that the second term is negative because there is a 1 in front.
Now, because it is negative do I need to
1) Take the second term and invert it making it: 00100001.
2) then do I need to add the original form of it.. so: 11011110 + 00100001 = 11111111
3) Then add 1 to it? 11111111 + 1 = 11111110
4)Then go back to my original problem and put
01110101 + The new number? --> 111111110
and I know that if I have two positive numbers (both most left bit begins with zero, then I won't have overflow). But how will I know if I have overflow with these numbers?
Will my final answer be... 01010110 ? It doesn't make sense I follwoed this guys steps exactly and It just doesn't work