# Is it possible to compute -12 (decimal) in 4 bits binary

This is what I have so far

1 1 0 0

Switch values by 2s Complement

0 0 1 1 + 1

0 1 0 0

## 1 Answer

No, it's not possible, at least using the standard representations. An unsigned $n$-bit number can represent any integer in the interval $[0, 2^{n} - 1]$. A signed $n$-bit number using two's complement can represent integers in the interval $[-2^{n - 1}, 2^{n - 1} - 1]$. With $n = 4$, that gives an interval of $[-8, 7]$, which obviously doesn't include $12$. One's complement can use $n$ bits to represent the interval $[-(2^{n - 1} - 1), 2^{n - 1} - 1]$, giving the interval $[-7, 7]$ for four bits, which also doesn't work. You'd have to contrive a nonstandard representation to represent $-12$ in four bits.

• Thanks for answering. So, in that case would it be possible to compute −12 in 5 bits and I can state that there is insufficient number of bits or is it arbitrarily unable to represent?
– Fred
Feb 18 '16 at 20:54
• 5 bits would work, yes; 4 is insufficient using the standard forms. An example of a nonstandard representation that would work is a representation that assumes a negative sign in front, which would allow 4 bits to represent $[-15, 0]$, which includes $-12$; however, I don't know that anyone has ever used something like that. Feb 18 '16 at 20:59
• You have help me a lot. Thank you so much !
– Fred
Feb 18 '16 at 21:10
• If the answer satisfies you, you can mark it accepted by clicking the check mark next to the answer's text. Feb 18 '16 at 21:11