An improved parallel algorithm for integer GCD Authors Benny Chor Laboratory for Computer Science Massachusetts Institute of Technology Oded Goldreich Laboratory for Computer Science Massachusetts Institute of Technology Article

Received: 15 January 1986 Revised: 15 December 1987 DOI :
10.1007/BF01840374

Cite this article as: Chor, B. & Goldreich, O. Algorithmica (1990) 5: 1. doi:10.1007/BF01840374
Abstract We present a simple parallel algorithm for computing the greatest common divisor (gcd) of twon -bit integers in the Common version of the CRCW model of computation. The run-time of the algorithm in terms of bit operations isO (n /logn ), usingn ^{1+ɛ} processors, where ɛ is any positive constant. This improves on the algorithm of Kannan, Miller, and Rudolph, the only sublinear algorithm known previously, both in run time and in number of processors; they requireO (n log logn /logn ),n ^{2} log^{2} n , respectively, in the same CRCW model.

We give an alternative implementation of our algorithm in the CREW model. Its run-time isO (n log logn /logn ), usingn ^{1+ɛ} processors. Both implementations can be modified to yield the extended gcd, within the same complexity bounds.

Key words Greatest common divisor Parallel algorithms Supported in part by an IBM Graduate Fellowship and a Bantrell Postdoctoral Fellowship.

Supported in part by a Weizmann Postdoctoral Fellowship.

4 All logarithms are to base 2.

Communicated by F. Thomson Leighton.

References [1]

Brent, R. P., and H. T. Kung, Systolic VLSI arrays for linear time gcd computation, inVLSI 83, IFIP , F. Anceau and E. J. Aas (eds.), pp. 145–154, Elsevier, Amsterdam, 1983.

[2]

Chandra, A. K., S. Fortune, and R. Lipton, Unbounded fan-in circuits and associative functions,Proceedings of the Fifteenth Annual Symposium on Theory of Computing , ACM, pp. 52–60, 1983.

[3]

Cole, S. N., Real-time computation by

n -dimensional iterative arrays of finite-state machines,

IEEE Transactions on Computers , Vol. 18 (1969), pp. 349–365.

MATH CrossRef MathSciNet [4]

Goldschlager, L., A unified approach to models of synchronous parallel machines,

Journal of the Association for Computing Machinery , Vol. 29, No. 4 (1982), pp. 1073–1086.

MATH MathSciNet [5]

Kannan, R., G. Miller, and L. Rudolph, Sublinear parallel algorithm for computing the greatest common divisor of two integers,

SIAM Journal on Computing , Vol. 16, No. 1 (1987), pp. 7–16.

MATH CrossRef MathSciNet [6]

Knuth, D.,

The Art of Computer Programming , Vol. 2, second edition, Addison-Wesley, Reading, MA, 1981.

MATH [7]

Kucera, L., Parallel computation and conflicts in memory access,

Information Processing Letters , Vol. 14, No. 2 (1982), pp. 93–96.

MATH CrossRef MathSciNet [8]

Ofman, Y., On the algorithmic complexity of discrete functions,

Soviet Physics. Doklady , Vol. 7, No. 7 (1963), pp. 589–591.

MathSciNet [9]

Smith III, A. R., Cellular automata complexity trade-offs,

Information and Control , Vol. 18 (1971), pp. 466–482.

MATH CrossRef MathSciNet [10]

Vishkin, U., Implementation of simultaneous memory access in models that forbid it, Technical Report No. 210, Department of Computer Science, Technion, Haifa, 1981.

[11]

Wallace, C. S., A suggestion for a fast multiplier,IEEE Transactions on Electronic Computers , (1964), pp. 14–17.

© Springer-Verlag New York Inc. 1990