A logical left shift moves every bit in a binary number to the left by a chosen number of positions. The empty positions on the right are filled with 0s. This operation is common in computer science because shifting left by 1 position is often the same as multiplying by 2 in binary, as long as the number stays within the allowed bit size.
Count the shift amount carefully. For a one-position shift, compare the result to the original number multiplied by 2 in binary form. If the exercise uses a fixed number of bits, make sure no extra leftmost bits are kept.
Do not copy the leftmost bits into the new positions. That would be a different type of shift. In a logical left shift, only 0s are inserted on the right.
© 2023-2026 AI MATH COACH