Q1-ANS)
for -117d:
$-117d = -(01110101)b$
$-(01110101)b = 10001010(oc8) + 1 = 10001011(tc8)$
for -127d:
$-127d=-(01111111)b$
$-(01111111)b = 10000000(oc8) + 1 = 10000001(tc8)$
for 127d:
$127d = 01111111b = 01111111(tc8)$
for 0d:
$0d = 00000000b$
$Two's complement = one's complement + 1 = 11111111(oc8) +1 = 00000000(tc8)$
due to overflow the 9th digit is removed
Q2-ANS)
1.
$10010001(tc8) = -(01101110+1)d = -(01101111)b = -((0 × 2^7) + (1 × 2^6) + (1 × 2^5) + (0 × 2^4) + (1 × 2^3) + (1 × 2^2) + (1 × 2^1) + (1 × 2^0))d = -111d$
2.
$00010001(tc8) = ((0 × 2^6) + (0 × 2^5) + (1 × 2^4) + (0 × 2^3) + (0 × 2^2) + (0 × 2^1) + (1 × 2^0))d = 17d$
3.
$01111111(tc8) = ((1 × 2^6) + (1 × 2^5) + (1 × 2^4) + (1 × 2^3) + (1 × 2^2) + (1 × 2^1) + (1 × 2^0))d = 127d$
4.
$0000000 (tc8) = ((0 × 2^6) + (0 × 2^5) + (0 × 2^4) + (0 × 2^3) + (0 × 2^2) + (0 × 2^1) + (0 × 2^0))d = 0d$
5.
$11111111(tc8) = -(00000000 + 1)b = -(00000001) = -1d$
Answer submitted by Amirhossein Azizafshari from Thursday 1 PM class.