Question Detail

COS 102 test topic Objective Question

Question

Which binary logic operation is equivalent to multiplying an unsigned integer by 2, assuming no overflow?
Options
A Bitwise right shift by 1 bit
B Bitwise left shift by 1 bit
Correct Answer
C Bitwise XOR with 1
D Bitwise NOT inversion
Correct Answer

Option B is the correct answer.

Detailed Explanation

Left-shifting bits by one position shifts all positional weights up by a power of 2, effectively doubling the value.

Hint

No hint available

Question Info