185 views
4 4 votes

In an $n$-bit signed number system, zero has exactly $2$ different representations in which of the following representations?

  1. Sign-magnitude and $1$’s complement only
     
  2. $2$’s complement and excess-$2^{n-1}$ only
     
  3. Sign-magnitude and $2$’s complement only
     
  4. $1$’s complement and excess-$2^{n-1}$ only

1 Answer

0 0 votes

In sign-magnitude representation, the most significant bit (MSB) acts as the sign bit ($0$ for positive, $1$ for negative), and the remaining $n-1$ bits represent the magnitude.

Because zero has a magnitude of zero, the sign bit can be either positive or negative, resulting in two valid representations:

  • Positive Zero ($+0$): $000\dots0$

  • Negative Zero ($-0$): $100\dots0$

 

In $1$'s complement, positive numbers are represented in standard binary, and negative numbers are formed by flipping every bit (changing $0$s to $1$s and vice versa) of the corresponding positive number.

  • Positive Zero ($+0$): $000\dots0$

  • Inverting all the bits to get the negative equivalent gives us Negative Zero ($-0$): $111\dots1$

 

In $2$'s complement, negative numbers are formed by taking the $1$'s complement and adding $1$.

  • Positive Zero ($+0$): $000\dots0$

  • If we take the $1$'s complement of zero ($111\dots1$) and add $1$, it overflows the $n$-bit register. The carry bit is discarded, leaving us right back at $000\dots0$. Therefore, $2$'s complement has only one unique representation for zero.

 

In an excess-$K$ (or biased) representation, a fixed value $K$ (in this case, $K = 2^{n-1}$) is added to the actual number to get the stored integer.

  • To represent $0$, the system stores the binary equivalent of $0 + 2^{n-1}$.

  • Because every number maps to exactly one unique binary sequence through this simple addition, there is only one representation for zero.

Answer:
Position:
Show:

Related questions

8 8 votes
2 2 answers
240
240 views
GO Classes asked Jun 2
240 views
Let $X$ be the number of distinct $12$-bit integers representable in $2$’s complement form. Let $Y$ be the number of distinct $12$-bit integers representable in $1$’s com...
4 4 votes
2 2 answers
221
221 views
2 2 votes
2 2 answers
222
222 views
GO Classes asked Jun 2
222 views
The smallest integer that can be represented using a $12$-bit number in $2$’s complement form is
4 4 votes
3 3 answers
243
243 views
GO Classes asked Jun 2
243 views
Given that $A$ and $B$ are two $8$-bit $2$’s complement numbers where $A=10000001$ and $B=11111110$, then the sum $A+B$ is:$01111111$ $10000011$ $01111101$ $11111111$