We present a complete analysis of the integer division of a single unsigned dividend word by a single unsigned divisor word based on double-word multiplication of the dividend by an inverse of the divisor. The well-known advantage of this method yields run-time efficiency, if the inverse of the divisor can be calculated at compile time, since multiplication is much faster than division in arithmetic units. Our analysis leads to the discovery of a limit to the straightforward application of this method in the form of a critical dividend, which fortunately associates with a minority of the possible divisors (20%) and defines only a small upper part of the available dividend space. We present two algorithms for ascertaining whether a critical dividend exists and, if so, its value along with a circumvention of this limit. For completeness, we include an algorithm for integer division of a unsigned double-word dividend by an unsigned single-word divisor in which the quotient is not limited to a single word and the remainder is an intrinsic part of the result.

Efficient Algorithms for Integer Division by Constants Using Multiplication.

CAVAGNINO, Davide;WERBROUCK, Albert Eugene
2008-01-01

Abstract

We present a complete analysis of the integer division of a single unsigned dividend word by a single unsigned divisor word based on double-word multiplication of the dividend by an inverse of the divisor. The well-known advantage of this method yields run-time efficiency, if the inverse of the divisor can be calculated at compile time, since multiplication is much faster than division in arithmetic units. Our analysis leads to the discovery of a limit to the straightforward application of this method in the form of a critical dividend, which fortunately associates with a minority of the possible divisors (20%) and defines only a small upper part of the available dividend space. We present two algorithms for ascertaining whether a critical dividend exists and, if so, its value along with a circumvention of this limit. For completeness, we include an algorithm for integer division of a unsigned double-word dividend by an unsigned single-word divisor in which the quotient is not limited to a single word and the remainder is an intrinsic part of the result.
2008
51(4)
470
480
D. CAVAGNINO; A. WERBROUCK
File in questo prodotto:
File Dimensione Formato  
CJ-DBM-1-470.pdf

Accesso riservato

Tipo di file: POSTPRINT (VERSIONE FINALE DELL’AUTORE)
Dimensione 173.14 kB
Formato Adobe PDF
173.14 kB Adobe PDF   Visualizza/Apri   Richiedi una copia

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/2318/104931
Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus 9
  • ???jsp.display-item.citation.isi??? 7
social impact