10-9. Unsigned Division by Divisors ≥ 1

Given a word size W ≥ 1 and a divisor d, 1 ≤ d < 2W, we wish to find the least integer m and integer p such that

Equation 22

with 0 ≤ m < 2W + 1 and pW.

In the unsigned case, the magic number M is given by

Because (22) must hold for

Equation 23

As in the signed case, let nc be the largest value of ...

Get Hacker's Delight now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.