__Accuracy __

Numbers are not necessarily stored in a computer with perfect precision. Each number is allowed only a certain number of bits for storage.

Usually integers are stored accurately with a limited range. Real numbers are stored with a large range but less accuracy (using floating-point representation).

__RANGE OF BINARY INTEGERS __

__Positive integers __

As the numbers are all positive no sign bit is necessary.

The largest number which can be stored in a register with *n* bits is 2* ^{n}* – 1.

The smallest number which can be stored is 0 .

__Example __

For an eight-bit word the largest number possible = 11111111_{2}

=100000000_{2}-1=2^{8}-1 (=255)

__Twos complement integers __

If twos complement integers are represented in a register or location of *n* bits, then the largest positive number possible = 2^{n}^{-1}-1

the most negative number possible = -2^{n}^{-1}-1

__Example __

For an eight-bit word the largest number possible =01111111 (as the first bit is a sign bit)

=2^{7}-1 (=127)

The most negative number

=10000000_{2} (first bit=1 to get a negative number; as we are complementing negative numbers, the other bits should be as small as possible i.e. 0)

This represents -(1111111_{2}+ 1) (Taking twos complement)

= -10000000_{2}

= -2^{7} (=-128)

i.e. The range of twos complement integers in an eight-bit register is -128 to 127

__Worked question __

Binary integers are represented using twos complement notation in a 16-bit register. Find their range.

Largest positive integer is 0111111111111111_{2}=2^{15}-1

= 32 767

Most negative integer is 1000 0000 0000 0000_{2} = -(111 1111 11111111_{2}+ 1)

= -1000 0000 0000 0000

=2^{15}

= -32768

i.e. The integers represented. lie in the range -32 768 to +32 767 inclusive