0
$\begingroup$

I am a bit confused about the range of values for signed binary system. If I have $3$ bit to represent a number system, then number range will be given by $-2^{n-1}$ to $2^{n-1}-1$, that is $-4$ to $+3$. Each number is listed below (using 2's complement) :

$3$ : $011$

$2$ : $010$

$1$ : $001$

$0$ : $000$

$-1$ : $111$

$-2$ : $110$

$-3$ : $101$

Here I have enlisted seven numbers. But I have a range from $-4$ to $+3$.

Where and how I can obtain $-4$. It requires four binary digit to obtain $-4$, that is $-4$ : $1100$.

My question is how I can fulfill the range condition by having $-4$ in my three binary digit list ?

$\endgroup$
1
$\begingroup$

It's quite simple: the only value you have left is 100 and it corresponds to -4.

You can check that the operations produce the results you want: e.g. -4 + 3 = 100 + 011 = 111 = -1.

$\endgroup$
4
  • $\begingroup$ but first bit is sign bit. 1 represents negative and last two bit represents value. So in that case -0 makes more sense than - 4 ! $\endgroup$
    – AL-zami
    Mar 30 '17 at 8:42
  • $\begingroup$ The lowest number is an exception to this rule. Coincidentally, your system is also mentioned by Wikipedia. $\endgroup$
    – Glorfindel
    Mar 30 '17 at 8:44
  • $\begingroup$ how the exception is handled mathematically.What is the intuition behind it? $\endgroup$
    – AL-zami
    Mar 30 '17 at 10:18
  • $\begingroup$ The intuition behind it is more obvious if you look at the unsigned counterparts (-4 -> 4, -3 -> 5, etc.) $\endgroup$
    – Glorfindel
    Mar 30 '17 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.