retagged by
11,032 views
19 votes
19 votes

In $16$-bit $2$’s complement representation, the decimal number $-28$ is:

  1. $1111 \: 1111 \: 0001 \: 1100$
  2. $0000 \: 0000 \: 1110 \: 0100$
  3. $1111 \: 1111 \: 1110 \: 0100$
  4. $1000 \: 0000 \: 1110 \: 0100$
retagged by

4 Answers

Best answer
35 votes
35 votes

$(+28)_{10} = (0000$ $0000$ $0001 1100)_2$
$-28$ is nothing but $2s$ complement of $+28$.

So, $2s$ complement of $(0000$ $0000$ $0001$ $1100)_2$ is $(1111$ $1111$ $1110$ $0100)_2$

$(-28)_{10} = (1111$ $1111$ $1110$ $0100)_2$. Answer is (C).

edited by
10 votes
10 votes

2's complement and 2's complement representation are different.

In 2's complement representation, positive no is represented as they are and neg no is represented in 2's complement form.

28 in binary = 11100, expanded to 16 bits = 0000 0000 0001 1100

1's complement of this binary no = 1111 1111 1110 0011

Add 1 to get 2's complement =       1111 1111 1110 0100

Ans should be option C.

https://www.cs.cornell.edu/~tomf/notes/cps104/twoscomp.html

9 votes
9 votes
Clearly option $C$.

Ignoring the sign bit extension option $C$ reduces to $100100$

Now calculate the weighted sum to convert it into decimal $= (-2^{5} + 2^{2}) = (-32 + 4) = -28$
edited by
1 votes
1 votes

(+28) = 0000 0000 00011100

(-28) is nothing its just 2’s of (+28)

(-28) = ( 1111 1111 11100100 )

 

OPTION C IS CORRECT

Answer:

Related questions

19 votes
19 votes
5 answers
1
Arjun asked Feb 7, 2019
13,449 views
Consider $Z=X-Y$ where $X, Y$ and Z are all in sign-magnitude form. X and Y are each represented in $n$ bits. To avoid overflow, the representation of $Z$ would require a...
35 votes
35 votes
9 answers
2
21 votes
21 votes
4 answers
3
Arjun asked Feb 7, 2019
11,647 views
Which one of the following is NOT a valid identity?$(x \oplus y) \oplus z = x \oplus (y \oplus z)$$(x + y) \oplus z = x \oplus (y+z)$$x \oplus y = x+y, \text{ if } xy=0$$...