Which one of the following micro-operations in ALU causes overflow sometimes?

2022

Which one of the following micro-operations in ALU causes overflow sometimes?

  1. A.

    Logical shift left

  2. B.

    Arithmetic shift left

  3. C.

    Circular shift right

  4. D.

    None of the above

Attempted by 235 students.

Show answer & explanation

Correct answer: B

Answer: Arithmetic shift left causes overflow sometimes. Reason (English): Arithmetic shift left multiplies a value by 2. For fixed-width signed representations, shifting left can move the sign bit out of range or otherwise exceed the representable range, producing arithmetic overflow.

Example: In 4-bit two's complement, 0100 (+4) shifted left by one becomes 1000 (which represents −8). This change of sign and incorrect numeric result indicates overflow.

Why other shifts do not cause arithmetic overflow:

Circular (rotate) shifts preserve all bits by rotating them, so no bits are lost and this does not produce arithmetic overflow.

Logical shift left also shifts in zeros and can discard the most significant bit; however, in the ALU context the term "overflow" typically refers to arithmetic overflow for signed values, and the operation that corresponds to multiplying by two (arithmetic shift left) is the standard cause of such overflow.

Explore the full course: Niacl Ao It Specialist