Search code examples
binary

convert decimal numbers to excess-127 representations


Represent the following decimal numbers in binary using 8-bit signed magnitude, one’s complement, two’s complement, and excess-127 representations.

a) 77

b) –42

c) 119

d) –107

I've converted them to the other representations just need to know how to convert to excess-127

a) Signed magnitude: 01001101 One's complement: 01001101 Two's complement: 01001101

b) Signed magnitude: 10101010 One's complement: 11010101 Two's complement: 11010110

c) Signed magnitude: 01110111 One's complement: 01110111 Two's complement: 01110111

please help


Solution

  • Assuming you are referring to Offset binary: https://en.wikipedia.org/wiki/Offset_binary, of which the most famous example would be Excess-3: https://en.wikipedia.org/wiki/Excess-3, then the solution would be:

    • a) 77 + 127 mod 256 = 204 mod 256 = 204 = 11001100
    • b) -42 + 127 mod 256 = 85 mod 256 = 85 = 01010101

    etc...