This looks like homework, so I'm not going to give you the answer, but I can help you find your answer. Please fill in all the blanks, and answer the interspersed questions.
45 in binary is ________[1]
114 in binary is ________[2]
These can both be represented in 8 bits. But when they're represented in 8 bits, if interpreted as 2's complement, would they be interpreted as negative or positive numbers? (My guess is that they should be positive, since they're both less than 127, which is the largest number that can be represented as 8 bit 2's complement.)
Now do binary addition of [1] + [2], giving the result ________[3]
Now, when [3] is represented in 8 bits, if interpreted as 2's complement, would it be interpreted as a negative or positive number? (If I do the math in decimal, I notice that 45 + 107 is 159, which is greater than 127, so I'm guessing there's going to be an "issue" here.)
Finally, what is the actual value of [3], interpreted as 2's complement? Fill it in here: ___[4]
Is [4] equal to 159? If not, why not?
What do you get if you take [4], remove the minus sign to convert it to a positive number (that is, take the absolute value), and add it (as an ordinary number) to 159? Does that sum look familiar?
Now, to the other problem.
Figure out the 8-bit 2's complement representation of -93: ________[5]
Figure out the 8-bit 2's complement representation of -35: ________[6]
As a side problem, just for fun, interpret [5] as an ordinary (not 2's complement) 8-bit binary number. (It will therefore be a positive number.) Answer: ___[7]
Do the same with [6]. Answer: ___[8]
Compute (using ordinary arithmetic) [7] + 93. Does that number look familiar?
Compute (using ordinary arithmetic) [8] + 35. Does that number look familiar?
Now add together [7] and [8] in binary: _________[9]. How many bits does the result have? Is it more than 8?
If it's more than 8 bits, throw away the top bit, to leave 8 bits: ________[10]
Interpreting [10] as an ordinary binary number, what is it? ___[11]
Interpreting [10] as a 2's complement number, what is it? ___[12] (This is a little tricky, be careful.)
Finally, if you do the problem using ordinary arithmetic, does -93 plus -35 equal [12]?
If you're still feeling lost, here are a few different examples to think about. Let's look at the number 37.
37 in binary is 00100101
the two's complement of 00100101 is 11011011
so -37 in two's complement is 11011011
Also, as a sort of a double-check, notice that if we take 11011011 as an ordinary binary number it's 219. And then notice that 256 - 37 = 219.
Now, let's do a simple addition problem. I'm going to show it in three columns: (A), (B), and (C). Column (B) is binary. Column (A) is the binary numbers in column (B), interpreted as 2's complement. Column (C) is the binary numbers in column (B), interpreted as ordinary numbers (not 2's complement).
Also, the 8-bit sum overflows, so there are two different "bottom lines": the full 9-bit sum, and the sum after throwing away the 9th or carry bit.
(A) (B) (C)
50 00110010 50
+ -37 + 11011011 + 219
--- --------- ---
(n/a) 100001101 269
13 00001101 13
One more thing: notice that 269 - 13 = 256.