# Is "a" in $2^n$-a **two's complement of a relative to a fixed bit length n** decimal number?

Definition : Given a positive integer a, the two's complement of a relative to a fixed bit length n is the n-bit binary representation of $2^n$-a

Bit lengths of 16 and 32 are the mostly used in practice. However, because the principles are the same for all bit lengths, we use a bit length of 8 for simplicity in this discussion. For instance, because

($2^8-27)_{10} = (256-27)_{10} = 229_{10} = (128 +64+32+4+1)_{10} = 11100101_{2}$.

the 8-bit two's complement of 27 is $11100101_2$.

Source: Discrete Mathematics with Applications by Susanna Epp, p. 84

• Unclear question. Jan 20 '16 at 12:34
• Can you rephrase your question?
– 5xum
Jan 20 '16 at 12:35
• Since $2^n$ is a decimal representation and not a binary, one might think so... Jan 20 '16 at 12:36
• Being "a decimal number" is not an inherent property of a number. A number can be written written down in different systems of notations, but it is the same number no matter how you choose to write it down (or even if you don't plan on writing it down at all). So asking whether $a$ is a decimal number in this definition does not make sense. Jan 20 '16 at 12:39
• There are no octal numbers. There are octal representations (names) for numbers. Treating $10_{10}$ and $101_3$ as "different" is like treating the german number "drei" as different from "three." They are different ways of naming the same thing. Jan 20 '16 at 13:17

The question isn't really relevant. $a$ denotes an integer number independently of its literal representation.
$2^n$ is indeed mot probably decimal (it can't be binary and there's no reason to silently use octal, hex or another).
$$256_d-AB_h=2_d^8-10101011_b=100_h-171_d\cdots$$