Respuesta :
Answer:
The largest negative integer is -512
Explanation:
Method One
=>Unsigned binary numbers
In a regular representation of unsigned integers, using n bits, the total number of numbers that can be represented is [tex]2^{n}[/tex]. But since zero will be included, the range of numbers that can be represented is from 0 to [tex]2^{n}[/tex] - 1.
For example, using 4 bits, numbers from 0 to [tex]2^{4}[/tex] - 1 can be represented i.e numbers from 0 to 15.
Given a 5-bit, the number will range from 0 to [tex]2^{5}[/tex] - 1 which is 0 to 31.
=> Signed binary numbers.
In a signed number representation (e.g 2's complements), using n bits, the total number of numbers that can be represented is still [tex]2^{n}[/tex]. But since the signs of the number matter (positive and negative integers), the range of numbers that can be represented is from [tex]-2^{n-1}[/tex] to 0 to [tex]2^{n-1}[/tex] - 1.
For example, using 4 bits, numbers from
=> -[tex]2^{4-1}[/tex] to 0 to [tex]2^{4-1}[/tex] - 1.
=> -[tex]2^{3}[/tex] to 0 to [tex]2^{3}[/tex] - 1.
=> -8 to 0 to 7.
That means that for a 4-bit representation;
the largest positive integer is 7 and
the largest negative integer is -8
Using this logic, for a 10-bit 2's complement number, the numbers will range from
=> -[tex]2^{10-1}[/tex] to 0 to [tex]2^{10-1}[/tex] - 1.
=> -[tex]2^{9}[/tex] to 0 to [tex]2^{9}[/tex] - 1.
=> -512 to 0 to 511
That means that the
largest positive integer is 511
largest negative integer is -512
Method Two
Given an hypothetical 10-bit two's complement binary number as follows:
x x x x x x x x x x
In 2's complement representation, when the most significant bit is 1, the number is negative and if 0 it is positive.
Note : The most significant bit (MSB) of a binary number is the leftmost digit. For example, 1000 has an MSB of 1 and 0111 has an MSB of 0.
Since we want to get the largest negative integer, then the MSB of the 10-bit 2's complement binary number written above should be 1.
=> 1 x x x x x x x x x
The MSB has been represented, then the remaining 9 bits are the value of the number to be represented. To get these, please note that the largest negative integer will have the smallest value. The smallest value attainable is therefore 000000000.
Combining the MSB(1) and the smallest value(000000000) gives
=> 1000000000
Note: This (1000000000) is the 2's complement representation of the largest negative integer. To convert it to decimal,
(a) first we flip all its bits and add 1 to the result as follows:
=> 0111111111 + 1
=> 1000000000
(b) then do the conversion to decimal as follows:
1000000000 = 1 x [tex]2^{9}[/tex] + 0 x [tex]2^{8}[/tex] + 0 x [tex]2^{7}[/tex] + 0 x [tex]2^{6}[/tex] + 0 x [tex]2^{5}[/tex] + 0 x [tex]2^{4}[/tex] + 0 x [tex]2^{3}[/tex] + 0 x [tex]2^{2}[/tex] + 0 x [tex]2^{1}[/tex] + + 0 x [tex]2^{0}[/tex] = 512
Therefore, 1000000000 is -512 in decimal and it is the largest negative integer representable.
Hope this helps!