Integer Division
Prev: Multiplication
Next: Integer Division by Constants
Sections
9-1Preliminaries9-2Multiword Division9-3Unsigned Short Division from Signed Division9-4Unsigned Long Division9-5Doubleword Division from Long Division
Problems
-
Show the real-number identity stated in exercise 1 of this chapter.
-
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.
-
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.
-
How would you compute for unsigned integers and , and ? Assume your machine has an unsigned divide instruction that computes .
-
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].