-128 to 127
-128 to 127, in two's-complement.
-128 to 127, in two's-complement.
Bits administrator
Range of 8 bit signed number is -128 to 127 Reference: digital fundamentals by Floyd
An N-bit integer holds 2N different values.For an unsigned integer, the range of values is 0..2N-1 thus.For a signed integer using 2s complement, the range is -2N-1..+2N-1-1.Therefore, the largest positive number that can be stored using 8 bits is 255.
We need signed integers in order to represent both negative and positive values. However, some numbers can never be negative. For instance, the size of a file must always be greater than or equal to zero so we use unsigned integers to represent file sizes. Also, natural numbers must be greater than 0 so there's no point in using a signed value to represent a natural number. Signed integers also use one bit to denote the sign, but unsigned integers do not thus unsigned integers can effectively represent twice the range of positive values than an unsigned integer can. For instance, an 8-bit signed value can represent values in the range -128 to +127 using twos complement notation, but an 8-bit signed value can represent values in the range 0 to 255.
Using 4 bits the signed range of numbers is -8 to 7. When working with signed numbers one bit is the sign bit, thus with 4 bits this leaves 3 bits for the value. With 3 bits there are 8 possible values, which when using 2s complement have ranges: for non-negative numbers these are 0 to 7; for negative numbers these are -1 to -8. Thus the range for signed 4 bit numbers is -8 to 7.
(-128, 127) because (-1/2(2^n), 1/2(2^n)-1 )
If a memory location is to contain a signed integer, then it will have a sign bit (zero means positive, one means negative). Also the negative numbers are represented by a complement (normally the two's complement). The article in the related link does a good explanation. What this means: for example, an 8 bit location could represent 256 possible numbers. In an unsigned situation, this would be 0 to 255. But in a signed situation, the range is -128 to +127.
An 8 bit displacement is a two's complement signed value, with a possible range of -128 to +127. To convert it to an 16 bit displacement, sign extension is done. This means that the implied high byte is FFH if the high bit of the low byte is 1, or 00H if not. The resulting 16 bit displacement will still have a range of -128 to +127.
The highest unsigned integer is 255; The highest signed integer is 127.