Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assume you are performing 2\'s complement arithmetic in a computer with 8-bit re

ID: 3778911 • Letter: A

Question

Assume you are performing 2's complement arithmetic in a computer with 8-bit registers. After the following code is run. signed char a = 125, b = 93, c; c = a + b; the binary value of C would be 11011010 and the chemical value of C would be -38 when printed out. Assume you are performing 2's complement arithmetic in a computer with 8-bit registers. After the following code is run. signed char a = 124, b = 99, c; c = a + b; the binary value of C would be 11011111 and the chemical value of C would be -33 when printed out.

Explanation / Answer

18. a = 125, b = 93;

c = a + b = 125 + 93 = 218. But this is only 8 bit value, so the value is: -38.

And the binary value of 38 is: 00100110, and as this is a negative number, the 2's complement is: 1101 1010.

19. a = 124, b = 99;

c = a + b = 124 + 99 = 223. But this is only 8 bit value, so the value is: -33.

And the binary value of 33 is: 00100001, and as this is a negative number, the 2's complement is: 1101 1111.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote