retagged by
766 views
5 votes
5 votes

Which of the following statements is/are true?

  1. Floating point addition is always associative.
  2. Shifting a twos-complement integer right by one bit, and filling from the left with $0$, is always equivalent to dividing by $2$.
  3. An integer’s ones-complement representation is never identical to its twos-complement representation.
  1. I and II only
  2. II and III only
  3. All are false
  4. I, II, and III all are true
retagged by

3 Answers

Best answer
6 votes
6 votes
Floating point addition is NOT always associative. i.e. Round off error may occurs

Shifting a twos-complement integer right by one bit, and filling from the left with 0, is always equivalent to dividing by 2.
No this one is property of unsigned number not 2s complement.
Counter : let a no 1010
2s complement of 1010 is 0110 i.e. -6
Right shift 1 bit and filling 0 at LSB 0100 which is 4.

For positive integers(including zero), the one’s and two’s complement representations are the same.
edited by
7 votes
7 votes

Statement I :

Floating point addition is always associative.

I is false because of round off error.

Statement II : Shifting a twos-complement integer right by one bit, and filling from the left with 0, is always equivalent to dividing by 2.

II is false because negative numbers have a leading 1 bit in two’s complement, so the left  should be filled with a 1 if the number is negative and a 0 if it is positive.

Statement III  An integer’s ones-complement representation is never identical to its twos-complement representation

To compute the one’s complement representation of a negative number, write the number as a positive number but then flip the bits. Transforming this to two’s complement then requires adding 1.

In general, this means that the one’s and two’s complement representations of a negative number differ.

However, for positive integers, the one’s and two’s complement representations are the same, so III is also false.

Hence all three statements are false , option C is correct .

Answer:

Related questions

3 votes
3 votes
2 answers
2