Search code examples
bit-manipulationcpu-architecturetwos-complementcomplement

10's complement of a number statement


The values of a,x,y if 47x80 is the 10's complement of yaya0 is:

I calculated the 10's complement of yaya0 to be 100,000-yaya0 and then.

   47x80=100,000-yaya0

Now how to find values ?


Solution

  • 47080 + 100x = 100000 - (10000y + 1000a + 100y + 10a)
    52920 = 100x + 10100y + 1010a
    

    ==> a = 2 otherwise you won`t get the 2 as tens

    50900 = 100x + 10100y
    

    this can be split up in 5 = y and 9 = x + y

    so

    a = 2
    x = 4
    y = 5