English

Instruction sequences expressing multiplication algorithms

Programming Languages 2018-09-28 v4

Abstract

For each function on bit strings, its restriction to bit strings of any given length can be computed by a finite instruction sequence that contains only instructions to set and get the content of Boolean registers, forward jump instructions, and a termination instruction. We describe instruction sequences of this kind that compute the function on bit strings that models multiplication on natural numbers less than 2N2^N with respect to their binary representation by bit strings of length NN, for a fixed but arbitrary N>0N > 0, according to the long multiplication algorithm and the Karatsuba multiplication algorithm. We find among other things that the instruction sequence expressing the former algorithm is longer than the one expressing the latter algorithm only if the length of the bit strings involved is greater than 282^8. We also go into the use of an instruction sequence with backward jump instructions for expressing the long multiplication algorithm. This leads to an instruction sequence that it is shorter than the other two if the length of the bit strings involved is greater than 22.

Keywords

Cite

@article{arxiv.1312.1529,
  title  = {Instruction sequences expressing multiplication algorithms},
  author = {J. A. Bergstra and C. A. Middelburg},
  journal= {arXiv preprint arXiv:1312.1529},
  year   = {2018}
}

Comments

14 pages, the preliminaries of this paper and arXiv:1308.0219 are the same; 16 pages, results sharpened and presentation improved; 22 pages, combined with arXiv:1312.1812; 22 pages, typos corrected and explanation added

R2 v1 2026-06-22T02:21:33.666Z