Counting Bits

Prev: Arithmetic Bounds

Next: Searching Words

Sections

  • 5-1 Counting 1-Bits
  • 5-2 Parity
  • 5-3 Counting Leading 0’s
  • 5-4 Counting Trailing 0’s

Problems

  1. Code Dube’s algorithm for the ntz function, expanding the multiplication.

  2. Code the right-justify function used in the snoob function on page 15, for , in three basic RISC instructions.

  3. Are the parallel prefix and suffix operations, with XOR, invertible? If so, how would you compute the inverse functions?