Correct way to find 8's complement?

324 Views Asked by At

I'm trying to figure out how to find 8's complement, but am unable to do so. Online it shows that we need to subtract each digit from 7 when the number is in it's octal bit. It gives the 7's complement and then we add 1 to it to gets the 8's complement.

However some other sources have been subtracting each digit of the number from 8 directly to get the 8's complement.

What is the right procedure of getting 8's complement?