A Loopless Gray Code for Minimal Signed-Binary Representations

  • Gurmeet Singh Manku
  • Joe Sawada
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3669)


A string ... a 2 a 1 a 0 over the alphabet {–1,0,1} is said to be a minimal signed-binary representation of an integer n if n = ∑ k ≥ 0 a k 2 k and the number of non-zero digits is minimal. We present a loopless (and hence a Gray code) algorithm for generating all minimal signed binary representations of a given integer n.


Gray Code Addition Chain Adjacent Digit Code Generation Algorithm Fast Exponentiation 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Arno, S., Wheeler, F.S.: Signed digit representations of minimal hamming weight. IEEE Transactions on Computers 42(8), 1007–1010 (1993)CrossRefGoogle Scholar
  2. 2.
    Avizienis, A.A.: Signed-digit number representations for fast parallel arithmetic. IRE Transactions on Electronic Computers 10, 389–400 (1961)CrossRefMathSciNetGoogle Scholar
  3. 3.
    Bitner, J.R., Ehrlich, G., Reingold, E.M.: Efficient generation of the binary reflected Gray code and its applications. Communications of the ACM 19(9), 517–521 (1976)zbMATHCrossRefMathSciNetGoogle Scholar
  4. 4.
    Bos, J., Coster, M.: Addition chain heuristics. In: Brassard, G. (ed.) CRYPTO 1989. LNCS, vol. 435, pp. 400–407. Springer, Heidelberg (1990)Google Scholar
  5. 5.
    Brickell, E.F., Gordon, D.M., McCurley, K.S., Wilson, D.B.: Fast exponentiation with precomputation. In: Rueppel, R.A. (ed.) EUROCRYPT 1992. LNCS, vol. 658, pp. 200–207. Springer, Heidelberg (1993)CrossRefGoogle Scholar
  6. 6.
    Chang, S.H., Tsao-Wu, N.: Distance and structure of cyclic arithmetic codes. In: Proc. Hawaii International Conference on System Sciences, vol. 1, pp. 463–466 (1968)Google Scholar
  7. 7.
    Clark, W.E., Liang, J.J.: On arithmetic weight for a general radix representation of integers. IEEE Transactions on Information Theory 19, 823–826 (1973)zbMATHCrossRefMathSciNetGoogle Scholar
  8. 8.
    Ganesan, P., Manku, G.S.: Optimal routing in Chord. In: Proc. 15th ACM-SIAM Symposium on Discrete Algorithms (SODA 2004), January 2004, pp. 169–178 (2004)Google Scholar
  9. 9.
    Gordon, D.M.: A survey of fast exponentiation methods. J of Algorithms 27(1), 129–146 (1998)zbMATHCrossRefGoogle Scholar
  10. 10.
    Gray, F.: Pulse code communications. U S Patent 2,632,058, March 17 (1953)Google Scholar
  11. 11.
    Hwang, K.: Computer Arithmetic: Principles, Architecture and Design. John Wiley and Sons, Inc., Chichester (1979)Google Scholar
  12. 12.
    Jedwab, J., Mitchell, C.J.: Minimum weight modified signed-digit representations and fast exponentiation. Electronic Letters 25(17), 1171–1172 (1989)zbMATHCrossRefGoogle Scholar
  13. 13.
    Knuth, D.E.: Seminumerical Algorithms. In: The Art of Computer Programming, 3rd edn., vol. 2. Addison-Wesley, Reading (1997)Google Scholar
  14. 14.
    Koç, Ç.K.: High-speed RSA implementation. RSA Labs (November 1994)Google Scholar
  15. 15.
    Morain, F., Olivos, J.: Speeding up the computations on an elliptic curve using addition-subtraction chains. RAIRO Informatique Théoretique et Applications 24(6) (1990)Google Scholar
  16. 16.
    Parhami, B.: Generalized signed-digit number systems: A unifying framework for redundant number representations. IEEE Transactions on Computers 39, 89–98 (1990)CrossRefGoogle Scholar
  17. 17.
    Phillips, B., Burgess, N.: Minimal weight digit set conversions. IEEE Transactions on Computers 53(6), 666–677 (2004)CrossRefGoogle Scholar
  18. 18.
    Prodinger, H.: On binary representations of integers with digits − 1, 0, 1. INTEGER: The Electronic Journal of Combinatorial Number Theory (2000)Google Scholar
  19. 19.
    Reitwiesner, G.W.: Binary arithmetic. Advances in Computers 1, 231–308 (1960)MathSciNetCrossRefGoogle Scholar
  20. 20.
    Savage, C.: A survey of combinatorial Gray codes. SIAM Review 39(4), 609–625 (1997)CrossRefMathSciNetGoogle Scholar
  21. 21.
    Sawada, J.: A Gray code for binary subtraction. In: 2nd Brazilian Symposium on Graphs, Algorithms and Combinatorics, GRACO 2005 (2005)Google Scholar
  22. 22.
    Schönhage: A lower bound for the length of addition chains. Theoretical Computer Science 1, 1–12 (1975)zbMATHCrossRefMathSciNetGoogle Scholar
  23. 23.
    Stoica, I., Morris, R., Liben-Lowell, D., Karger, D.R., Frans Kaashoek, M., Dabek, F., Balakrishnan, H.: Chord: A scalable peer-to-peer lookup protocol for Internet applications. IEEE/ACM Transactions on Networking 11(1), 17–32 (2003)CrossRefGoogle Scholar
  24. 24.
    Weitzman, A.: Transformation of parallel programs guided by micro-analysis. In: Salvy, B. (ed.), Algorithms Seminar, pp. 155–159 (1992-1993); Institut National de Recherche en Informatique et en Automatique, France, Rapport de Recherche, No. 2130 (Summarized by Paul Zimmermann) (1993)Google Scholar
  25. 25.
    Wu, H., Hasan, M.A.: Efficient exponentiation of a primitive root in GF(2m). IEEE Transactions on Computers 46(2), 162–172 (1997)CrossRefMathSciNetGoogle Scholar
  26. 26.
    Wu, H., Anwar Hasan, M.: Closed-form expression for the average weight of signed-digit representations. IEEE Transactions on Computers 48(8), 848–851 (1999)CrossRefGoogle Scholar
  27. 27.
    Yacobi, Y.: Exponentiating faster with addition chains. In: Damgård, I.B. (ed.) EUROCRYPT 1990. LNCS, vol. 473, pp. 222–229. Springer, Heidelberg (1991)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2005

Authors and Affiliations

  • Gurmeet Singh Manku
    • 1
  • Joe Sawada
    • 2
  1. 1.Google Inc.USA
  2. 2.University of GuelphCanada

Personalised recommendations