Computer Science › Section C · Data manipulation › Topic C.4

Arithmetic, logic, shift, and rotate instructions

The ALU does more than add. With a handful of logic, shift and rotate operations a program can test a single bit, switch it on or off, multiply by powers of two, and pack several small values into one byte.

In this topic

  • Three families of ALU instructions
  • Logic operations work column by column
  • Masks: clearing, setting and flipping bits
  • Bit maps and letter case
  • Worked example: a bit map of lights
  • Rotating and shifting
  • Worked example: one byte, three operations
  • Arithmetic: one name, several operations
  • Worked example: multiplying by ten
  • Common mistakes to avoid
  • Key takeaways

This topic is part of Wuanberri Pro. Checking your access…

← Previous topicNext topic →