0

Can bitwise left-shift (<<) and right-shift (>>) operators be implemented using only AND (&), OR (|), XOR (^), NOT (~)?

Geremia
  • 4,745
  • 37
  • 43
  • 5
    No. At minimum you need one operation where the result for one bit can influence what happens with a neighboring bit. – njuffa Dec 06 '18 at 17:21
  • @njuffa Now that I think about, yes, you're right; there'd be no way to influence neighboring bits. – Geremia Dec 06 '18 at 17:36

0 Answers0