Skip to main content
edited title
Link
Mahesha999
  • 1.8k
  • 7
  • 30
  • 45

Why complement of most negative number in octal does not turn out to be itself

added 19 characters in body
Source Link
Mahesha999
  • 1.8k
  • 7
  • 30
  • 45

I know the range of the $n$ digit numbers in $r$'s complement system is given as

$r^{n-1}-1$ to 0 to $-r^{n-1}$.

So for 3 bit 2's complement, its:

$(2^2-1)$ to $0$ to $-(2^2)$
that is
$3$ to $0$ to $-4$
that is
$(011)_{\text{2's comp}}$ to $(0)_{\text{2's comp}}$ to $(100)_{\text{2's comp}}$

And for 3 digit 8's complement, its

$(8^2-1)$ to $0$ to $-(8^2)$
that is
$63$ to $0$ to $-64$
that is
$(077)_{\text{8's comp}}$ to $(0)_{\text{8's comp}}$ to $(700)_{\text{8's comp}}$

Now I came to know that the $r$'s complement of the minimum number in the range will be the same number.

the $r$'s complement of the smallest / most $-$ve number in the range will be the same number.

For example, taking 2's complement of most $-$ve / smallest number possible with 3 bit 2's complement system, $(100)_{\text{2's comp}}$ is itself.:

1 0 0  
0 1 1 (1's complement)
1 0 0 (add 1 to get 2's complement)

But taking 8's complement of most $-$ve / smallest number possible with 3 digit 8's complement system, $(700)_{\text{8's comp}}$ does not seem to be itself:

7 0 0
0 7 7 (7's complement)
1 0 0 (add 1 to get 8's complement)

So 8's complement of 700 does not seem to be 700 itself but is in fact 100. So what I am missing? Or I am doing it all wrong?

I know the range of the $n$ digit numbers in $r$'s complement system is given as

$r^{n-1}-1$ to 0 to $-r^{n-1}$.

So for 3 bit 2's complement, its:

$(2^2-1)$ to $0$ to $-(2^2)$
that is
$3$ to $0$ to $-4$
that is
$(011)_{\text{2's comp}}$ to $(0)_{\text{2's comp}}$ to $(100)_{\text{2's comp}}$

And for 3 digit 8's complement, its

$(8^2-1)$ to $0$ to $-(8^2)$
that is
$63$ to $0$ to $-64$
that is
$(077)_{\text{8's comp}}$ to $(0)_{\text{8's comp}}$ to $(700)_{\text{8's comp}}$

Now I came to know that the $r$'s complement of the minimum number in the range will be the same number.

For example, taking 2's complement of most $-$ve / smallest number possible with 3 bit 2's complement system, $(100)_{\text{2's comp}}$ is itself.

But taking 8's complement of most $-$ve / smallest number possible with 3 digit 8's complement system, $(700)_{\text{8's comp}}$ does not seem to be itself:

7 0 0
0 7 7 (7's complement)
1 0 0 (add 1 to get 8's complement)

So 8's complement of 700 does not seem to be 700 itself but is in fact 100. So what I am missing? Or I am doing it all wrong?

I know the range of the $n$ digit numbers in $r$'s complement system is given as

$r^{n-1}-1$ to 0 to $-r^{n-1}$.

So for 3 bit 2's complement, its:

$(2^2-1)$ to $0$ to $-(2^2)$
that is
$3$ to $0$ to $-4$
that is
$(011)_{\text{2's comp}}$ to $(0)_{\text{2's comp}}$ to $(100)_{\text{2's comp}}$

And for 3 digit 8's complement, its

$(8^2-1)$ to $0$ to $-(8^2)$
that is
$63$ to $0$ to $-64$
that is
$(077)_{\text{8's comp}}$ to $(0)_{\text{8's comp}}$ to $(700)_{\text{8's comp}}$

Now I came to know that

the $r$'s complement of the smallest / most $-$ve number in the range will be the same number.

For example, taking 2's complement of most $-$ve / smallest number possible with 3 bit 2's complement system, $(100)_{\text{2's comp}}$ is itself:

1 0 0  
0 1 1 (1's complement)
1 0 0 (add 1 to get 2's complement)

But taking 8's complement of most $-$ve / smallest number possible with 3 digit 8's complement system, $(700)_{\text{8's comp}}$ does not seem to be itself:

7 0 0
0 7 7 (7's complement)
1 0 0 (add 1 to get 8's complement)

So 8's complement of 700 does not seem to be 700 itself but is in fact 100. So what I am missing? Or I am doing it all wrong?

Source Link
Mahesha999
  • 1.8k
  • 7
  • 30
  • 45

Why complement of most negative number in octal does turn out to be itself

I know the range of the $n$ digit numbers in $r$'s complement system is given as

$r^{n-1}-1$ to 0 to $-r^{n-1}$.

So for 3 bit 2's complement, its:

$(2^2-1)$ to $0$ to $-(2^2)$
that is
$3$ to $0$ to $-4$
that is
$(011)_{\text{2's comp}}$ to $(0)_{\text{2's comp}}$ to $(100)_{\text{2's comp}}$

And for 3 digit 8's complement, its

$(8^2-1)$ to $0$ to $-(8^2)$
that is
$63$ to $0$ to $-64$
that is
$(077)_{\text{8's comp}}$ to $(0)_{\text{8's comp}}$ to $(700)_{\text{8's comp}}$

Now I came to know that the $r$'s complement of the minimum number in the range will be the same number.

For example, taking 2's complement of most $-$ve / smallest number possible with 3 bit 2's complement system, $(100)_{\text{2's comp}}$ is itself.

But taking 8's complement of most $-$ve / smallest number possible with 3 digit 8's complement system, $(700)_{\text{8's comp}}$ does not seem to be itself:

7 0 0
0 7 7 (7's complement)
1 0 0 (add 1 to get 8's complement)

So 8's complement of 700 does not seem to be 700 itself but is in fact 100. So what I am missing? Or I am doing it all wrong?