Given a (very) tiny computer that has a word size of 3 bits, what are the lowest value (negative number) and the highest value (positive number) that this computer can represent in each of the following representations?
i) One's complement
ii) Two's complement
iii) Signed Magnitude
Answers
Answer:
Explanation:
Signed Magnitude
By using two bits, you can represent exactly 2² unique values, which are namely 00, 01, 10, 11.
In sign-magnitude representation, the largest +ve value is +3 and the largest -ve value is -3. The possible values with this represented are: -3, -2, -1, -0, +0, +1, +2, +3. The corresponding bits are 100, 101, 110, 111, 000, 001, 010, 011 respectively. In this if we will notice there is different value for + 0 and - 0.
Two’s Complement Representation
In this representation, we don’t have a dedicated sign bit like in Signed Magnitude, but instead it will represent negative values by first inverting all the bits of the positive value and then adding 1. Hence the decimal values are as follows : -4, -3, -2, -1, 0, +1, +2, +3. The 2’s-complement binary representations of these values are: 100, 101, 110, 111, 000, 001, 010, 011 respectively.
Answer:
If your computer has 3 bits then the first bit will be your positive or negative indicator. For example, 1 is positive and 0 is negative. Then leaves 2 remaining bits for integer values. So your highest value is 111 = +(2+1) = 3. While your lowest value is 011 = - (2+1) = -3. In general, using sign-magnitude, the largest positive integer you can represent using N bits is 2N−1−1, and the largest negative integer you can represent in N bits is −(2N−1−1). And you’ll