Integer Division

Prev: Multiplication

Next: Integer Division by Constants

Sections

  • 9-1 Preliminaries
  • 9-2 Multiword Division
  • 9-3 Unsigned Short Division from Signed Division
  • 9-4 Unsigned Long Division
  • 9-5 Doubleword Division from Long Division

Problems

  1. Show the real-number identity stated in exercise 1 of this chapter.

  2. Find branch-free code for computing the quotient and remainder of modulus division on a basic RISC that has division and remainder instructions for truncating division.

  3. Similarly, find branch-free code for computing the quotient and remainder of floor division on a basic RISC that has division and remainder instructions for truncating division.

  4. How would you compute for unsigned integers and , and ? Assume your machine has an unsigned divide instruction that computes .

  5. Theorem D3 states that for real and integer ,

    Show that, more generally, if a function is (a) continuous, (b) monotonically increasing, and (c) has the property that if is an integer then is an integer, then [GKP].