Prévia do material em texto
Step 1 of 3 2.026E In two's complement number representation Most Significant Bit (MSB) is sign bit. Hence the MSB represent the sign of the bit and its positional value is Consider an n-bit two's complement number X by standard formula, (1) Remove the leftmost consecutive d bits, which are same as sign bits of Y, from the n-bit representation then the representation has m bits. (2) Here, m=n-d and bits have same value and equal to signed bit value of Y. So, (3) Step 2 of 3 Step 1: Subtract the equation (2) from the equation (1). Step 3 of 3 Continue simplifying the last expression in step1 using the relationship from equation (3), by adding right most two adjacent terms up to n-m terms to get the following expression: Simplify the equation further by substituting from equation (3). X-Y=0 (4) Hence, from the equation (3) and (4), showed that the m-bit two complement number Y obtained by discarding the d leftmost bits of X represents the same number as X if and only if the discarded bits all equal to the sign bit of Y. Hence the representations using m-bits and n-bits are equal, where n>m if and only if the discarded leftmost bits are equal to sign bits. Otherwise equation (3) is not satisfied. Therefore it cannot possible to simplify the equation Hence it cannot say value of X is equal to Y. Hence, two's complement number converted to a representation with fewer bits by removing high-order bits if and only if the discarded bits all equal to the sign bit.