Exam-style question
Try this first
What is a key difference between a right logical shift and a right arithmetic shift?.
- A.Logical shifts always fill with ones, arithmetic shifts always fill with zeros.
- B.Arithmetic shifts are only for multiplication, logical shifts for division.
- C.Logical shifts always fill vacated bits with zeros; arithmetic shifts preserve the sign bit by replicating it during right shifts.
- D.Logical shifts only operate on positive numbers, arithmetic shifts on negative numbers.
Answer and explanation
Concise answer
Logical shifts always fill vacated bits with zeros; arithmetic shifts preserve the sign bit by replicating it during right shifts.
Why this is correct
The primary distinction is how vacated bits are filled during a right shift; logical uses zeros, arithmetic replicates the sign bit.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
