Binary arithmetic

EasyMedium
1234567891011121314151617
Question 10
Medium

An 8-bit register contains the binary pattern 11010100211010100_2110101002​, which represents a signed integer in two's complement format.

If the register's contents are shifted two places to the right, which of the following statements correctly describes the difference between performing an arithmetic shift right versus a logical shift right?

Comparison of Arithmetic and Logical Shift Right

An arithmetic shift right yields −11-11−11, performing integer division by 444, whereas a logical shift right yields +53+53+53 because it inserts 000s on the left, failing to preserve the sign.

An arithmetic shift right yields −11-11−11, whereas a logical shift right yields −53-53−53 because the sign bit is inverted to indicate a logical operation on a negative integer.

An arithmetic shift right yields −22-22−22 because the hardware limits the shift to one position to avoid shifting out the sign bit, whereas a logical shift right successfully yields +53+53+53.

Both shifts yield −11-11−11 because the processor automatically overrides logical shift instructions to preserve the MSB whenever a negative signed number is detected.

Binary arithmetic Questions

  1. GCSE
  2. /Computer Science
  3. /Binary arithmetic