130k views
1 vote
What happens with a signed value whose high order bit is 1 that is >>?

1 Answer

1 vote

Final answer:

When a signed value whose high order bit is 1 is right shifted (>>), the sign bit is propagated to the vacant bits on the left. This is known as sign extension.

Step-by-step explanation:

When a signed value whose high order bit is 1 is right shifted (>>), the sign bit is propagated to the vacant bits on the left. This is known as sign extension.

For example, if we have a signed value of -8 represented in 8 bits as 11111000, and we right shift it by 2 bits, the result will be 11111110.

In this case, the high order bit remains 1 after shifting, indicating that the value is still negative.

User I Am L
by
8.8k points

No related questions found