Associative Digital Network Theory
Nico F. Benschop
Associative Digital Network Theory An Associative Algebra Approach to Logic, Arithmetic and State Machines
Dr. Nico F. Benschop Amspade Research Drossaardstraat 71 5663 GJ Geldrop Netherlands E-mail:
[email protected] ISBN 978-1-4020-9828-4
e-ISBN 978-1-4020-9829-1
DOI 10.1007/978-1-4020-9865-9 Library of Congress Control Number: 2008944293 © Springer Science + Business Media B.V. 2009 No part of this work may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, microfilming, recording or otherwise, without written permission from the Publisher, with the exception of any material supplied specifically for the purpose of being entered and executed on a computer system, for exclusive use by the purchaser of the work. Cover design: eStudioCalamar Figueres | Berlin Printed on acid-free paper 9 8 7 6 5 4 3 2 1 springer.com
———————————————————————————– To my parents, for caring and persisting through hard times. And to my wife, for her patience and understanding. ————————————o0O0o———————————— Old Dutch saying: — “Wie het kleine niet eert, is het grote niet weerd.” — (Who does not honor the small, does not deserve the large) Math = The Art of separating Necessity from Coincidence. Life = Making the best of Necessity, using Coincidence. “It just happened that no-one else was familiar with both fields at the same time.” (Claude Shannon on inter-disciplinary work, 1948) “It always worked out that when I understood something, it turned out to be simple. Take the connection between the quantum stuff and electrodynamics in my book. It took me thirty years to figure out, and in the end it was almost trivial. It’s so simple that any freshman could read and understand it. But it was hard for me to get there, with all this historical junk in the way.” (Carver Mead: interview American Spectator v34 n7 p68 Sep.2001)
“Mathematicians opened the gate to an extensive domain, but they did not enter this domain themselves. By their nature they are more interested in the way the gate is opened, than in the garden behind it.” (Maurits Escher in “Regular Division of the Plane”, 1958) — If the Whole is more than the sum of its parts, — — then the coupling of parts is the difference. — H
/ < + ^ * > Quint Essence C \
Logic aa = a \ U Arithmetic ab = ba / L R Memory a(bc)=(ab)c=abc
Preface This book is intended for researchers at industrial laboratories, teachers and students at technical universities, in electrical engineering, computer science and applied mathematics departments, interested in new developments of modeling and designing digital networks (DN: state machines, sequential and combinational logic) in general, as a combined math/engineering discipline. As background an undergraduate level of modern applied algebra1 will suffice. Essential concepts and their engineering interpretation are introduced in a practical fashion with examples. The motivation in essence is: the importance of the unifying associative algebra of function composition (viz. semigroup theory) for the practical characterization of the three main functions in computers, namely sequential logic (state-machines), arithmetic and combinational (Boolean) logic. Known principles of discrete mathematics, especially finite semigroups, residue arithmetic and boolean logic (lattices) are interpreted in terms of practical DN design issues. The main three levels of state machine synthesis form a natural ‘top down’ hierarchy of associative algebras: Application sequential logic arithmetic combinat’l logic
Algebra type associative commutative idempotent
Syntax (ab)c = a(bc) ab = ba aa = a
Objects functions numbers sets
Operations sequencing (+) (.) ∪ ∩
Historically, non-commutative and idempotent algebras diverged from arithmetic in the nineteenth century. Our aim is to emphasize again their arithmetic nature, for practical engineering purposes such as efficient synthesis of binary logic and state machines. The ‘static’ (combinational, idempotent x 2 ≡ x) and ‘iterative’ (commutative, x i+1 = x i x = xx i ) aspects can be modeled by finite residue arithmetic. Apart from the two non-commutative components of memory type (branch- and resetmachines, shown to be each others dual), non-commutative aspects of sequential behavior can be represented by coupling functions between components. • In the first of three parts, on state machines (Chaps. 1–4), an introductory chapter recalls basic principles in theory and practice. The five basic components of sequential behavior (with indecomposable semigroup) are derived, with ways to couple them efficiently—only required in the non-commutative case. They define the five basic types of state machines for network composition. • In the second part, on combinational (Boolean) logic (Chaps. 5, 6) the concept of spectrum as a characteristic sequence of numbers, is borrowed from Fourier analysis for order-independent (symmetric) synthesis of Boolean functions (BFs). A useful arithmetic compositional rule holds: the spectrum of a product of functions (of disjoint inputs) is the product of the component spectra. In fact Boole (1854) introduced his algebra—a calculus of binary properties—as an idempotent form of 1 Birkhoff-Bartee
1970—Modern Applied Algebra Hartmanis-Stearns 1970—Algebraic Structure of Sequential Machines. vii
viii
Preface
arithmetic. This allows convolution-like composition rules (as in linear filters), to be developed. Symmetric BFs are implemented as a crossing-free and compact orthogonal grid network of MOS transistors in the silicon plane, to obtain a regularly structured VLSI implementation. Simply removing transistors from such grid yields planar BFs with the desired crossing-free property, covering a majority of Boolean functions. Using this representation, the complexity of BFs grows polynomial, and not exponential, with the number of inputs. It appears that by permuting and/or inverting the n inputs, each BF n of at most four inputs is planar. A fast O(n2 ) algorithm for symmetric logic synthesis is developed, and applied to optimize fault-tolerant logic using Hamming- or product-codes for error correction, with synthesized gate count as cost criterium. • The third and last part, on arithmetic (Chaps. 7–11), analyses residue arithmetic with two extremal types of prime related moduli: p k and mk = p1 p2 · · · pk typical for ‘sequential’ resp. ‘parallel’ arithmetic. By expanding r mod m residues with a ‘carry’ c as multiple of modulus m: n = cm + r, integer arithmetic obtains a dual focus on closure- and generative properties of residues and carry, as independent resp. dependent network components. This balanced approach to arithmetic provides new insights into old and well known problems in finite additive number theory (Fermat, Goldbach, Waring: Chaps. 8, 9, 10) with practical engineering results. For instance each odd residue mod 2k is a unique signed power of 3, allowing efficient log-arithmetic over bases 2 and 3 [patent US-5923888]. Moreover, a binary log-arithmetic microprocessor (32 bits, in 0.18 μ CMOS technology) is described, designed as part of a European Esprit project,2 comparing favorably with the known floating point arithmetic devices. Nico F. Benschop
♠ Amspade Research, Geldrop, The Netherlands, Oct. 2008.
Acknowledgements The author is grateful to Philips Research (Eindhoven, NL) for allowing to publish this material, developed during his 32 years there. Also gratefully acknowledged are the contributions, to Chaps. 6 and 11, of colleagues Richard Kleihorst, René van der Vleuten (Philips Research), G. Muurling, prof. J. Simonis (TU Delft), and of Esprit project co-workers Chris Softley, dr. Nick Coleman (Univ. Newcastle UK) and Rudolf Matousek, prof. Jiri Kadlec (UTIA, Prague).
2 Esprit
33544 HSLA, 1999–2002, main contractor Univ. Newcastle (dpt. ECE) UK.
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii Part 1 Secuential Logic: Finite Associative . . . . . . . . . . . . . . . . .
3
1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 Sequential and Combinational Logic . . . . . . . . . . . . 1.2 Five Basic State Machines, as Network Components . . . . 1.3 Subset/Partition, Local/Global, Additive/Mult’ve . . . . . . 1.3.1 Associative Closure: Semigroup and Sub-Semigroup 1.3.2 Preserved Partition: Congruence and Image . . . . . 1.4 Integer Arithmetic: Residues with Carry . . . . . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
3 3 5 8 9 10 11
2
Simple Semigroups and the Five Basic Machines . . . . . . . 2.1 State Machine: Sequential Closure and Rank . . . . . . . . 2.2 Basic Machines and Simple Semigroups . . . . . . . . . . 2.2.1 Iterations: Monotone, Periodic, Idempotent . . . . . 2.2.2 Ordered Idempotents H for Combinational Logic . 2.2.3 The Five Minimal Semigroups and Basic Machines 2.3 Equivalent Idempotents: Memory Components L, R . . . . 2.4 Maximal Subgroups: Periodic G . . . . . . . . . . . . . . 2.5 Constant Rank Machines, and Simple Semigroups . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
15 15 16 17 18 19 20 24 25 28
3
Coupling State Machines . . . . . . . . . . . . . . . . . . . . . . . 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 No Coupling: Semigroup Z(.) mod m, Composite m . . . . . . 3.3 Machine Decomposition: Right Congruence Suffices . . . . . . 3.4 Cascade Composition: Full Groups FG3 and FG4 . . . . . . . 3.5 Decomposing the Full- and Alternating Group over Four States 3.6 Decomposing Simple Groups AGn ⊂ FGn for n > 4 . . . . . . 3.7 Loop Composition Superfluous . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . .
. . . . . . . . .
29 29 30 34 36 41 44 48 49 ix
x
4
Contents
General Network Decomposition of State Machines . . . . . . . . . 4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Implementing M = (Q, A) by Its Alphabet A . . . . . . . . . . 4.2.1 Decomposition by Local Input Closures . . . . . . . . . 4.3 Bottom-Up Rank Driven Decomposition of S = A∗ /Q . . . . . 4.4 Partial Direct Products, Unused Codes, Efficiency . . . . . . . . 4.5 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.1 Top-Down Decomposition by Local Input Closures . . . 4.5.2 Global Decomposition by Maximal Iterative Components 4.6 Invariants: Ordered Commuting Idempotents . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . .
51 51 52 52 53 53 54 62 63 65 67
Part 2 Combinational Logic: Commuting Idempotents . . . . . . . . . .
69
5
Symmetric and Planar Boolean Logic Synthesis . . . 5.1 Introduction . . . . . . . . . . . . . . . . . . . . 5.2 Logic Synthesis Independent of Input Ordering . . 5.2.1 Orthogrid Plot and Rank Spectrum . . . . 5.2.2 Factoring Paths by a Planar Node . . . . . 5.3 Symmetric and Threshold BF’s . . . . . . . . . . 5.3.1 Symmetric Functions ‘Count’ . . . . . . . 5.3.2 T -Cell Library, Threshold Logic Cells . . 5.4 Planar Cut and Factoring . . . . . . . . . . . . . 5.5 Fast Symmetric Synthesis: Quadratic in nr. Inputs 5.6 Experiments and Conclusion . . . . . . . . . . . 5.7 Planar Boolean Logic Synthesis . . . . . . . . . . 5.7.1 All BF n Are Planar upto n = 4 Inputs . . . References . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
69 69 70 70 71 72 73 74 74 75 75 76 77 82
6
Fault Tolerant Logic with Error Correcting Codes . 6.1 Introduction . . . . . . . . . . . . . . . . . . . . 6.2 Fault Tolerant IC Design Environment . . . . . . 6.2.1 Implementation at Register Transfer Level 6.2.2 Protecting Registers and Connections . . . 6.3 Three Error Correction Methods for Logic Circuits 6.3.1 Majority Voting . . . . . . . . . . . . . . 6.3.2 Hamming Codes (Block Codes) . . . . . . 6.3.3 Product Codes (Array Codes) . . . . . . . 6.4 Demonstration of Experimental Circuit . . . . . . 6.5 Results for Typical Designs . . . . . . . . . . . . 6.6 Conclusions . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
83 83 84 85 86 86 87 87 87 88 93 95 96
Contents
xi
Part 3 Finite Arithmetic: Associative, Commutative . . . . . . . . . . . . 7
Fermat’s Small Theorem Extended to r p−1 mod p 3 . . . . 7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 7.1.1 Divisors r|p ± 1 and Residues (p ± 1)p mod p 3 7.2 Lattice Structure of Semigroup Z(.) mod q . . . . . . . 7.2.1 Distinct ep−1 mod p 3 for Idempotents e ∈ Zp−1 7.3 Distinct r p−1 mod p 3 for Divisors r|p ± 1 . . . . . . . 7.3.1 Idempotents of Zp+1 (.) and Divisors of p + 1 . References . . . . . . . . . . . . . . . . . . . . . . . .
8
Additive Structure of Units Group mod p k , with Carry Extension for a Proof of Fermat’s Last Theorem . . . . . . . . . . . . . . . . 8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2 Structure of the Group Gk of Units . . . . . . . . . . . . . . . . 8.3 Cubic Root Solution in Core, and Core Symmetries . . . . . . . 8.3.1 Another Derivation of the Cubic Roots of 1 mod p k . . . 8.3.2 Core Increment Symmetry mod p 2k+1 , Asymmetry mod p 3k+1 . . . . . . . . . . . . . . . . . . . . . . . . . 8.4 Symmetries as Functions Yield ‘Triplets’ . . . . . . . . . . . . . 8.4.1 A Triplet for Each Unit n in Gk . . . . . . . . . . . . . . 8.4.2 The EDS Argument Extended to Non-Core Triplets . . . 8.5 Relation to Fermat’s Small and Last Theorem . . . . . . . . . . 8.5.1 Proof of the FLT Inequality . . . . . . . . . . . . . . . . 8.6 Conclusions and Remarks . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
Additive Structure of Z(.) mod mk (Squarefree) and Goldbach’s Conjecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2 Lattice of Groups . . . . . . . . . . . . . . . . . . . . . . . . 9.2.1 Ordering of Commuting Idempotents . . . . . . . . . . 9.2.2 Lattice of Idempotents: Add vs Join . . . . . . . . . . . 9.3 Primes, Composites and Neighbors . . . . . . . . . . . . . . . 9.3.1 Each Idempotent’s Successor is in G1 or G2 . . . . . . 9.4 Euclidean Prime Sieve . . . . . . . . . . . . . . . . . . . . . . 9.4.1 Pair Sums of Carry Extended Units . . . . . . . . . . . 9.4.2 Induction Base: Pair Sums of Primes in G(3) . . . . . . 9.4.3 Excluding Composites in G(k), Baseprimes and 1 as Summands . . . . . . . . . . . . . . . . . . . . . . . . 9.5 Proving GC via GR(k) by Induction on k . . . . . . . . . . . . 9.6 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . p 10 Powersums x Represent Residues mod p k , from Fermat to Waring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . .
97
. . . . . . . .
97 97 99 99 101 103 104 105
. . . . .
107 107 109 111 111
. . . . . . . .
113 115 117 118 119 120 121 122
. . . . . . . . . .
. . . . . . . . . .
123 123 124 125 125 126 127 128 129 130
. . . .
. . . .
132 133 134 135
9
. . 137 . . 137
xii
Contents
10.2 Core Increments as Coset Generators . . . . . . . 10.3 Core Extensions: Ak to Fk , and Pairsums mod p k 10.4 Conclusions . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
138 140 144 145
11 Log-Arithmetic, with Single and Dual Base . . . . . . . . . . . . . . 11.1 Log-Arithmetic with Dual Base 2 and 3 . . . . . . . . . . . . . . . 11.1.1 Proposed New Binary Number Code . . . . . . . . . . . 11.1.2 Example . . . . . . . . . . . . . . . . . . . . . . . . . . 11.1.3 Application to Multipliers . . . . . . . . . . . . . . . . 11.1.4 Signed Magnitude Binary Code over Bases 2 and 3 . . . 11.1.5 Addition in Log Code: ‘Odd’ Arithmetic (Base 2 and 3) . 11.2 European Logarithmic Microprocessor ELM . . . . . . . . . . . . 11.2.1 Introduction: Log-Arithmetic with Single Base 2 . . . . 11.2.2 Log-Arithmetic Algorithms, an Overview . . . . . . . . 11.2.3 Data Format, Range and Precision . . . . . . . . . . . . 11.2.4 Measurement of Accuracy . . . . . . . . . . . . . . . . 11.2.5 Conventional LNS Addition and Subtraction . . . . . . . 11.2.6 New Error Correction Algorithm . . . . . . . . . . . . . 11.2.7 Error Correction for Subtraction . . . . . . . . . . . . . 11.2.8 Adder/Subtractor Design and Evaluation . . . . . . . . . 11.2.9 Architecture and Performance . . . . . . . . . . . . . . 11.2.10 VLSI Implementation . . . . . . . . . . . . . . . . . . . 11.2.11 The ELM: Some More Architectural Details . . . . . . . 11.2.12 Accuracy Comparisons LNS vs. FLP . . . . . . . . . . . 11.2.13 The TMS-320C6711 . . . . . . . . . . . . . . . . . . . 11.2.14 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
147 147 148 149 149 150 151 152 153 155 156 157 158 160 163 163 165 166 167 168 170 171 172 172
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Part 1. Sequential Logic: Finite Associative Closure Chapters 1 to 4: In the 1840’s Arithmetic spawned combinational logic (Boole) as well as non-commutative algebras: quaternions, matrices (Hamilton, Grassmann). For computer engineering we aim to recover the (commutative) arithmetic: State Machine synthesis by factoring its sequential closure (semigroup), the five minimal semigroups, and five basic State Machine types, the ways of coupling State Machines, with typical examples in asymmetric time, for efficient sequential logic synthesis: a least coupled structured Network of Basic State Machines.
Part 2. Combinational Logic: Associative, Commuting Idempotents Chapters 5 and 6: Symmetric and Planar Boolean functions as components of binary logic network synthesis, using rank spectrum analysis and phase assignment. Hamming- and Product codes for fault-tolerant logic: fast O(n2 ) symmetric BFn synthesis program ‘Ortolog’ scans all possible error correction codes to minimize Silicon.
Part 3. Finite Arithmetic: Associative, Commutative
Chapters 7 to 11: Fermat’s Small Theorem: np ≡ n mod p [1637] (residue arithmetic) holds only for the last digit of np (prime base p, all n coprime to p) ignoring carries. Gauss [1801] formalized residue arithmetic as closure (‘ring’) with two operations: (.) and (+) associative and commutative, (.) distributes over (+). The carry, often discarded in number theory, is a major issue in engineering. Reviving the carry extends residues to yield integer arithmetic, with interesting results in additive number theory and practice: a residue-and-carry method enables direct proofs of Fermat’s Last Theorem (Chap. 8) and Goldbach’s conjecture (Chap. 9). Semigroups Z(.) mod m are analysed, with four typical moduli m, namely p ± 1 (Chap. 7), binary 2k , prime power p k (Chap. 8), squarefree product mk = p1 ..pk (Chap. 9). Logarithmic code n ≡ g i (generator g mod m) reduces multiplication to exponent addition (Chap. 11). But addition becomes then more difficult. So we analyse the additive structure of mult’ve semigroup Z(.) mod m, e.g.: complementary idempotents in the Boolean lattice of Zm (.) have sum ≡ 1. On addition (successors): the cyclic group of units in Z(.) mod p k (odd prime p) consists of ‘triplets’: (a + 1)b ≡ (b + 1)c ≡ (c + 1)a ≡ −1 with abc ≡ 1. Powers (p + 1)i mod p k generate an order p k−1 cyclic group; but 3i mod 2k (k ≥ 3) yield only half of all 2k−1 odd k-bit residues, due to ‘binary carry’ in 32 = 1001, since only for p = 2: (p + 1)2 > p 3 .
N.F. Benschop, Associative Digital Network Theory, © Springer Science + Business Media B.V. 2009
1
Chapter 1
Introduction The basic ideas of algebra relating to the structure of sequential and combinational logic, although well known from discrete mathematics,1 will be recalled briefly and, for practical state machine design purposes, interpreted in terms of the original additive and multiplicative arithmetic principles from which they developed in the nineteenth century. The subsequent three parts follow in reverse historical order: sequential logic (state machines), combinational logic (Boolean algebra) and arithmetic. The respective disciplines: CS/EE/NT (computer science/electrical engineering digital circuit design/number theory) are merged under one heading: finite associative algebra (semigroups), which is the algebra of function composition. During the development of computing science there was, in the 1970’s, mention of a ‘software crisis’, and the need for more attention to ‘structure’ in programming and design. It was the time of structured computer languages like Algol and Pascal, versus the business-as-usual languages such as Fortran and Cobol. This need for ‘structure’ and ‘correct-by-construction’ is as active now as it was then, and it is the initial motivation for this work to bring the algebra of function composition (viz. semigroups) forward as a unifying principle in computer engineering. In matters of abstract mathematical material with practical applications, there is the usual dilemma of how to present it: – either top down: starting with an abstract concise definition of the essential concepts involved and developing the consequences, ending up with corollaries, as selected examples of important special cases; – or bottom up: by appealing to practical (engineering) intuition and experience, to begin with special essential examples and applications, and gradually extracting their abstract essence to develop the general theory. This dilemma is here resolved by alternating these two approaches, with a preference for starting bottom-up. By familiar examples in arithmetic, digital circuits or state machines, the essence of a formal viewpoint is introduced, as basis for computer aided design (CAD) synthesis algorithms in practice. Synthesis is taken to mean: efficient binary coding of a—functionally specified—symbolic description of desired sequential or combinational logic behavior.
1.1 Sequential and Combinational Logic The principles of sequential- and of combinational logic have their roots in the 1840’s. Both have an associative algebra with (ab)c = a(bc) for all elements a, b, c 1 E.g.
Birkhoff-Bartee 1970—Modern Applied Algebra, Clifford-Preston 1960—Algebraic Theory of Semigroups. N.F. Benschop, Associative Digital Network Theory, © Springer Science + Business Media B.V. 2009
3
4
1 Introduction
such as the well known arithmetic operations (+) and (.) which moreover are commutative: a + b = b + a and a.b = b.a. Notice that exponentiation ( ˆ ) is not associative, nor is it commutative, with ( ˆ ) distributing over (.), and (.) over (+), but ( ˆ ) not over (+) because (x + y)n > x n + y n for n > 1. Hamilton’s quaternions (1843), described by Gauss [Gauss 1801] already in 1819 as ‘mutations in space’ in an unpublished abstract [Bell 1945, p. 200], and Grassmann’s n-dimensional vector analysis (1844) [Bell 1945, pp. 204–208], are among the first non commutative algebras, generalizing arithmetic. On the other hand a restriction of arithmetic is Boole’s algebra for combinational logic (monograph 1848, book [Boole 1854]), presented as a calculus of binary properties. Its operations, intersection and union, are commutative (ab = ba) and idempotent (a 2 = a), yielding a binary form of arithmetic (02 = 0, 12 = 1, 0.1 = 1.0 = 0). Sequential non-commutative logic is here associated with state machines. State machine or automaton M(Q, A) with a finite set of inputs or ‘input alphabet’ A, and a set Q of internal states, has a next state q ∈ Q and output y ∈ Y determined not only by the present input, but also by past inputs via its internal state as a special form of memory, specified by: – sequential state transition function M(Q, A) : Q × A → Q; – a combinational output function F (Q, A) : Q × A → Y (not considered here). Each input a ∈ A is viewed as a transformation a : Q → Q of the state set into itself, as is any sequential composition ab : Q → Q, defined by q(ab) = (qa)b for all a, b ∈ A, q ∈ Q, yielding an associative closure or semigroup: a(bc) ≡ (ab)c of all state transforms under function composition, generated by sequences over A. This concept of specifying sequential behavior can be considered the discrete equivalent of the classical way of describing by differential equations the dynamic behavior of a system with continuous (state) variables. The present ‘Digital Era’ originated in the 1940’s, and despite its age it still lacks a theory of Digital Networks—of a level comparable to the theory of continuous (or ‘analog’) Linear Networks, although there are various algebraic synthesis techniques, like Boolean algebra [Shannon 1938] for combinational logic design, considered to be mature. Yet, a theory of symmetric Boolean logic functions surprisingly plays no role of importance, while the choice of optimal signal polarity (phase assignment) is still a challenge. Symmetric logic synthesis will be developed via an arithmetic ‘spectral’ approach. This is based on Boolean logic as a commutative and idempotent form of arithmetic—precisely the way Boole introduced it in his book The Laws of Thought (1854) as a ‘calculus of properties’ to model Aristotelean logic, finding what Leibniz much earlier (1665) was looking for: symbolic logic as a ‘calculus of reasoning’ [Bell 1945, p. 132], [Eves 1983a, p. 227]. The mathematical concepts of equivalence and ordering, as reflexive and transitive relations which are symmetric resp. anti symmetric, are employed to bring structure into the discrete state- and input-sets of a state machine. The aim is to
1.2 Five Basic State Machines, as Network Components
5
derive its natural decomposition as a network of smaller state machines called components. The first task then is to find a way of ordering state machines. Which is found by considering their sequential closure S (semigroup) of all input sequences representing distinct state transformations, written S = A∗ /Q. This way the input set A and state set Q are ‘integrated’ into one set S of non-equivalent input strings (x ≡ / y in A∗ iff qx = qy for some q ∈ Q), the semigroup of a state machine. In fact A is a generating subset of S, and Q a defining right congruence or preserved partition of S (details later). This yields two types of ordering of automata by their sequential closure: an ‘additive’ ordering based on subsemigroups, and a ‘multiplicative’ ordering based on a preserved state partition: q ≡ r → qa ≡ ra in Q, for all a ∈ A [Hartm 1970] which implies a cascade decomposition, that is a network structure of a machine with an independent ‘leading’ component and a dependent ‘trailing’ component (see Chaps. 2, 3). The second main task is to specify a natural and efficient way of coupling the components, in order to form a network with a given sequential behavior. The coupling in a network represents non-commutative behavior, thus dependent on input sequencing, as different from the sum (uncoupled direct product) of its components. Non-commutative behavior arises either by the coupling of basic components— using the internal state of one component as (partial) input to another component, or is due to components being non-commutative, typically memory components. It appears the latter are of only two (dual) types: the branch machine: known as case statement or if-then-else if binary, and reset machine or D-flipflop (F F ) if binary. Notice each machine input can, regarding its effect on the internal state, be interpreted as a function mapping the state set into itself. Then the quint-essence of the semigroup (associative algebra) approach to sequential machine structure is for engineering purposes: Arithmetization of finite associative function composition, structurally separating the commutative from the non-commutative aspects of state machine behavior.
Regarding the finite state model [Mealy 1955] of sequential logic as basis for state-machine synthesis, the state coding problem in general still stands unsolved despite some early approaches, such as the automaton decomposition into a network of permutation- and reset-machines [K-R 1965], based on the well known group decomposition theorems of Jordan (1870) and Hölder (1889). This approach uses only two of the five basic state machine types indicated by semigroup theory, preventing it from yielding a practical theory for sequential logic and state machine design.
1.2 Five Basic State Machines, as Network Components For linear networks a complete set of five basic components is known, formally derived from the differential equations governing the dynamics of Kirchoff’s voltage/current laws. They are R, L, C, T , G: resistor, inductor, capacitor, transformer,
6
1 Introduction
gyrator [Tellegen 1948], including ways to couple them into a network with desired input/output (I/O) behavior, referred to as synthesis. Such synthesis methods are based on the Fourier frequency spectrum for continuous time functions, and Z-transform techniques for discrete time circuits. Except for some special cases, a comparable systematic synthesis method is not available for digital networks in general, partially due to their more general nature. Instead of one single I/O relation satisfying the linear superposition principle, a digital network has many inputs and many outputs with non-linear I/O relations. Concepts like frequency spectrum and convolution hold only for very limited types of linear digital networks. However, compared with only ‘closure’, associativity of an automaton closure (semigroup) is a very restrictive property, comparable to the superposition principle of linear networks, leading to far reaching structural consequences. The present arithmetic and semigroup approach brings out similarities between linear networks (LN) and digital networks (DN) cq. finite state machines (FSM) in general. For instance, the linear concepts of spectrum and convolution are shown (in Chap. 5) to apply also to Boolean function factorization and synthesis. A basic structure in any finite semigroup is the iteration class a ∗ generated by an element a (see Fig. 1.1). In general a ∗ has an initial aperiodic part (tail), and a final periodic part (cycle) with just one idempotent a e , with exponent e the unique multiple of period p in the cycle. This essential iterative structure was first described by Frobenius (1895) [C-P 1961, p. 19] for subsets of a group, and later by Suschkewitsch (1937) for single elements of a semigroup. Commuting idempotents can be ordered, to be discussed later: they form the essence of set theory and combinational (Boolean) logic. The essence of ‘associativity’ as defined by a(bc) = (ab)c in string sequence algebra, can be depicted geometrically by the next simple figure of component- wise vector addition in the plane, such as a + b = [a1 + b1 , a2 + b2 ]. (See Fig. 1.2.)
Fig. 1.1 General structure of iteration class a ∗ in a finite semigroup
Fig. 1.2 Associative vector addition in the plane
1.2 Five Basic State Machines, as Network Components
7
The five basic DN components will be derived. They correspond to the five nonisomorphic semigroups of order two, denoted C2 , U2 , H2 , L2 , R2 , readily extended to order n > 2, with appealing engineering interpretations: – two iterative components: periodic- and monotone-counters C and U ; – one for combinational logic: hierarchy of idempotents H2 ∼ = Z(.) mod 2; – two for non-commutative memory: branch L (if-then-else) and reset machine R (flipflop), storing first resp. last input, so each others dual. The first three are commutative, and occur in arithmetic residue closures Z(+) and Z(.) mod m. Monotone counter Uk of order k, with final state after k − 1 iterations, occurs for instance as subsemigroup in Z(.) mod p k (prime p). These five minimal semigroups also characterize the five basic types of components, in general of order n ≥ 2, for network composition purposes. There seems to be no convincing reason for linear- and digital networks to both have five basic components, although some parallels can be drawn. Group theory [Robins 1982], applying the essence of symmetries and their closure, can only model reversible processes. Due to the ever present dissipation and diffusion in practical systems, groups do not suffice in general. In practice one cannot escape friction and energy loss. A theory based on symmetries is a ‘conservative’ approach: it conserves energy and ignores dissipative effects (re the entropy law in physics). Semigroups, of associative function composition, provide a more general model of system behavior including dissipation and dispersion, characteristic of nonreversible processes. Hence, beyond conservation models, semigroups are a more realistic model of physical systems than (symmetry-) groups, allowing merging of states, which is excluded from any conservative group model of sequential behavior. With arithmetic as the mother of all algebras, [Gauss 1801] introduced the ‘finite closure’ of residue arithmetic (mod m), where (+) and (.) for residues have the same syntax as for integers: associative and commutative. The 1840’s saw a divergence: Hamilton’s quaternions (1843) with non-commutative composition rule, and Boole’s binary logic (1848, 1854) introduced as a simplified ‘idempotent’ (x 2 = x) form of arithmetic. Later this became the basis of (transfinite) set theory (Cantor 1872). But already in 1837 Dirichlet characterized a function as a mapping between sets: from domain of arguments to codomain of function values. [Eves 1983a, p. 154], where function composition canonically represents an associative operation. For a clear historical overview of these developments the reader is referred to [Bell 1945], especially Chap. 9 “Toward Mathematical Structure” and Chap. 10 “Arithmetic Generalized”. George Boole, in order to model the age-old Aristotelean logic,2 introduced a binary ‘calculus of properties’ in The Laws of Thought [Boole 1854] in the form of idempotent and commutative arithmetic. Apparently the concept of iteration, or repetition, plays no role in this binary logic, hence referred to as combinational logic. 2 As
used by Spinoza and Clarke for a God-existence ‘proof’, which Boole with his more compact algebra showed to be circular: the conclusion is already in the premises.
8
1 Introduction
Rather than restricting arithmetic, Hamilton (1843) generalized it with his quaternions, forming one of the first non-commutative algebras. This “opened the gates to a flood of algebras. . . ” [Bell 1945, p. 189]. Grassmann (1844), Cayley (1858) and others went further to develop matrix calculus and linear algebra in n dimensions [Bell 1945, p. 205], now essential for modeling the behavior of linear dynamic systems. By dropping the ‘one identity’ and ‘unique inverse’ conditions of group theory, this generalization resulted in the unifying associative algebra of function composition, or semigroup theory. Regarding this algebra which underlies state machines, two seminal papers are Suschkewitsch’ PhD thesis (U-Kharkoff, Ukraïne) on the structure of finite simple semigroups—thus without proper ideal [Susch 1928], and Shannon’s MSc thesis (MIT, USA) on Boolean algebra—by then already some 90 years old—as practical model for combinational logic circuits [Shannon 1938]. Ground breaking state-domain texts are from Mealy at Bell Labs, specifying the sequential machine concept [Mealy 1955], and Hartmanis-Stearns (1970) on the link between preserved state partitions and cascade decomposition of sequential machines (re: right-congruence of a transformation semigroup, as preserved stateset partition, see next two chapters).
1.3 Subset/Partition, Local/Global, Additive/Mult’ve An intuitive arithmetic interpretation of the concepts of subset, partition and closure helps to link algebraic properties to machine network structure. Subset S1 of a finite set S, written S1 ⊆ S, contains some, possibly none or all, elements of S where the ordering of elements is irrelevant. Interpret S1 as a ‘local view’ of set S. For instance let D = {0, 1, 2, . . . , 9} be the set of decimal digits (as integers) then S0 = {0, 2, 4, 6, 8} ⊂ D is the subset of even integers in D, and S1 = {1, 3, 5, 7, 9} ⊂ D of odd integers in D. Their union S0 ∪ S1 equals the whole set D, and their intersection S0 ∩ S1 = ∅ is the empty set. Such collection of in general any number of pairwise disjoint subsets whose union covers set S is a partition of S. As a union of disjoint parts of S it provides a global view, involving all elements of S, which is not true for a proper subset A ⊂ S where A provides only a local view of S. Unless one also considers its complement A = S\A as the other part of a 2-part partition (dichotomy) of set S. Now associate the operation of union (+), then the union with arithmetic addition of disjoint subsets Si yields a set S = i Si of order |S| = |Si |, with a number of elements in S equal to the sum of the component orders. This is the maximum order of any union of not necessarily disjoint subsets. On the other hand, if one subset covers all other subsets, say S0 ⊇ Si for all i > 0, then S0 = i Si , and the union of all subsets has the order of the covering subset: | i Si | = |S0 |. A partition of set S into k disjoint subsets: γ = {S1 , . . . , Sk } is a division of S into k parts Si . In a homogeneous partition all parts have equal order, say |Si | = m, and |S| = m.k is the product of partsize and the number of parts, interpreted as ‘global’ information about S. Such partition γ can be associated with the arithmetic
1.3 Subset/Partition, Local/Global, Additive/Mult’ve
9
operations of multiplication and division, and the set S/γ of k parts is an image or projection of set S.
1.3.1 Associative Closure: Semigroup and Sub-Semigroup An operation (∗) defined on a set S, denoted S(∗), assigns to each pair of elements (a, b) in S a unique element c = a ∗ b also in S, a property called closure. In set notation: S ∗ S ⊆ S, also referred to as a (closed) ‘system’ . Notice each element a ∈ S maps S one-to-one (1-1) into itself in two ways: a ∗ S → S and S ∗ a → S, the left- resp. right-composition of S with a. Closure S(∗) is associative if a ∗ (b ∗ c) = (a ∗ b) ∗ c for all a, b, c ∈ S. If moreover a ∗ b = b ∗ a for all a, b in S, then S(∗) is commutative. And in case a ∗ a = a for all a ∈ S then S(∗) is idempotent, then (a ∗ a) ∗ a = a ∗ (a ∗ a) = a ∗ a = a can be written a 3 = a 2 = a, meaning that iteration in S is irrelevant. Such as combinational (Boolean) logic operations union ∪ with A ∪ A = A for each subset A of S, and similarly for intersection ∩. These three syntax rules: associative, commutative, idempotent are defined over 3, 2, 1 elements respectively, clearly forming a hierarchy. Associativity is a necessary condition for ‘repetition’ or ‘iteration’ a k of k times repeated a under operation (∗), to yield a unique element for each a in S(∗). Placing brackets (‘context’) is superfluous in such closure, also called a context-free closure or -language, such as strings over some alphabet A under concatenation. For historical reasons an associative closure is called a semigroup, a generalized group. A group G is defined to be associative, with one identity element e2 = e such that xe = ex = x (all x ∈ G), and a unique inverse a −1 for each a in G with a −1 a = aa −1 = e. In a semigroup only associativity holds, and neither an identity nor an inverse of each element need exist. For instance a set-reset flipflop, the clocked binary memory element in computers, has stateset Q = {0, 1} and inputs A = {s, r} (set, reset) with Qs = 1, Qr = 0. It has a state machine closure that is a right-copy semigroup S = {r, s} with sr ≡ r and rs ≡ s, hence non-commutative, while rr ≡ r and ss ≡ s makes S idempotent, but without identity element. Definition A closed subset B of S(∗) has x ∗ y ∈ B for all x, y in B, and in set notation: B ∗ B ⊆ B in S. It is a subsemigroup of S if the operation (*) is associative. Function composition g(f (x)), or rather x(f ∗ g) in more effective left-to-right notation, is a standard example of an associative operation on a (closed) set of functions with common domain = codomain. For instance state set Q of an automaton, where each input a of inputset A as function a : Q → Q maps the stateset into itself. Input sequence ab also defines such mapping, namely by q(ab) = (qa)b for all a, b ∈ A and all states q ∈ Q.
10
1 Introduction
In practical terms, the associative property is the essence of ‘consistency’ in sequential logic, meaning that any sequence abc in some system S( ) under the associative sequencing operation ( ) yields just one unique element (ab)c ≡ a(bc) ≡ x in S, independent of bracketing, also called ‘context-free’. Associativity is a very restrictive property of closures, similar to ‘differentiable’ or ‘continuous’ for real functions. Consequently, one can expect much structure to follow from associativity, as will be shown regarding the associative closure (semigroup) generated by a finite state machine.
1.3.2 Preserved Partition: Congruence and Image Only associative closures, resp. associative algebra, will be considered in the sequel. The operation, if not specified further, is assumed to be string ‘concatenation’, denoted as ( ). A congruence γ of a closed system S( ) is a partition of S whose set of parts is closed under left- (resp. right-) composition by any element x of S. Elements a, b in the same part of γ are equivalent (mod γ ) denoted a ≡γ b, or a ≡ b if γ is understood. Definition If a ≡γ b → ax ≡ bx for all x ∈ S, then γ is a right-preserved partition or ‘right-congruence’. Similarly: a ≡γ b → xa ≡ xb (all x ∈ S) defines γ as a left preserved partition of S( ), or ‘left congruence’. And a congruence, or full congruence, is both left- and right-preserved. Clearly, a set A of generators of S = A∗ /Q suffices for testing or generating the preserved property of γ . The corresponding set of parts, viewed as elements that compose under ( ) as AB ≡γ {ab} for all a ∈ A, b ∈ B forms a smaller system under part- composition written as image system S/γ , viz. a projection of S. For instance multiplicative residues Z10 = Z(.) mod 10 form a semigroup of order ten, with full congruence α = {0, 2, 4, 6, 8}{1, 3, 5, 7, 9} of even and odd part, and image Z/α = Z2 (.) the 2-part Boolean (binary) system of multiplication mod 2. The complementary image Z/β = Z5 (.) of residue multiplication mod 5, has congruence β = {0, 5}{1, 6}{2, 7}{3, 8}{4, 9}. This set of five parts is indeed verified to be closed under part composition, e.g. {1, 6}.{2, 7} ≡ {1.2, 1.7, 6.2, 6.7} ≡ {2, 7} mod 10. Here the carries 1 and 4 in 6.2 = 12 = 1.10 + 2 resp. 6.7 = 42 = 4.10 + 2 are discarded, typical for residue arithmetic. The two congruences α and β are complementary, or ‘orthogonal’, in the sense that each element of Z10 is specified by giving the part of α and of β it belongs to. Furthermore, the decomposition Z10 (.) = Z2 .Z5 = Z5 .Z2 into two commuting components is equivalent to the existence of these two orthogonal congruences. More in general, the approach to state machine decomposition into a network of smaller state machines, which are possibly coupled, is in essence the factoring its sequential closure (semigroup). The amount of ‘hardware’ involved is then proportional to the sum of the component factors, increased with the cost of the Boolean logic functions coupling them.
1.4 Integer Arithmetic: Residues with Carry
11
Fig. 1.3 Three ways of composing two components into a network
For instance a 60-counter (cyclic group of order 60) decomposes into an unconnected ‘direct product’ of three counters of orders 3, 4 and 5 in parallel, with a hardware cost of 3 + 4 + 5 = 12. Binary coding of these counters reduces the cost to the sum of respective log2 values. Figure 1.3 shows the three ways of composing two components into a network. Coupling, which maps the state of one component into the input set of another, induces non-commutative sequential behavior. For an efficient decomposition of a given machine M with closure S, the closures S1 and S2 of independent ‘leading’ component M1 and of dependent ‘trailing’ component M2 turn out to be subsemigroups of S, and moreover S1 = S/ρ is a right-image of S for some r-congruence ρ (preserved state partition with S as state set). So machine synthesis, or efficient coding of its state into smaller components, is factoring its closure S, with least coupling. State set Q = Q1 × Q2 then has two components: Q1 and Q2 , the state sets of M1 and M2 , and each state q ∈ Q is encoded q = [q1 , q2 ]. Finite associative algebra principles are necessary and sufficient as a practical basis of sequential logic for the synthesis of digital networks as sequential circuits, with internal state (memory) as essential concept for non-commutative sequential aspects of dynamic behavior. In a more general context, the concept of internal state—as model of stored past experiences—is a ‘hidden variable’ to describe otherwise inexplicable (human) behavior, and it is possibly a necessary condition for self-awareness (re: learning neural nets [Aleks 1996]).
1.4 Integer Arithmetic: Residues with Carry For engineering purposes of state machine theory and practice, our aim will be to extract as much as possible the arithmetic (commutative) nature of the underlying associative algebra (semigroups) of function composition. Encode integer n = cm + r by two components n = [c, r]m for some modulus m > 1, with carry c as multiple of modulus m and residue 0 ≤ r < m, then integer arithmetic is viewed as ‘carry extended’ residue arithmetic. Such arithmetic, as executed by a two-component machine network, would have the residue component working independently on external ‘r’ inputs, providing internal ‘carry’ input to the dependent component machine with external ‘c’ inputs.
12
1 Introduction
In base m notation the components of a product are: [c1 , r1 ].[c2 , r2 ] = [c1 c2 , (c1 r2 + c2 r1 ), r1 r2 ] with resp. weights m2 , m, 1. If r1 r2 > m then a single digit carry, due to r1 r2 < m2 , propagates into the next position of weight m. Notice the least significant (residue) component does not depend on any c component, and similar for addition. The partition of the integers, corresponding to equivalencing integers with equal residue (mod m), is clearly a congruence on both Z(+) and Z(.) as introduced by Gauss (1801), yielding the known integer arithmetic laws also to hold for residues. Thus residue r, the least significant digit (base m) is a ‘global’ image of Z(+) resp. Z(.) while the most significant digit c is the dependent component in this representation, namely dependent on the carry produced by the independent residue machine component. This reverses the roles of least- and most-significant component to resp. ‘global’ and ‘local’, or independent and dependent network components. State machines: The commutative aspects of a state machine M(Q, A)—with state set Q and input alphabet A—can now be treated arithmetically by considering the maximal commutative image T of its closure (semigroup S) as leading network component. Decompose T using residue arithmetic components Z(+) and/or Z(.) mod mi for the smallest possible moduli mi . If S is not commutative then M, resp. S, is covered by a coupled composition T |> V , where dependent component V (a subsemigroup cq an ideal of S) is composed of non-commutative components (reset-, branch-, permutation machines) as described in Chaps. 2–4. A non-cyclic simple group G by definition has no proper image group. However such group, like any finite non-cyclic group, does have subgroups Si of prime power order (pi )ni which are coprime. These Sylow components are orthogonal, meaning they intersect only at the identity element e of G. Hence G = S1 S2 · · · Sk is their sequential product, of order |G| = |Si |. By using right congruences as preserved state partitions, each finite group is shown to be a coupled (cascaded) or uncoupled (if commutative) network of such Sylow factor groups. So a full (left- and right-) congruence is not necessary for decomposition: right congruences suffice. Log-arithmetic: Two logarithmic forms of arithmetic will be described (Chap. 11) either over a single base 2 (with a 32 bit VLSI implementation—in an European project [Cole 2000]—to compete with the known floating point arithmetic), or over two bases (2 and 3) employing 3 as semi-primitive root of 1 mod2k for k ≥ 3, with residues n ≡ ± 3i 2j mod 2k for unique non-neg. i ≤ 2k−2 , j ≤ k. Summary: Much of the presented material is new, and was published in recent years. The chapters are self-contained and have their own local references (also included in the global bibliography). The aim is a better fundament for DN structure and computer aided design (CAD) algorithms, unifying and organizing well- and lesser- known concepts spread over various mathematical and engineering disciplines. As such, it presents some solutions to well known problems, and sets up a framework for further research and CAD implementation at the main three levels of Applied Associative Algebra in practice: arithmetic, combinational and (state-memory) sequential logic.
1.4 Integer Arithmetic: Residues with Carry
13
For practical finite implementations one should not be discouraged by matters of ‘size’, such as 2n for n-input Boolean functions, n! for permutation groups over n states, and worst of all: nn for transformation semigroups over n states. The derived structural insights will be helpful to tackle practical design problems, even for seemingly infeasible values of n.
Chapter 2
Simple Semigroups and the Five Basic Machines Constant Rank (CR) state machines play an important role in the general structure theory of Finite State Machines. A machine is of constant rank if each input and input-sequence maps the state set onto the same number of next states. CR-machines are analysed by their sequential closure (semigroup), which is shown to be a simple semigroup, that is: a semi-direct product G |> (L × R) of a left- and a right-copy semigroup, and a group. So in general a CR-machine is a composition of a branch-, a reset- and a permutation machine, which are three of the five basic types of state machines to be derived.
2.1 State Machine: Sequential Closure and Rank A brief review will set up the required concepts. A state machine M(Q, A) with state set Q and input alphabet A is a function M : Q × A → Q, which maps each combination of present state and input to a next state. It is specified by a state transition table with |A| columns and |Q| rows. Each input a ∈ A is interpreted as a function a : Q → Q, mapping state set Q into itself, a state transformation, or in short: a Q-transform. Define sequential composition ab of transforms a and b by q(ab) = (qa)b, for all q in Q. In other words, in state q first apply input a to get state qa, then apply b which yields state (qa)b = q(ab) = qab, in left-to-right notation of function composition with state set Q as domain = codomain. Definition Two input sequences over A are equivalent if they yield the same Qtransform: a ≡ b in A∗ ff qa = qb for all q in Q. Definition The sequential closure of M, called semigroup S, is the (finite) set of Q-transforms generated by all sequences over A, denoted S = A∗ /Q. Here A∗ denotes the infinite semigroup of non empty strings of length ≥ 1 over alphabet A, under string concatenation. Closure S of machine M is a finite semigroup (of order ≤ nn , if M has n states) since transform composition is associative: a(bc) = (ab)c for all a, b, c ∈ S, which is clear from above definition of transform composition. Input strings with the same Q-transform are defined equivalent with respect to machine M, so the transform representation of each element of S is unique. State transform x : Q → Q is a function defined on state set Q, which is both domain and co-domain. To state transform x correspond: – range Qx is the set of function values (next states), – partition P x equivalences states mapping onto the same next state, – rank r(x) = order |Qx| of its range = number of partition blocks. N.F. Benschop, Associative Digital Network Theory, © Springer Science + Business Media B.V. 2009
15
16
2 Simple Semigroups and the Five Basic Machines
Let ⊆ denote ‘subset of’, and use ≥ for ‘coarser than, or equal’ partition then: Lemma 2.1 Non-increasing Rank property: (a) (b) (c) (d)
Left composition x. does not increase range: Qxy ⊆ Qy. Right composition .y does not refine partition: P xy ≥ P x. Transform composition does not increase rank: r(xy) ≤ r(x) and r(xy) ≤ r(y). All x with rank(x) ≤ k as subsemigroup are an ideal Zk of S.
Proof (a) Qxy ⊆ Qy follows from set inclusion and associativity: Qx ⊆ Q for all x, and right composition with y yields (Qx)y = Q(xy) ⊆ Qy. (b) P xy ≥ P x follows from associativity and right composition of states i, j that are equivalent under x : ix = j x implies ixy = j xy for all y. (c) This monotone rank property follows directly from (a) and (b), since range ordering (a) implies rank ordering |Q(xy)| ≤ |Qy|, and partition ordering (b) implies rank ordering |P (xy)| ≤ |P x|: non-increasing nr. parts. (d) It follows that if x and y have rank ≤ k, then so does composition xy. This closure property means that all elements of rank not exceeding k form a subsemigroup Z of S. In fact, composition of any element z ∈ Z with any element s ∈ S yields zs with r(zs) ≤ r(z) ≤ k, so that zs is in Z. The same holds for sz, hence Z is left- and right ideal of S, so ZS ⊆ Z and SZ ⊆ Z (re ideals: next section). Basically, this chapter tries to render results from semigroup structure and their state representation better accessible for state machine decomposition purposes. The earliest semigroup result [7], [4, p. 207] is the structure of the minimal ideal of a semigroup, in essence Theorem 2.3.
2.2 Basic Machines and Simple Semigroups Machine decomposition is seen as implementing a machine as a network of smaller machines. Semigroups, as the sequential closures of state machines, are essential for the equivalencing and ordering of machines. Definition Two machines are equivalent if they have isomorphic semigroups. Two machines are ordered M1 ≤ M if their closures are ordered S1 ⊆ S, thus S1 is (isomorphic to) a subsemigroup of S. The five basic state machines, with a semigroup S having no proper sub-semigroup [1] are: the prime cycles Cp and those of order two, to be derived in the next section (Theorem 2.1). Their interpretation as the elementary digital functions are: logic, arithmetic and memory. Figure 2.1 displays the various forms of the five minimal semigroups and basic state machines, to be derived formally in Sect. 2.2.3, after some essential semigroup sub-structures are introduced. A semigroup S is also a state machine M(S, S) with itself as inputset and state set. For unique representation by state transforms (distinct columns), one extra state
2.2 Basic Machines and Simple Semigroups
17
(as left identity of S) suffices if some columns are equal in the S × S composition table, see tables U 2 and L2 in Fig. 2.2. Components C2 and U 2 have one generator, the others have two idempotent generators a 2 ≡ a, b2 ≡ b. Definition A semigroup is of constant rank (CR) if it can be represented by transforms of equal rank. A state machine is of constant rank if its closure is a CRsemigroup. Three basic components are of constant rank, namely L2, R2 and C2. They are the smallest cases of three types of constant rank semigroups: Left-copy semigroup L: ab = a for all a, b ∈ S(n-branch, n + 1 states). Right-copy semigroup R: ab = b for all a, b ∈ S(n-reset, n states). Group G: Permutation machine (permutes n states, |G| ≤ n!). All three are special cases of the next general type of semigroup [4, p. 5]: Definition An ideal of semigroup S is a subset Z with SZ ⊆ Z and ZS ⊆ Z. A semigroup is called simple if it has no proper ideal. An ideal is like a multiplicative ‘zero’ (a0 ≡ 0a ≡ 0 for all a) or ‘sink’. Notice U 2 (monotone counter with a final state) and H 2 (hierarchy of two ordered idempotents, see Fig. 2.1 and next section) are not simple semigroups, nor are they of constant rank. In general they model the monotone sequential aspects and combinational logic aspects of state machines respectively. Corollary 2.1 A simple semigroup is of constant rank. This follows directly from Lemma 2.1, since otherwise the elements of minimum rank would form a proper ideal. In fact, it will be shown that any simple semigroup is a semidirect product G |> (L × R) of the three basic types of simple semigroups G, L, R. So a general CR-machine is the composition of a permutation machine, a branch machine, and a reset machine.
2.2.1 Iterations: Monotone, Periodic, Idempotent Iteration in a semigroup S is the repetition a i of a single element. Due to associativity the result is a unique element in S, independent of bracketing. The closure of a single element a in S is the finite set of its iterations a ∗ = {a i , i = 1..n} (‘/Q’ is omitted if no confusion can arise) which in general has the tail-and-cycle structure as in Fig. 2.1. For finite a ∗ there is a smallest n with a n+1 ≡ a t+1 , tail(a) = t , (0 ≤ t < n) and period(a) = p = n − t . There is precisely one idempotent a i ≡ (a i )2 where i = m.p is the only multiple of p in the cycle, and a k ≡ a k+p for k > t.
18
2 Simple Semigroups and the Five Basic Machines
Fig. 2.1 Iteration class a ∗ generated by element a
An element of semigroup S is called periodic if its closure has no tail t = 0, and monotone [no cycle] if p = 1. Only idempotents e2 ≡ e have both properties. Elements which have a tail and a cycle are called aperiodic. Definition 1 Pair e, z of commuting idempotents: ez = ze, e2 ≡ e, z2 ≡ z, is ordered e ≥ z when ez ≡ ze ≡ z, thus e is identity for z. This is an ordering relation, easily verified to be reflexive, anti-symmetric and transitive [4, p. 23].
2.2.2 Ordered Idempotents H for Combinational Logic It will be shown that any simple semigroup S, being of constant rank, contains only periodic elements. Moreover, its idempotents are not ordered but are all equivalent in some sense. So basic components of type U 2 (monotone iteration) and H 2 (hierarchy of ordered idempotents, or combinational logic) do not occur. In fact S is a disjoint union of isomorphic groups (G), forming a direct product of a left-copy (L) and a right-copy (R) semigroup. Lemma 2.2 Ordered idempotents: Commuting idempotents z ≤ e are ordered by their ranges: Qz ⊆ Qe, hence: distinct commuting idempotents have distinct ranges, and: ordered idempotents z < e have ordered ranks r(z) < r(e). Proof Consider ordered idempotents z ≤ e, then e is identity for z : ez ≡ ze ≡ z, so their ranges are ordered because Qz = Q(ze) = (Qz)e ⊆ Qe by Lemma 2.1a. Notice that ze ≡ z suffices: e is right identity for z. Conversely, for commuting idempotents: Qz ⊆ Qe implies z ≤ e. This follows from an idempotent state transformation e: qee ≡ qe, hence each state q maps to state qe which is fixed under e, and no state chains of length > 1 occur in the state transition diagram of e. Range Qe is the set of fixed states of e. If Qz ⊆ Qe then z maps each state q into a fixed state of e so (qz)e ≡ qz for all q, hence ze ≡ z. By assumption e and z commute, so ez ≡ ze ≡ z, meaning z ≤ e. In case Qe = Qz for commuting idempotents e, z then e ≤ z and z ≤ e, hence e ≡ z. So commuting idempotents with the same range are equal. Lemma 2.3 A simple semigroup S has no ordered idempotents, and no pair of idempotents commutes (anti-commutative).
2.2 Basic Machines and Simple Semigroups
19
Proof Ordered idempotents have different ranks according to the previous lemma. Let k be the lowest rank of an ordered pair of idempotents. Then, with Lemma 2.1d, S has a proper ideal consisting of all elements with rank ≤ k which contradicts S being simple. The composition d ≡ ef ≡ f e of two commuting idempotents is also idempotent: d 2 ≡ ef ef ≡ eeff ≡ ef ≡ d. And d is ordered under e, since ed ≡ eef ≡ ef ≡ d so d ≤ e, and similarly d ≤ f . One readily verifies d is the greatest lower bound or meet of e and f [4, p. 24]. No idempotent pair commutes because such pair is either ordered or their composition is ordered under both, contradicting S being simple. So a semigroup of commuting idempotents is partially ordered set where each pair has a meet (set intersection of their ranges), called a lower semilattice, with a global zero. For n states, there are at most 2n commuting idempotents (Boolean lattice).
2.2.3 The Five Minimal Semigroups and Basic Machines We are now in the position to derive the five basic types of state machines, via the five non-isomorphic minimal semigroups (viz. of order two), and their engineering—state machine—interpretation (see Fig. 2.2). Definition A basic machine has a closure with no proper subsemigroup.
(2.1)
Theorem 2.1 (The five basic state machines) The basic semigroups with condition (2.1) are: the prime cycles Cp and the semigroups of order |S| = 2, of which there are five. Proof The next three properties suffice to distinguish the five cases: Dimension: dim(S) = the minimum required number of generators of S. Periodic: tail(a ∗ ) = 0 in an iteration class a ∗ , dim(a ∗ ) = 1. Commutative: ab ≡ ba for each pair a, b ∈ S. Condition (2.1) implies dim(S) ≤ 2, otherwise any pair of generators produces a proper subsemigroup. If dim(S)=1, with generator a, then either S is periodic in which case (2.1) implies S = Cp for prime order p, or S is monotone of order 2. Because a non-trivial cycle (Fig. 2.1) is a proper subsemigroup, and in a monotone semigroup of order |S| >2 the element a 2 generates a proper subsemigroup. If dim(S) = 2 the two generators must be idempotent: a 2 ≡ a, b2 ≡ b and S = {a, b} since a non-idempotent element would generate a proper subsemigroup. There are then two cases: S is commutative, or not. For commutative S the two idempotents must be ordered (Lemma 2.2), hence S = H2 . If S is not commutative there are again two cases: either ab ≡ a (L2 ), or ab ≡ b (R2 ). This exhausts all cases.
20
2 Simple Semigroups and the Five Basic Machines
Fig. 2.2 The five basic state machines and semigroups: properties and functions
2.3 Equivalent Idempotents: Memory Components L, R Consider now the idempotents of a simple semigroup S. They do not commute (Lemma 2.3), but they may be equivalent in the following sense: Definition 2 Equivalent idempotents – idempotents a, b that form a left- [right-] copy semigroup L2 [R2], are called left- [right] equivalent, denoted aLb [aRb]. Equivalent idempotents, denoted a ∼ b, are left- or right equivalent: either directly, so they form L2 or R2, or indirectly: alternating L- and R- equivalent via other idempotents. Lemma 2.4 For idempotents a, b in any semigroup S, over stateset Q: (a) Equivalent idempotents have equal rank: a ∼ b =⇒ |Qa| = |Qb|, but equal rank is not sufficient for equivalence: see (b) (b) Let (ab)k ≡ ab and (ba)k ≡ ba, with idempotents (ab)k−1 ≡ ab0 and (ba)k−1 ≡ ba 0 , with max-subgroups Gab0 resp. Gba 0 , then for k = 2: {a, b, ab, ba} are 2 or 4 idts of equal rank forming L2, R2 or L2 × R2. (c) For k > 2: {Ga , Gb , Gab0 , Gba 0 } yield Lm × Rn under set product.
2.3 Equivalent Idempotents: Memory Components L, R
21
Proof (a) Three cases of equivalence for idempotents a, b exist: left-, right- and indirect equivalence. In the first two (’direct’ equivalence) the rank Lemma 2.1 yields: aLb implies r(a) = r(ab) ≤ r(b) and r(b) = r(ba) ≤ r(a) −→ r(a) = r(b), aRb implies r(a) = r(ba) ≤ r(b) and r(b) = r(ab) ≤ r(a) −→ r(a) = r(b). Hence left- or right equivalent idempotents have the same rank. Transitivity holds in both cases. For instance if aLx (ax ≡ a, xa ≡ x) and xLb (bx ≡ b, xb ≡ x) then aLb, since ab ≡ ax.b ≡ a.xb ≡ ax ≡ a, and similarly ba ≡ b. Also right equivalence is transitive. Now if aLc and cRb with c different from a and b, then a, b are not directly leftor right equivalent, but they are still called (indirectly) equivalent, denoted aLRb. Here LR is an equivalence relation since it is easily seen to be reflexive, symmetric and transitive. It follows that if a and b are indirectly equivalent via other idempotents, then by transitivity they all have the same rank. (b) There are several cases: direct and indirect equivalence. For k = 2, in the direct equivalent case aLb and aRb the elements ab and ba are not different from a and b, forming L2 and R2 respectively. For indirect equivalence of idempotents a and b, and in case k = 2 the only other intermediate elements are idempotents ab and ba, with aba ≡ a and bab ≡ b, seen as follows. Idempotents a, b must have equal rank: |Qa| = |Qb| (Lemma 2.2a), so exact equality holds: (Qa)b ⊆ Qb, with Qa.b = Qb (*) and similarly Qb.a = Qa (**). Composing both sides of (*) on the right by .a and applying (**) yields Qa.ba = Qba = Qa. So sequence .ba permutes Qa → Qa. Since ba is idempotent, this is the identity permutation, so (qa)ba ≡ qa for all q, meaning aba ≡ a. Similarly (ab)2 ≡ ab implies bab ≡ b. So strings of length > 2 are equivalent to strings of length ≤ 2, which are just a, b, ab, ba forming a closure of four idempotents, with the next equivalences (using aba ≡ a, bab ≡ b): – – – –
aRab since a.ab ≡ aa.b ≡ ab and ab.a ≡ a, abLb since ab.b ≡ a.bb ≡ ab and b.ab ≡ b, bRba since b.ba ≡ bb.a ≡ ba and ba.b ≡ b, baLa since ba.a ≡ b.aa ≡ ba and a.ba ≡ a.
These relations are depicted in a rectangular form in Fig. 2.3. The four elements {a, b, ab, ba} form a direct product L2 × R2 idempotent semigroup. The direct product L2×R2 (for k = 2) follows from two complementary congruences (preserved partitions), as in Fig. 2.3. Let ab ≡ c, ba ≡ d, then {a ≡ c, b ≡ d} with image L2, and {a ≡ d, b ≡ c} with image R2. Equivalently, the direct product is represented by two independent components x = [x1 , x2 ] the first composing as L2 and the second as R2. Figure 2.3 shows the left- and right equivalences plotted pairwise in the plane, and the composition tables of L2, R2 and L2 × R2 = {a, b, ab, ba}. From this rectangular display follows the term diagonal equivalence for two indirectly equivalent idempotents. It is denoted by xDy where x and y follow from
22
L2 | a b ---+---a | a a b | b b R2 | a b ---+---a | a b b | a b fig(a) ======
2 Simple Semigroups and the Five Basic Machines
L2xR2| a b c d -----+-------a | a c c a b | d b b d ab= c | a c c a ba= d | d b b d ........... e a b c d \ initial state for unique repr.
Rectangular ’Band’
.............. Lm| : | : b --R-- ba=d | : | | y......yx : L L | : : | | | : : ab --R-- a z-------x----> =c xy Rn Lm x Rn xyx = x , yxy = y fig(b) ======
Image = S/Congruence : L2 = S/{a=c,b=d} ; R2 = S/{a=d,b=c} Code L2xR2: x=[x1,x2] , y=[y1,y2] --> xy=[x1,y2] , yx=[y1,x2] Fig. 2.3 Direct product L2 × R2
commutation: x ≡ ab and y ≡ ba for some a and b, also diagonally equivalent: aDb with a ≡ aba ≡ abba ≡ xy and b ≡ bab ≡ baab ≡ yx. Diagonal equivalence occurs in pairs: aDb iff abDba. (c) For k > 2 the above analysis can be generalized simply to Lm × Rn for m.n idempotents, with each idempotent pair forming either L2 or R2 or L2 × R2. Then (ab)k ≡ ab and (ba)k ≡ ba for some k > 1, where ab and ba are not nec. idempotent, generating idempotents (ab)k−1 ≡ ab0 and (ba)k−1 ≡ ba 0 in a k − 1 cycle, with (aba)k ≡ a and (bab)k ≡ b. The resulting structure of a simple semigroup S is in general a semidirect product G |> (Lm × Rn) with a group G as subgroup of S, occurring mn times, derived next. Without going into much detail [4, Vol. I, Appendix A]: each idempotent a ∈ S, interpreted as left- or right- multiplier, yields principle subsemigroups aS and Sa, represented in the composition table of S by the respective rows and columns (Fig. 2.3). Each idempotent a is the identity of a maximal subgroup Ga ≡ aSa, the intersection of aS and Sa, while aSb contains ab and its idempotent (ab)k−1 as max-subgroup identity. One readily verifies that all max-subgroups are isomorphic. Equivalencing each to one congruence part, with Gab ≡ Ga Gb , yields image Lm × Rn where m and n represent the number of max-subgroups in S forming leftresp. right-copy semigroups Lm and Rn as image. If the product ab of idempotents is not idempotent then Lm × Rn is not a sub-semigroup of S, although it is in any case an image semigroup of S, namely Lm × Rn ∼ = S/G. Group G occurs mn times as subgroup of S, and it is an image G = S/(Lm×Rn) iff Lm × Rn is subsemigroup of S, with S = (Lm × Rn) × G as direct product. Otherwise G is no image of S with coupled product S = G |> (Lm × Rn). Refer to [4] for a short description of Suschkewitch’s original paper (1928) regarding the structure of a finite simple semigroup S in general: S is determined
2.3 Equivalent Idempotents: Memory Components L, R
23
by group G, integers m, n in Lm and Rn , and (m − 1)(n − 1) products e11 ei,j of subgroup identities for i = 2 . . . m, j = 2 . . . n. In Chap. 4 this is translated to a state machine structure as a branch- and a resetmachine, coupled to a permutation machine with closure G. The table of L2 × R2 viewed as state machine has two pairs of equal columns (inputs a ∼ = d and b ∼ = c), needing one extra initial state e for a unique state transform representation. Notice the left-to-right input sequencing as asymmetry of ‘time’. Lemma 2.5 (a) In any idempotent semigroup S: a ≥ aba. (b) a > aba for some a, b only if S is not of constant rank, hence a ≡ aba for all a, b iff S is idempotent of constant rank. Proof (a) a and aba commute, and a is left- and right identity for aba, because aa ≡ a and a.aba ≡ aba ≡ aba.a. (b) If S is not of constant rank, then the minimum rank idempotents form a proper ideal Z of S (Lemma 2.1d), and there is an ordered and commuting pair of idempotents. Consider idempotents a ∈ S Z and b ∈ Z, then idempotent aba is also in Z with the same (minimal) rank as b, hence: rank(a) > rank(aba) = rank(b), and strict ordering a > aba holds. The rectangle of equivalent pairs of idempotents generalizes to Lm × Rn (m, n ≥ 2). The m.n idempotents form an m × n matrix, where L [R] equivalence holds between elements in the same column [row]. This is the general structure of a constant rank idempotent semigroup (rectangular band). Theorem 2.2 The following conditions on a finite semigroup S are equivalent: Anti-commutative (no two elements commute: ab ≡ ba =⇒ a ≡ b). Idempotent and of constant rank. aba ≡ a for all a, b ∈ S. Each pair a, b of idempotents in S is equivalent: either directly, forming L2 or R2, or indirectly via ab and ba, forming L2 × R2. (e) S is a direct product Lm × Rn (m, n ≥ 1). (a) (b) (c) (d)
Proof (a) =⇒ (b): an anti-commutative semigroup S is idempotent, because any iteration class x ∗ is a commutative subsemigroup, so |x ∗ | = 1 for all x, so each element of S is idempotent. Moreover, S is of constant rank; otherwise some pair of idempotents a, b would be properly ordered (Lemma 2.5b) and thus commute, contradicting S being anti-commutative. (b) =⇒ (c): Lemma 2.5a. (c) =⇒ (d): Lemma 2.5b. (d) =⇒ (e): Pairwise equivalence in S implies the direct product structure Lm × Rn with m, n ≥ 1 as follows. If S contains only left- equivalent idempotents then S = Lm where m = |S| and n = 1. The other trivial case occurs when S contains
24
2 Simple Semigroups and the Five Basic Machines
n right equivalent idempotents, and no left equivalence holds: S = Rn with m = 1 and n = |S|. If both left- and right equivalences occur, rectangular structure Lm × Rn (Fig. 2.3b) is seen as follows. Take any idempotent z and form two subsets: Lz with all elements y that are left equivalent yLz to z, and Rz containing all x with xRz: right equivalent to z. They intersect only in z, because if w is left- and right equivalent to z, then it cannot differ from z since w ≡ wz ≡ z. Here Lz and Rz are left- and right copy subsemigroups of S. Let the orders be respectively |Lz| = m and |Rz| = n. Pairwise equivalence implies n copies of Lz which form a congruence λ of S with image S/λ = Rn. Similarly, congruence ρ consists of m copies of Rz, yielding image S/ρ = Lm. Since no pair of idempotents can be both left- and right equivalent, congruences λ and ρ are orthogonal: S = Lm × Rn. (e) =⇒ (a): semigroup S = Lm × Rn consists of pairwise equivalent idempotents. Then it is anti-commutative which means that no pair commutes. For assume that one pair of distinct idempotents a, b commutes: ab ≡ ba, then they are either ordered a < b or a > b (in case ab is a or b), or their product is a third idempotent c ≡ ab ≡ ba, their meet, that is ordered c < a and c < b. Either case contradicts pairwise equivalence. Notice the general conditions (a), (b) imply a very regular structure (e), due to the strong properties of finite (rank) associative (semigroup) algebra.
2.4 Maximal Subgroups: Periodic G Lemma 2.6 In iteration class {a i } generated by semigroup element a: – the tail elements (if any) reduce strictly in rank, and – the cycle elements have constant minimum rank. Proof Consider the successive ranges Qa i which, due to range Lemma 2.1a, form a reducing inclusion chain of subsets of Q. Each range is contained properly in the previous one until the cycle is reached at i = t + 1. Because if two successive ranges are equal, then so are all next ranges: Qa i = Qa i+1 −→ Qa i+1 = Qa i+2 , etc. (compose on the right by a). So the initial tail ranks decrease strictly, and all periodic elements in the cycle have equal and minimal rank. Corollary 2.2 In a simple semigroup S every element is periodic. This follows directly from the previous lemma and Lemma 2.1(d): an element of S with a tail has iterations with different ranks, which contradicts the constant rank property of a simple semigroup. The next lemma shows a simple semigroup is a disjoint union of isomorphic groups. Lemma 2.7 (Maximal subgroups) For a finite semigroup S:
2.5 Constant Rank Machines, and Simple Semigroups
25
(a) Periodic elements generating the same idempotent e form a maximal subgroup of S: the group Ge of e. (b) Equivalent idempotents a ∼ b have isomorphic groups Ga ∼ = Gb : if aLb via isomorphism a.Gb = Ga , mapping x in Gb to ax ∈ Ga ; if aRb via isomorphism Gb .a = Ga mapping x in Gb to xa ∈ Ga ; if aDb via isomorphism a.Gb .a = Ga mapping x in Gb to axa ∈ Ga . Proof (a) Let periodic element x generate idempotent e with period p, so x p ≡ e. Then clearly the inverse of x with respect to e is x p−1 . Define x 0 ≡ e for consistency in case p = 1(x ≡ e), and denote the inverse of x by x −1 . If y is another periodic element generating e, with inverse y −1 , then xy has inverse (xy)−1 = y −1 x −1 since xy(xy)−1 ≡ xyy −1 x −1 ≡ xex −1 ≡ xx −1 ≡ e, and similarly (xy)−1 xy ≡ e. It follows that xy generates the same idempotent as x and y, so closure holds. Inverses are unique, because if x has two inverses x1 and x2 then x1 ≡ x1 .e ≡ x1 (xx2 ) ≡ (x1 x)x2 ≡ ex2 ≡ x2 . So all periodic elements generating the same idempotent form a group. (b) Let a and b be two right equivalent idempotents aRb so ab ≡ b and ba ≡ a, then right composition of Ga with b is a morphism from Ga onto Gb , meaning Gb is an image of Ga , denoted Gb |Ga (divisor relation). This follows, because a is identity for each y in Ga : ay ≡ ya ≡ y, while for each x, y ∈ Ga : xbyb ≡ xbayb ≡ xbayb ≡ xayb ≡ xyb (*), where ba ≡ a is used. Hence the image of a composition of elements is the composition of their images. We need ab ≡ b to show that xb is in Gb , in fact xb generates b upon iteration. This is seen by replacing y in (*) with x, then (xb)2 ≡ (x 2 )b, and in general (xb)i ≡ (x i )b. Let p be the period of x in Ga : x p ≡ a, then (xb)p ≡ (x p )b ≡ ab ≡ b in Gb . So if ab ≡ b and ba ≡ a then a and b are right-copiers for each other, forming right equivalent idempotents aRb, then right composition of Ga with b yields image Gb . Similarly, right composition of Gb with .a yields image Ga . Consequently right equivalent idempotents aRb have mutually ordered groups Gb |Ga and Ga |Gb , so they are isomorphic: Ga ∼ = Gb . Using left composition by a and b respectively, it follows that also left equivalent idempotents have isomorphic groups. And finally, by transitivity, diagonal equivalent idempotents have isomorphic groups as well. In that case aDb with (Fig. 2.3b) aLba, baLb and a.Gb .a = a.Gba = Ga . The diagonal case covers the other two cases of direct equivalence.
2.5 Constant Rank Machines, and Simple Semigroups Combining all results yields: Theorem 2.3 The next conditions on a finite semigroup S are equivalent: (a) S is simple (has no proper ideal). (b) S is of constant rank.
26
2 Simple Semigroups and the Five Basic Machines
(c) S is a disjoint union of isomorphic groups, which under set composition form L × R. (d) for idempotents a, b ∈ S : Ga = aSa and aGb .a = Ga (e) S is a semi-direct product G |> (L × R) of a left- and right-copy semigroup with a group. Proof (a) =⇒ (b): Corollary 2.1. (b) =⇒ (c): Each element x of a constant rank semigroup S is periodic (Corollary 2.2). Hence S is a union of as many maximal subgroups as there are idempotents, being the subgroup identities (Lemma 2.4). The subgroups are disjoint since no element generates two idempotents. Constant rank implies no two idempotents with corresponding subgroups are ordered (Corollary 2.1), but are pairwise equivalent. The product ef ≡ g of two idempotents need not be idempotent, but g ∈ Ge Gf . So equivalent maximal subgroups yield under set composition a direct product L × R image of S. (c) =⇒ (d): Consider idempotent a and subset aSa = {axa, (x ∈ S)}. Let the idempotent generated by axa be c ≡ (axa)p with period p. Since c begins and ends with idempotent a, we have ac ≡ ca ≡ c, meaning a ≥ c, and in fact a ≡ c, since no strict ordering occurs in a constant rank semigroup. Hence (axa)p ≡ a : axa generates idempotent a for each x, and is thus in Ga . So for each x in constant rank semigroup S, axa is in the max-subgroup containing a, denoted as aSa = Ga . If a, b are two equivalent idempotents, with maximal subgroups Ga and Gb , then the group isomorphism is aGb a = Ga with axa ≡ y, independent of left- or rightor diagonal-equivalence (Lemma 2.7b). (d) =⇒ (e): Constant rank semigroup S contains as many disjoint isomorphic groups Ge as there are idempotents, which are the group identities. These groups form a direct product L × R semigroup (c). So S is either the direct product G × (L × R) or a semi- direct product with a coupling between them, as described in Chap. 3, for which one (leading) component is mapped into the automorphisms of the other (dependent) component. An automorphism is a ‘structure preserving’ mapping (isomorphism, permutation) of a semigroup into itself. Without going into much detail here, the question is which way such coupling can go: from G to L × R or vice versa. It appears that only the first occurs, with group G as leading (independent) component, mapped by a coupling function γ into the group of automorphisms aut(L × R) = aut(L) × aut(R) = F Gm × F Gn . Here F Gm is the full group of all m! permutations of L (of order |L| = m), and similarly F Gn is the full group F Gn of all n! permutations of R (of order |R| = n). Similar to F G3 = C2 |> C3 (see Chap. 3) with one subgroup C3 as dependent component of a cascade decomposition of F G3 and three subgroups C2 yielding leading component C2 , here the multi occurrence of G indicates it to be the leading component of the semidirect product. Moreover, L × R cannot be mapped into aut(G), which is in fact a group, making a coupling from L × R to G impossible by the automorphism coupling mechanism as described in Chap. 3.
2.5 Constant Rank Machines, and Simple Semigroups
27
(e) =⇒ (a): The isomorphic disjoint subgroups Ge of S have identities that are equivalent (not ordered) idempotents of S, all having equal ranks. So S can not have an ideal, hence it is a simple semigroup. Any set A of state transforms that generate a constant rank closure, is a constant rank state machine M(A, Q) with in general closure S = A∗ /Q = G |> (L × R). It is easily verified that Lm has m generators and m + 1 states (see L2, Fig. 2.2) with the function of an m-branch; Rn has n generators and n states with an n-reset function, while group G has a permutation machine as generator with k ≤ |G| states. Then M is represented over m + 1 + n + k states since L, R, G are relative prime (pairwise no common image), and: Corollary 2.3 A general constant rank state machine M has a semi-direct product closure G |> (L × R), thus the composition of machines with closures G, L, R: a permutation machine, a branch machine, and a reset machine. Conclusion: The decreasing-rank basic types of machines: monotone iterative type U and combinational logic type H (Fig. 2.2) need to be included in order to obtain a general structure theory of State Machines (Chap. 4). Also the input and output logic functions, and the logic involved in coupling functions between components (Chap. 3) should be taken into consideration to yield an efficient overall logic design. A new combinational logic synthesis method with planar boolean functions, suitable for VLSI (very large scale integration) implementation in the silicon plane, will be discussed in Chap. 5. In essence, associative algebra and the theory of finite semigroups [4] is translated to state machine language [1–3] and applied to sequential logic synthesis, similar to applying Boolean algebra to combinational logic circuit design (Shannon [9], 1938). This has been tried before [5], but with little practical impact, for the following reasons. Krohn-Rhodes [5, 6] derived in the sixties an automaton decomposition theorem with only permutation and reset components. They appear to apply the known Jordan-Hölder group decomposition theory (1880) [8, p. 64], extended with reset machines, instead of applying semigroup theory. Clearly this does not employ semigroups fully, yielding not a sufficient level of detail for practical purposes. Not just two, but all five basic component types should be used for a natural decomposition, to be derived in the sequel. Moreover, right congruences are shown to suffice for decomposition of any finite group, with subgroups as components (Chap. 3), resp. any finite semigroup (Chap. 4). So even the non-cyclic prime permutation machines, having no full congruence— thus with a ‘simple group’ closure, do have a cascade decomposition into a loopfree network of cyclic groups (Chap. 3). They can be very complex indeed [8, p. 76]. The smallest non-trivial simple group has order 60 (the alternating group A5 of even permutations of 5 states). Clearly they are not useful as practical network components. Contrary to the known automaton theory [5] they can be decomposed, using the group itself as state set, and right congruences as preserved state partitions for cascade decomposition as state machine (Chap. 3, Sect. 3.4).
28
2 Simple Semigroups and the Five Basic Machines
References 1. N. Benschop: “On State Machine Decomposition and the Five Primitives of Sequential Logic”, International Workshop on Logic Synthesis, MCNC, USA, 1987 2. N. Benschop: “Min-Cut Algorithm for State Coding”, International Workshop on Logic Synthesis, MCNC, Research Triangle Park, NC, USA, 1989 3. N. Benschop: “Structure of Constant Rank State Machines”, IFIP Workshop Logic and Architecture Synthesis, 167–176, Paris, 1990 4. A. Clifford, G. Preston: “The Algebraic Theory of Semigroups”, AMS Surv. #7 1, 130–135 (1961) 5. K. Krohn, J. Rhodes: “Algebraic Theory of Machines, Part I”, Trans. AMS 116, 450–464 (1965) 6. A. Ginzburg: “Algebraic Theory of Automata”, Academic Press, New York, 1968 7. A. Suschkewitsch: “Über die endlichen Gruppen ohne das Gesetz der eindeutigen Umkehrbarkeit”, Math. Ann. 99, 30–50 (1928) 8. D.J. Robinson: “A Course in the Theory of Groups”, Graduate Texts in Mathematics, vol. 80, Springer, New York, 1982 9. C.E. Shannon: “Symbolic Analysis of Relay Circuits”, Trans. AIEE 57, 713–723 (1938)
Chapter 3
Coupling State Machines Finite State Machine M(Q, A) with stateset Q and input alphabet A (known as a Moore machine), and its Sequential Closure (semigroup) S = A∗ /Q are introduced, recalling basic principles in theory and practice. State machines with isomorphic closures are defined equivalent. Each finite semigroup S can be represented by at most |S| + 1 states, viz. itself, possibly extended by a left-identity. So state set Q can be expanded to semigroup S to represent M. It is shown that a right congruence of S is sufficient for cascade decomposition of M. This applies also to decompose a permutation machine with a non-cyclic simple group as closure, which is indecomposable by the known Krohn/Rhodes decomposition [6, 7]. As illustration, the smallest non-cyclic simple group A5 of order 60 is decomposed as a state machine network of coupled cyclic groups (periodic counters) of order 2 (twice), 3 and 5.
3.1 Introduction Two state machines may be coupled by a combinational function mapping the state set of one machine, combined with external input, into the input set of the other machine. Three ways of coupling two component state machines into a network of parallel operating machines (Fig. 3.1) are: • no coupling or ‘independent’ composition (direct product) • one-way coupling or ‘cascade’ composition (coupled product) • both-way coupling or ‘loop’ composition (loop product) Natural decomposition of a state machine depends on an algebraic property of its sequential closure, in order to hold for all possible input sequences. Such property is called a ‘congruence’ on the semigroup (seq. closure), or ‘preserved partition’ of the state set representing the machine’s behavior [5]. Qua concept, a congruence resembles a ‘divisor’ of a natural number, and a sub(semi)group compares to an additive ‘term’. They represent respectively the independent and dependent machine component of a cascade. Loop composition turns out to be superfluous, and in fact is undesirable for practical engineering purposes, since it requires more coupling logic than necessary. A loopfree composition suffices in all cases, applying the first two types of coupling, of which the second (cascade coupling) is required only for non-commutative systems, illustrated by some typical examples: (a) the semigroup Z10 (.) of multiplication mod 10, (b) the ‘symmetric group’ S3 of all six permutations of 3 states, and S4 of the 24 = 4! permutations of 4 states. (b ) the smallest noncyclic simple group: ‘alternating group’ AG5 of all 60 even permutations of 5 states. N.F. Benschop, Associative Digital Network Theory, © Springer Science + Business Media B.V. 2009
29
30
3 Coupling State Machines
Krohn/Rhodes’ theory [6] of 1965 claims that non-cyclic simple groups are indecomposable components (as indeed they are in Jordan-Hölder’s group decomposition), while it is shown here that they can be decomposed into a network of coupled cyclic groups cq. permutation machines. This incompleteness aspect of their theory went unnoticed the past four decades, explaining the absence of recent references.
3.2 No Coupling: Semigroup Z(.) mod m, Composite m Residue multiplication (mod 10)—or semigroup Z10 (.)—can be viewed as the sequential closure of a state machine M(Q, A) with 3 inputs (set A) and 6 states (set Q), and Qx ⊆ Q for each input or input-sequence x, in set notation: QZ10 ⊆ Q. Rather than a square 10 × 10 table of all pair compositions, its ‘iterative diagram’ with ordered idempotents better reveals its structure, as depicted in Fig. 3.1. Input interpretation: a = 7, b = 6, c = 5, aa = 9, bb = 6, cc = 5 and 4-cycle subgroup C4 = {a ∗ } ≡ {7, 9, 3, 1} (mod 10). The four idempotents e2 ≡ e : {0, 5, 6, 1} form a Boolean lattice of order 22 = 4, corresponding to the two binary properties: divisible or not by 2 resp. 5. Commuting idempotents can be ordered (Sect. 2.2.2): e ≥ f whenever ef = f e = f , thus: e is left and right identity for f , drawn in a diagram with e above f if e > f . Clearly this satisfies the three conditions for an ordering relation: reflexive, anti-symmetric and transitive [1]. Odd and even subsemigroups {7∗ , 5} ∼ = {2∗ , 0} ∼ = Z5 (.) map ‘structure preserving’ into each other by the additive transformation x → x + 5 for all x ∈ Z10 , which is an additive auto-morphism of Z10 (.) with (x.y) + 5 ≡ (x + 5).(y + 5) mod 10. In fact 5 is the lowest odd idempotent in Z10 (.) and as such its only additive automorphism. More generally: Consider Z2h (.) ∼ = Z2 × Zh for any odd h > 1, consisting of two disjoint and isomorphic subsemigroups, odd and even. They map into each other by adding h. The lowest even idempotent is 0. And h, as odd image of 0, is the lowest odd idempotent, with (a + h)(b + h) ≡ ab + h for all residues a, b ∈ Z2h [odd h]. In fact:
Fig. 3.1 Closure Z(.) mod 10. Machine M(Q, A) : Q × A → Q
3.2 No Coupling: Semigroup Z(.) mod m, Composite m
31
Fig. 3.2 Three-component decomposition of multiplication mod 10
Lemma 3.1 Z2h (.) has just one additive automorphism (a + h)(b + h) ≡ ab + h where h is the lowest odd idempotent h2 ≡ h mod 2h. Proof If a, b are in Z2h {even} or in Z2h {odd} then a + b is even in either case, and (a + b)h ≡ 0 (mod 2h). Hence (a + h)(b + h) ≡ ab + (a + b)h + h2 ≡ ab + h. With h as the lowest odd idempotent of Z2m (.) it is readily verified that no other idempotent has this property. Not surprisingly Z10 = Z2 × Z5 is the direct product of two components Z2 (.) and Z5 (.) which are implemented by two parallel unconnected component machines M2 and M5 . The respective transition tables are similar to: Boolean 2-input AND as multiplier mod 2 (xy = 1 iff x = y = 1), and a 4-counter C4 ∼ = Z(+) mod 4, adding the corresponding exponents of 2 resp. 7, which essentially is logarithmic multiplication with base 2 resp. 7. Eventually this yields the next efficient three-component code (Fig. 3.2) for the ten digits of a residue multiplier (mod 10): The six codes: [Q1 , Q2 , Q3 ] = [{1, 2, 3}, 0, {0, 1}] of the 16 available codes are not used. The odd and even subsystems have third component Q3 equal to 1 and 0 respectively. Product computation occurs component wise, for instance 3.8 = [3, 1, 1].[3, 1, 0] = [3 + 3, 1.1, 1.0] = [2, 1, 0] = 4. Notice the left-to-right asymmetry in this representation, due to the ‘time’ sequencing aspect of the next-state function. This is a generative description of multiplication Z(.) mod 10, with generator set A = {a, b, c} = {7, 6, 5} where a has period 4, while b and c have period 1 (idempotent) with target state sets Qa = {2, 4, 8, 6, 5, 0} and Qb = {2, 4, 8, 6, 0} while Qc = {5, 0}, with orderings Qa ⊃ Qb and Qa ⊃ Qc. Idempotents can be considered as the ‘invariants’ of a system, essentially defining its static combinational structure. Let Qa be the set of ‘target states’ under input a, and |Qa| its order, called the rank of a, then a fundamental property—reminiscent of the concept of nondecreasing entropy in physics—was shown to hold (Lemma 2.1): Rank does not increase under input sequencing, hence |Qab| ≤ min{|Qa|, |Qb|}. Contrary to a group (of permutations), a semigroup (of transformations) in general does allow reducing rank, with time irreversible state-machine behavior where |Qa| < |Q| for some input a. In a group of permutations, which all have equal rank, composition preserves rank. In physics this would be referred to as a ‘conservative system’, energy preserving, with behavior reversible in time. There are in fact three types of such constant rank systems (machines resp. semigroups), each with
32
3 Coupling State Machines
a clear engineering interpretation (L, R, C): Left-copy semigroup ab = a (branch), Right-copy semigroup ab = b (set-reset machine or D-flipflop) and Cyclic (periodic) Semigroup a n+1 = a (n counter). Z10 (.) is represented over state set Q = {2, 4, 8, 6, 5, 0} which itself is a closed subset, or subsemigroup, of Z10 (.) with closure Q2 ≡ Q, and ZQ ≡ QZ ⊆ Q, hence Q acts as a generalized multiplicative zero, called an ideal of Z10 , and input set A is a generating subset or -alphabet of Z10 . As exercise, draw the iterative and combinational (idempotent) structure of Zm (.) for m = 2 to 16, similar to Fig. 3.1. It appears that input set A and state set Q of machine M(Q, A) are both ‘embedded’ into its closure (semigroup) S, symbolically written S = A∗ /Q. This provides a way of ordering or comparing machines by their closure, which is the main aspect relating associative (semigroup) algebra to the structure of sequential machines. Hence: Definition 3.0 Two machines M1 (Q1 , A1 ) and M2 (Q2 , A2 ) are equivalent iff they have isomorphic closures: S1 ∼ = S2 . Recall this means there is a mapping α of S1 one-to-one onto S2 which preserves structure: α(xy) = α(x)α(y). So the image of a sequence is the sequence of images. And machine M2 is considered ‘smaller’ than machine M1 if S2 ⊂ S1 : closure S2 of M2 is properly contained in S1 . Definition A simple semigroup is a semigroup without proper ideal. The first paper on the detailed structure of finite simple semigroups is the PhD thesis of Suschkewitsch [3, 4], described here as constant-rank state machines. The characteristic features of Z10 (.) are a Boolean sublattice of four idempotents, and two cyclic subgroups of order 5 − 1 = 4. Conversely, any state machine with these closure features is essentially a residue multiplier (mod 10). More generally: Let m have k distinct prime divisors pi then Zm (.) contains as subsemigroup a Boolean lattice of 2k idempotents, since divisibility by pi yields k binary properties, invariant under multiplication.
The idempotents are ordered according to their corresponding sets of prime divisors. For instance Z30 (.) has a lattice of 23 = 8 idempotents according to divisors 2, 3 and 5, shown in the next lattice diagram (Fig. 3.3). Note: Each complementary idempotent pair in Zm (.) has sum 1 mod m for any modulus m > 1, which crucial additive property is derived later. C6 ∼ = Z6 (+), generated by 1 under addition mod 6, represented by 5 states. State set Q in reference order [1, 2, 3, 4, 0] is permuted in a 2- and 3-cycle by generator a = [2, 1] [4, 0, 3] yielding six distinct permutations upon iteration. The next table (Fig. 3.4) depicts a cyclic group of order six: Recall the Chinese Remainder Theorem which implies: the period of a permutation consisting of disjoint and coprime cycles equals the product of these cycle orders. So for distinct primes pi and m = pi follows:Cm has one generator, dim(C5 ) = 1 (re: Theorem 2.1), and is represented over pi states: for m = 6 = 2.3 the minimum num-
3.2 No Coupling: Semigroup Z(.) mod m, Composite m
33
Fig. 3.3 Boolean lattice of the 23 idempotents in Z30
Fig. 3.4 Cyclic structure of addition mod 6, over 2 + 3 states
ber of states is degree(C6 ) = 5. In general the period is the least common multiple lcm(mi ) of disjoint mi -cycles. In practical terms: cyclic group Cm which is the direct product of coprime cyclic groups, requires for its representation just one generator, and the hardware cost |Q| is the sum of these state-cycle periods. In general: Interpretation: Let synthesis of state machine M involve the factoring of its sequential closure SM , with component closures S |Si |. Then represeni and |SM | = tation of M requires the sum of state set orders |Qi | in its network decomposition of (coupled) component machines Mi (Qi , Ai ): • Sequential behavior has a closure proportional to the product of component behaviors, and the hardware is proportional to their sum. Condition |SM | = |Si | is desirable, and indeed often possible, but proper embedding SM into a product of component closures with |SM | < |Si | cannot always be avoided. For instance Z10 ∼ = Z5 × Z2 (Fig. 3.2): further decomposition Z5 (.) ⊂ C4 × Z2 (.) uses five of the available eight codes, namely [2, 1] [4, 1] [3, 1] [1, 1] briefly denoted [2, 4, 3, 1; 1] or [2∗ ; 1] mod 5, while the remaining four codes [2, 4, 3, 1; 0] ≡ [2∗ ; 0] are equivalenced by a Boolean function, mapping them onto one code [1; 0]. The five-part partition [2, 1] [4, 1] [3, 1] [1, 1] [2∗ ; 0] yields a congruence, since by inspection for each a ∈ C4 × Z2 (.): x ≡ y implies ax ≡ ay and xa ≡ ya, with image semigroup Z5 (.). So each congruence part maps into just one congruence part under left and right composition by any element. It suffices to test this for generators
34
3 Coupling State Machines
of C4 × Z2 (.), such as [2, 1] and [2, 0] which in fact map part [2∗; 0] into itself— functioning as zero of Z5 (.). Distinct primes pi with product m = mk = p1 · · · pk are known [1] to yield direct product of coprime components Zmk (.) ∼ = Zp1 (.) × · · · × Zpk (.). Prime pi induces a subcycle (cyclic subgroup) or periodic counter of order pi − 1 (Fermat’s Small Theorem 1637). The direct product of cycles ×i Cpi −1 is a subgroup with identity 1, the group of units in Zmk (.) consisting of all elements generating 1 upon iteration, thus coprime to mk . If pi has exponent ei > 1 then a monotone counter of length ei − 1 with a final state is induced, e.g. 2∗ (mod 23 ): {2, 4, 0, 0, 0, . . .}. All elements that upon iteration generate 0 are the divisors of zero Zm (.) as opposed to the group of units of Zm (.) generating identity 1. They form the ‘nilpotent’ subsemigroup Nm of Zm (.), an ideal of Zm since Nm .Zm ≡ Zm .Nm ≡ Nm (mod m). Of the five basic component types only the three commutative basic structures: periodic and monotone iteration classes or ‘counters’, and ordered commuting idempotents, can occur in arithmetic and commutative semigroups in general. The remaining two non-commutative basic components are of memory type: the set-reset flipflop as binary register element, in software known as assignment statement y := x copying input x to output y (at the moment of a clock edge), and the branch (if-then-else or case statement). As a main result of this approach by “factoring its sequential closure”, any finite state machine is shown to have an efficient network decomposition in terms of these five basic component types of sequential behavior.
3.3 Machine Decomposition: Right Congruence Suffices Generative state machine representation of semigroups causes a sequential asymmetry of time, resulting in a right congruence as preserved state partition [5], to be shown sufficient for inducing a cascade decomposition. This applies also to closures without a full congruence such as non-cyclic simple groups, which do have subgroups and as many right congruences. In fact each subgroupH ⊂ G defines, by equivalencing it, a unique r-congruence of disjoint right cosets H x (x ∈ G) [2, p. 31]. Notice to each subgroup H ⊂ G of a ‘simple group’ G = {gi }∗ corresponds a left- and right congruence pair that is orthogonal, so: Hgi ∩ gi H ≡ gi for generators gi . Notation: A∗ is the (infinite) set of non-empty strings over alphabet A, and A∗ /Q is the generated (finite) closure of distinct transformations of Q, with the next equivalence in A∗ : x ≡ y (mod Q) iff
qx = qy
for all q ∈ Q.
Hence two input strings are equivalent if they have equal effect on machine M. Quantification and optimization are dominant aspects of engineering, so the next concepts are relevant for practical synthesis of sequential machines:
3.3 Machine Decomposition: Right Congruence Suffices
35
Definition 3.1 The dimension of machine M(Q, A) is the smallest number of generators of its closure SM = A∗ /Q: dim(M) = dim(SM ) = |A|min . Definition 3.2 The degree of M and SM is the smallest number of states to represent SM by distinct state transforms: deg(M) = deg(SM ) = |Q|min . For example dim(C6 ) = 1 with deg(C6 ) = 5 (the sum of its coprime factors 6 = 2.3), and the full group FG3 of all six permutations of 3 states has: dim(FG3 ) = 2 and deg(FG3 ) = 3. Although FG3 is represented over only 3 states, its decomposition as a coupled network of two cycles C2 and C3 (see next section) is possible by expanding state set Q to the group itself. Lemma 3.2 Each finite semigroup S can be represented by a state machine of at most |S| + 1 states. Proof A semigroup S can act as state set Q = S for its representation by a state machine if the square |S| × |S| composition table of S has distinct columns, so for each pair x ≡ / y ∈ S: qx = qy ∈ S for some q ∈ S. If equal columns do occur, as for instance in a left-copy semigroup: ab ≡ a for all a, b ∈ S then only one extra state q0 (as left identity) suffices to obtain distinct columns, while preserving semigroup structure, by defining q0 x ≡ x for all x ∈ S, with Q = {S, q0 } hence |Q| = |S| + 1. If a state set Q of less than |S| states represents S, so |Q| = deg(S) < |S|, then there is a right congruence ρ on S, and parts S/ρ are the states in Q. Definition 3.3 A defining right congruence δ of S has |S/δ| = |Q| = deg(S) parts, which function as the states of a representation of S over Q. By the left-to-right asymmetry of state-transform composition (input sequencing), the state machine representation of a semigroup S implies: Lemma 3.3 Let δ be a defining r-congruence of semigroup S, then: a r-congruence ρ > δ induces a cascade decomposition of S. Proof Let subset A generate S, and machine M(Q, A) has closure S, represented over state set Q = S/δ with |Q| = deg(S). Then a right congruence ρ > δ on S, with q ≡ r ∈ S iff qa ≡ ra (mod ρ) for all a ∈ A, is a preserved state partition. The corresponding cascade decomposition of M(S, A) has Q1 = S/ρ as state set of leading component M1 (Q1 , A1 ) with |Q1 | < deg(S). Input set A1 = A/ρ equivalences inputs of A that induce the same Q1 transformation in M1 , thus: a ≡ b ∈ A (mod A1 )
iff
qa ≡ qb ∈ Q1 (mod ρ)
for all q ∈ S.
In other words, all states in the same ρ-part map under any input into the same ‘next-state’ ρ-part. Hence ρ is a preserved partition, and the ρ-parts represent the
36
3 Coupling State Machines
component states in Q1 = S/ρ of image machine M1 (Q1 , A1 ) with input set A1 = A/ρ. In case one extra initial state q0 is required (Lemma 3.2) for true representation of S by M(Q, A)—where Q = {S, q0 }—then ‘right-congruence’ of S is replaced by ‘preserved partition’ of Q. • So a full (left- and right-) congruence is not needed for cascade decomposition, contrary to the known automaton decomposition of Krohn–Rhodes [6]. This allows simple groups, with no full congruence resp. normal subgroup, to be decomposed as permutation machine (Sect. 3.4). Denote the ρ-part of state q by ρ(q) = q1 : the first component of some state coding. Then the preserved property of the r-congruence ρ is expressed by: q1 a = (qa)1 for all a ∈ A. In other words, under any input a the ρ-part q1 of any state q maps into the ρ-part of its next state qa, so: ρ(qa) = ρ(q)a
for all q ∈ Q and all a ∈ A.
Let ρ(a) denote the corresponding ρ-part a1 of input a, with equivalence: ρ(a) = ρ(b)
for a, b ∈ S
a1 = b1 ⇐⇒ q1 a ≡ q1 b
defined by: for all q1 ∈ Q1 .
Then by associativity of input- resp. transform composition in S = A∗ /Q: ρ(qx) ≡ ρ(q)ρ(x) for all q ∈ Q, x ∈ S.
(3.1)
This composition property is a right-congruence, in other words a preserved state partition [5], sufficient for cascade machine decomposition. In a commutative system S the r-congruence yielding an image system S1 , resp. leading machine component M1 , is also l-congruence, hence a full congruence. For instance Z10 (.) is represented over 6 states with defining congruence ρ : {2 = 7, 4 = 9, 8 = 3, 6 = 1; 5; 0} given by two subsemigroups Z5 = {2, 4, 8, 6; 0} and Z2 = {5; 0}, with Z10 ∼ = Z5 × Z2 . The next examples illustrate several essential concepts, like independent- and dependent component in a cascade decomposition, and the coupling between them, as related to algebraic properties of their closure.
3.4 Cascade Composition: Full Groups FG3 and FG4 Recall a group Gn of permutations of n objects (states) is an associative closure with just one idempotent element e, the group identity [1, 2]. And each element a ∈ Gn has a unique inverse a −1 with respect to e such that aa −1 = a −1 a = e. For finite n the iteration class a ∗ of all iterations a i of a is a cyclic subgroup of
3.4 Cascade Composition: Full Groups FG3 and FG4
37
Fig. 3.5 State machine MFG3 generating the full group FG3 of order 6
Gn : dim(a ∗ ) = 1. Iterations a i must eventually yield a m+1 = a for some m ≤ |Gn |, hence a m = e with inverse a −1 = a m−1 , and m is the order (or period) of a in Gn . There are n! = ni=1 i (n factorial) permutations of n states, usually referred to as the ‘symmetric group’ Sn of degree n. However, in this context S is reserved for ‘semigroup’ and Sylow p-subgroup, so the term full group FGn is preferred. Consider full group FG3 of all 6 permutations of 3 states, generated by two permutations a and b of order 3 and 2. This group is isomorphic to the group of symmetries of an equilateral triangle, thus with sides of equal length. The three states 1, 2, 0 then represent the three corners, and permutation a in the next table maps {1 → 2, 2 → 0, 0 → 1}, a rotation of 120◦ generating a 3-cycle: a 3 ≡ e. Figure 3.5 shows state machine transition table MFG3 (Q, A) with Q = {1, 2, 0}, input alphabet A = {a, b} and the permutations of Q, noted as columns, generated by all input sequences A∗ over A. The sequences over A of increasing length k are lexically generated by recursive prefixing: Ak+1 = A Ak = {aAk , bAk }. For the resulting Q-transforms, simply copy the rows of Ak to positions of Ak+1 indicated by A, thus implementing function composition q(xy) ≡ (qx)y for all x, y ∈ A∗ , q ∈ Q. In the example: A3 ≡ A ∪ A2 (mod Q), meaning that strings of length 3 produce no new permutations of Q. Hence none are produced by longer strings, completing the generation process of group FG3 . Clearly FG3 is non-commutative since ab ≡ / ba, in fact arithmetically: ab ≡ ba + 1 mod 3. Notice transformation a : q → q + 1 (mod 3) for each q ∈ Q. So a ∗ has the structure of Z(+) mod 3 with Q = {1, 2, 0} as residues, denoted a ∗ /Q ∼ = Z3 (+), or briefly: 3-cycle C3 ∼ = a ∗ /Q. And b swaps 0 and 1 while fixing state 2, in effect b∗ /Q ∼ = Z2 (+) ∼ = C2 . For known context the notation /Q, or mod Q, may be omitted if no confusion arises. Now deg(FG3 ) = 3 with defining r-congruence δ : {b ≡ e, ba ≡ a, ba 2 ≡ a 2 }, generated by the right consequences of equivalence b ≡ e, thus equivalencing subgroup C2 , right-composed by the iterations a i of a. This 3-state model of FG3 has no preserved state partition, verified by equivalencing any state-pair and noting the right consequences by comparing the two corresponding rows position wise. Then all states are equivalenced as a trivial one-part r-congruence. In fact: • representation over a minimal state set hides structural decompositions.
38
3 Coupling State Machines
Fig. 3.6 Iterative and arithmetic coupling structure of full group FG3
Taking FG3 itself as state set shows a r-congruence ρ : {a ∗ , [a ∗ ]b}, yielding a cascade network of two coupled cycles, with r-image C2 = FG3 /ρ as independent— and subgroup C3 as dependent component, seen as follows. The three elements of period 2, namely b, ab, ba (fixing state 2, 0, 1 respectively) form with identity e three subgroups C2 of order 2 (Fig. 3.6). While a and a 2 of period 3 form with e one subgroup C3 . Equivalencing a ≡ a 2 ≡ e yields, upon right composition by b, the equivalences ab ≡ a 2 b ≡ b, where a 2 b ≡ ba. These two parts a ∗ = [a, a 2 , e] and [a ∗ ]b = [ab, ba, b] form a congruence ρ with corresponding rimage group FG3 /ρ ∼ = C2 . The two ρ-parts behave as states in the 2-cycle of leading machine component C2 d. To model the non-commutativity of FG3 , the coupling function between these two components is found by first considering their direct product C2 × C3 . Then permute component C3 internally by an automorphism α : C3 → C3 into a dependent component [C3 ] of the same structure. This way the total number of product elements remains the same, while the (coupling-) twist implements the noncommutative structure of G = FG3 . Associativity q(xy) = (qx)y ∈ Q = G for all q, x, y ∈ G follows from the two components in G = G1 |> G2 , having element codes q = [q1 , q2 ], x = [x1 , x2 ], y = [y1 , y2 ] with {q1 , x1 , y1 } ∈ G1 and {q2 , x2 , y2 } ∈ G2 . Leading component G1 behaves independently from the second (dependent) component G2 , so the associative property of G is preserved in its image G1 , and only the second component needs verification. Denote as αx1 the automorphism G2 → G2 induced by a particular first compo−1 nent value x1 , and similarly define αy1 . The twisted x2 and y2 are x2 = αx1 x2 αx1 −1 and y2 = αy1 y2 αy1 . Then associativity of the coupled network follows from: −1 −1 q(xy) 2 = q2 x2 y2 = q2 αx1 x2 αx1 αy1 y2 αy1 = (q2 x2 )y2
(3.2)
because q2 , x2 , y2 as elements of G2 compose associatively. The coupling from C2 to C3 is established by identifying each element of C2 with an automorphism of C3 = {1, 2, 0} of which there are two namely α : [swap(1, 2), fix(0)] and identity mapping α 2 = : fix(1, 2, 0). Such coupling map: C2 → aut[C3 ] can be chosen in various ways. For instance the trivial map of C2 onto the identity of aut[C3 ], hence no ‘twist’ and in effect no coupling, yields the direct product as special case.
3.4 Cascade Composition: Full Groups FG3 and FG4
39
Fig. 3.7 Symbolic and coded composition tables of FG3
Note: Distributive property (a + b)c = ac + bc of multiplication mod m represents the semigroup of all endo-morphisms of addition mod m, so: Zm (.) ∼ = endo[Zm (+)]. The auto-morphisms of Zm (+) ∼ = Cm are the invertible endomorphisms. So the units group of Zm (.) consists of all residues coprime to m, operating as multipliers (mod m) on residues in Zm (+). By C3 ∼ = Z3 (+) and endo(C3 ) ∼ = Z3 (.) the subgroup C3 = {1, 2, 0} ∼ = {a, a 2 , e} 2 of FG3 has automorphisms α : {swap(1, 2), fix(0)} and α = : fix(1, 2, 0) which form the cyclic group C2 ∼ = {α, α 2 } of order 2. The coupling function swaps 1 and 2 (a and a 2 ) in C3 to obtain twisted dependent component [C3 ] in semi-direct product, or ‘coupled product’ FG3 ∼ = C2 |> C3 , with coupling γ : C2 = [1, 0] → aut(C3 ) = {α, }. Notice baa ≡ ab, aba ≡ b, aab ≡ ba, bab ≡ aa, with 2-component codes: a = [0, 1], ab = [1, 1],
a 2 = [0, 2], ba = [1, 2],
e = [0, 0] and b = [1, 0].
Similar to direct product C2 × C3 for cyclic group C6 , composition of elements in FG3 is done component wise, but now using twisted [C3 ] , denoted C2 |> C3 with coupling map γ : C2 → aut[C3 ], called semidirect- or coupled product of semigroups, or cascade composition of state machines. Notice coupling map [swap(1, 2)fix(0)] mod 3 is a multiplication by 2 (mod 3) in C3 if the C2 component x1 = 1, and uncoupled (direct) composition z2 ≡ x2 + y2 (mod 3) with C2 component x1 = 0. In summary, this method couples two groups: G1 |> G2 ∼ = G where G is the sequential product G = G1 G2 of two orthogonal subgroups G1 and G2 : G1 ∩ G2 = e, with coupling γ : G1 → aut(G2 ) mapping image G1 /γ to a subgroup of aut(G2 ).
40
3 Coupling State Machines Essential is to notice that a full congruence on G is not required for its decomposition. A right-congruence, hence a subgroup, suffices.
• Notice in product G = G1 G2 of orthogonal groups G1 and G2 (intersecting only at e) the multiplicity of one factor, as subgroup Gi ⊂ G, is the order |Gj | of the other, and 1 for the other factor Gj as subgroup of G. So either G1 occurs |G2 | times in G, and G2 just once, or v.v. In both cases the total order is |G| = (|G1 | − 1)|G2 | + |G2 | = (|G2 | − 1)|G1 | + |G1 | = |G1 ||G2 |. Due to Zn (.) ∼ = endo(Cn ), the coupling Cm |> Cn of two cycles requires: Cm /γ ⊆ units group of Zn (.) ≡ aut(Cn ) for some (possibly trivial 1-1) congruence γ of Cm . So for prime cycles Cp |> Cq (primes p < q): p must divide q − 1. This is the basis of a completely arithmetic model of permutation machines, viz. sequential behavior with a group as closure. Recall to each subgroup H ⊂ G of a finite group G corresponds a unique r-congruence ρ(H ): equivalence all elements of H , then the right consequences yield the r-cosets H x of H in G, forming the parts of ρ(H ) [2, p. 10]. Consider finite group G = H K of composite order as sequential product of subgroups H and K, where H ∩ K = e, the identity of G. So each x ∈ G has form x = hk for a unique pair h ∈ H, k ∈ K, both in G. Right congruence ρ(H ) and left congruence λ(K) are orthogonal, with each element of G determined by its ρ- and λ-part. Such product always exists, since a group G of composite order has a proper subgroup H ⊂ G, generating r-congruence ρ of disjoint r-cosets H x, orthogonal to λ(K) of left-cosets xK generated by subgroup K with one element in each ρ(H )-part, and vv. (CP): Coupled Product of permutation machines. Let permutation machine MG generate product group G = H K (subgroups H, K ⊂ G) with H ∩K = e. Then G is a coupled product G = H |> K, with cascade machine composition MG = MH |> MK , if a coupling map γ : H → aut(K) exists, permuting K into K ∼ =K by: k = γh (k). Here γ maps (not nec. 1-1) image group H /γ onto a subgroup of aut(K). ∼ Zp (+) and Lemma 3.4 Composing prime-order cyclic groups Cp |> Cq : Cp = Cq ∼ = Zq (+) (primes p < q) have a non-trivial coupled product (CP) via γ : Cp → aut(Cq ) ∼ = Zq (.)\0 ∼ = Cq−1 iff p|(q − 1). ∼ Cq−1 , and h ∈ Cp has image Proof Coupling function γ maps Cp into aut(Cq ) = γh = h ∈ aut(Cq ) which as multiplier k = kh (k, k in Cq ) represents an automorphism of Cq . Since prime cycle Cp has only itself as non-trivial image group Cp /γ = Cp it follows that coupling requires p to divide q − 1. Conversely p|(q − 1) allows γ : Cp → aut(Cq ) ∼ = Cq−1 for coupling purposes. Corollary 3.1 For primes p < q, with p not dividing q − 1, two cyclic components Cp and Cq cannot be composed into a non-commutative group by a coupled product (CP) in either direction. The only possible composition is direct product G ∼ = Cp × Cq ∼ = Cpq , which is cyclic and commutative.
3.5 Decomposing the Full- and Alternating Group over Four States
41
3.5 Decomposing the Full- and Alternating Group over Four States The full group FG4 of all 24 = 4! permutations of 4 states Q = [1, 2, 3, 0] requires only 2 generators of periods 4 and 2, as shown in Fig. 3.8a. Only irreducible ‘new’ strings are used for extension from Ak to Ak+1 . Counting the number of new elements ( ˆ ) per Ak yields a generative spectrum [2, 4, 5, 5, 5, 3] characteristic for FG4 . Their sum is the group order. Definition 3.4 In group G/Q the stabilizer Vq of state q ∈ Q consists of the transformations fixing state q; they form a subgroup of G. By symmetry: all n stabilizers of FGn have order (n − 1)! and are isomorphic to FGn−1 . The intersection of two stabilizers fixes the union of their fixed states.
Fig. 3.8 State machine MFG4 generating full group FG4 = (a, b)∗
42
3 Coupling State Machines
In FG4 each stabilizer Vq ∼ = FG3 has order 6, which occurs four times. For instance state 0 is fixed by {ab, e, x, r, m, n} = V0 ∼ = FG3 (Fig. 3.8a) where e ≡ bb, x ≡ (ab)2 , r ≡ aaaba ≡ a −1 ba, m ≡ aabaa, n ≡ baaab with identity e, while ab, x have period 3 (fixing 0), and r, m, n have period 2. The defining r-congruence δ of FG4 is formed by the r-cosets of any stabilizer, say V0 ∼ = FG3 with δ = {V0 , V0 a, V0 a 2 , V0 a 3 } and a ∗ /Q ∼ = C4 . Note: By the stabilizer concept and induction, each finite full group FGn over |Q| = n > 2 states is generated by only two permutations a, b of periods n and 2, with a ∗ /Q ∼ = Zn (+) ∼ = Cn , and b = [swap(0, 1), fix(other states)] hence b∗ /Q ∼ = n 2 C2 and a ≡ b ≡ e. In coupled product FG3 = C2 |> C3 image C2 ∼ = FG2 occurs three-fold as stabilizer of the three states representing FG3 (Figs. 3.5, 3.6). Similarly, four-fold stabilizer FG3 in FG4 yields coupled product FG4 = FG3 |> C4 . Coupling map γ : FG3 → aut(C4 ) ∼ = C2 uses image FG3 /γ ∼ = C2 of even and odd permutations, the latter activating −1 ∈ Z4 (.) as multiplier of the C4 component to obtain its twisted version [C4 ] , with resulting: cascade decomposition: FG4 ∼ = (C2 |> C3 )|>γ C4 .
(3.3)
In the corresponding three-component code x = [x1 , x2 , x3 ] for each of the 24 elements x ∈ FG4 , the respective component values are taken mod 2, mod 3 and mod 4, hence from: {0, 1}, {0, 1, 2} and {0, 1, 2, 3}. To comply with this threefold structure, it is useful to consider also three generators, rather than the two that are necessary and sufficient. This better matches the recursive generation process based on sequential product FGn+1 = FGn Cn+1 = Cn+1 FGn for any number n of states, with FGn as stabilizer of extra state n + 1. States and inputs are renamed for this purpose (Fig. 3.8b). State space [1, 2, 0] of FG3 is expanded to [1, 2, 3, 0] for FG4 by one extra state ‘3’. This new state is fixed by both generators a, b of orders 2 and 3 respectively, where a = [swap(0, 1) fix(2, 3)] and b = [cycle(0, 1, 2) fix(3)]. Notice permutations a, b have the same structure as in FG3 , however with one extra fixed state ‘3’. A third generator is full 4-cycle c which has the effect of generating FG4 with shorter string lengths, as depicted in Fig. 3.8b, with e ≡ a 2 ≡ b3 ≡ c4 and generative spectrum [3, 9, 12]. Reducible strings are marked by ‘x’, and a fixed state q by ‘q (C2 × C2 )
C3 hence eight elements of order 3, each pair per C3 (each others inverse) fixes one state (marked ‘q (C2 × C2 ) of independent component C3 coupled into dependent component C2 × C2 , similar to FG3 = C2 |> C3 with three subgroups C2 and one C3 . Apparently, if to a sequential product of groups G1 G2 = G2 G1 = G corresponds a coupled cascade product, then: In a cascade product G = G1 |> G2 of two groups, the dependent component G2 occurs once as subgroup of G, and the independent component G1 as subgroup of G has multiplicity |G2 |.
The coupling function γ : C3 → aut(C2 × C2 ) maps leading C3 1-1 into the symmetries (automorphisms) of the dependent C2 × C2 , coded as follows. The 3-component code of each group element x = [x1 , x2 , x3 ] is based on the three generators producing cyclic subgroups a ∗ = C3 , b∗ = C2 , c∗ = C2 as residues in Z(+) mod 3, mod 2, mod 2 resp., with unit code-vectors: a = [1, 0, 0],
b = [0, 1, 0],
a 3 ≡ b2 ≡ c2 ≡ e = [0, 0, 0],
d = [0, 0, 1],
and
a 2 ≡ a −1 = [2, 0, 0],
bd ≡ db = [0, 1, 1].
Component-wise addition produces direct product G = C3 × C2 × C2 of order 12 as reference, and a i bj ck has code [i, j, k] mod (3, 2, 2). Mapping γ : C3 → aut(C2 × C2 ) models the non-commutative behavior of AG4 . In a sequential composition xy this coupling x1 to [x2 , y2 ] is active if x1 ≡ / 0 mod 3, and disabled if x1 ≡ 0 mod 3. The four codes [x2 , x3 ] of C2 × C2 are [1, 0] [0, 1] [1, 1] [0, 0] or in compact notation: 10, 01, 11, 00, with component-wise addition mod 2. The three non-zero codes are equivalent: the product of any pair yields the third element. Hence its automorphism group is FG3 with C3 as subgroup representing a 3-cycle rotation α of the three non-zero (b, d, bd) with α 3 ≡ α 0 ≡ the identity transformation, for instance in compact notation: α : 01 → 10 → 11 → 01 and α(00) = 00 (fixing code 00),
with:
coupling map γ : x1 = {1, 2, 0} → {α, α , } = C3 ⊂ aut(C2 × C2 ). 2
44
3 Coupling State Machines
The 3-component code for group AG4 , over 3 + 2 + 2 = 7 states, yields the next arithmetic model of its cascade decomposition AG4 = C3 |> (C2 × C2 ): [x1 , x2 , x3 ][y1 , y2 , y3 ] → [z1 , z2 , z3 ], where: z1 ≡ x1 + y1 mod 3,
coupled by x1 (mod 3) to:
z2 ≡ α (x2 + y2 ) mod 2, x1
z3 ≡ α x1 (x3 + y3 ) mod 2. If leading component C3 is in zero state x1 ≡ 0, then coupling α 0 ≡ is not active, resulting in uncoupled component-wise addition of x and y. Rotation α(01) = 10, α(10) = 11, α(11) = 01, α(00) = 00 is applied 0, 1 or 2 times as α x1 to direct sum [x2 + y2 , x3 + y3 ] mod(2, 2). This implements the automorphism (permutation) of dependent component C2 × C2 , arithmetically modeling the non-commutative behavior of AG4 . For instance ac ≡ ba ≡ / ab (Fig. 3.9) is verified in this ‘3-code’ as follows: ac = [1, 0, 0][0, 0, 1] = [1, α 1 (0, 1)] = [1, 1, 0] and: ba = [0, 1, 0][1, 0, 0] = [1, α 0 (1, 0)] = [1, 1, 0] ≡ ac
(see Fig. 3.9)
ab = [1, 0, 0][0, 1, 0] = [1, α (1, 0)] = [1, 1, 1] ≡ / ba.
Moreover:
1
ca = [0, 0, 1][1, 0, 0] = [1, α 0 (0, 1)] = [1, 0, 1] ≡ / ac. The structure of AG4 shows a generalization of Lemma 3.2. Denote the direct product Cq × Cq × · · · × Cq (k times) briefly as [Cq ]k , and let q be prime. Using a k-component code, the k unit vectors form a necessary and sufficient set of generators, so dim([Cq ]k ) = k while deg([Cq ]k ) = kq. Recall [0, 1] and [1, 0] generate [C2 ]2 , or alternatively [0, 1] and [1, 1], or [1, 0] and [1, 1]. Generalizing this, any subset of k non-zero codes that covers each unit vector or some non-zero multiple of it (any one of the q − 1 non-zero elements of Cq generates Cq ) also generates [Cq ]k . There are q k − 1 non-zero k-codes, and any permutation of them yields an automorphism, so aut([Cq ]k ) ∼ = FGq k −1 . Now |FGq k −1 | = (q k − 1)!, and for any prime p|(q k − 1)!, thus p ≤ q k − 1, a cyclic subgroup Cp ⊂ FGq k −1 exists (the converse of Sylow’s theorem does hold for single primes). Hence Cp can form a coupled product with direct product [Cq ]k as dependent component. Corollary 3.2 For distinct primes p, q and k-fold direct product [Cq ]k : A coupled product Cp |> [Cq ]k requires p ≤ (q k − 1).
3.6 Decomposing Simple Groups AGn ⊂ FGn for n > 4 The described arithmetic coupled product (CP), which requires only subgroups resp. r-congruences, can be generalized to finite groups of any order as follows. Recall a
3.6 Decomposing Simple Groups AGn ⊂ FGn for n > 4
45
group G of order |G| = (pi )ni (distinct primes pi ) has subgroups Si (not necessarily cyclic) of coprime orders |Si | = pini . These maximal p-subgroups or ‘Sylow components’ [2, p. 39] are mutually disjoint or rather ‘orthogonal’, viz. intersecting only at the group identity e. Definition 3.5 Sylow pair Si , Sj has a compatible ordering Si |> Sj when: in case Sj ∼ = Cpj : if pi |(pj − 1), or for k > 1: in case Sj ∼ = [Cpj ]k : if pi ≤ (pj )k − 1 (k-fold direct product). For any finite group G holds: G = Si is the sequential product of its Sylow psubgroups (such as FG3 = [b∗ ][a ∗ ] = C2 C3 ∼ = C3 C2 ). Then G allows coupled products (CP) for Sylow component pairs that can be compatibly ordered, implying the next theorem: Theorem 3.1 (Ordered Sylow coupling) Let permutation machine MG generate group G, being the sequential product of its Sylow p-subgroups Si in some (arbitrary) ordering. Then: (a) MG is the ordered coupled product of all Si as permutation components Mi . (b) Only compatibly ordered Sylow pairs Si |> Sj have a coupling map Si → aut(Sj ). (c) There are as many groups of order |G| as there are distinct permutation machines generating a group of that order. They have different combinations of compatibly ordered Sylow pairs and corresponding distinct coupling functions. For squarefree |G|, thus a product of distinct primes pi , with k prime pairs (pi , pj ) compatibly ordered: pi |(pj − 1), the 2k combinations tend to yield distinct (non-isomorphic) groups of order |G|. For instance if |G| = 30 = 2.3.5 there are two compatible Sylow pairs (2, 3) and (2, 5) hence there are 22 = 4 distinct such groups, just one of which is commutative, namely the direct product C2 × C3 × C5 ∼ = C30 . However |G| = 42 = 2.3.7 has three compatible pairs (2, 3)–(2, 7) and (3, 7) yet only 6 groups (not 23 = 8) of that order.1 Due to the pair ‘chain’ (2, 3) → (3, 7) seemingly distinct coupled structures generate isomorphic groups, and 2k is an upperbound to the number of distinct groups, which is reached if no such chain of compatible pairs occurs. So |G| = 110 = 2.5.11 with k = 3 and chain (2, 5) → (5, 11) yields 6 < 23 groups, |G| = 105 = 3.5.7 (3, 7) and |G| = 165 = 3.5.11 (5, 11) each yield 21 = 2 groups, |G| = 70 = 2.5.7 with k = 2 and no chain has 22 = 4 groups. As shown for n ≤ 4: full group FGn has n stabilizer subgroups FGn−1 , with seq.product FGn = FGn−1 Cn = Cn FGn−1 . But this construction holds in general, yielding coupled product recursion (Eq. 3.3) also for n > 4: (RFG):
FGn ∼ = FGn−1 |> Cn .
1 http://mathworld.wolfram.com/FiniteGroup.html
(3.4)
46
3 Coupling State Machines
Corollary 3.3 Recursion (RFG) generates all full groups for n > 2. The structure of FGn derives from that of FGn−1 , because defining r-congruence δ, specified by any stabilizer FGn−1 of FGn , is extended by subgroup Cn as rightcomposing elements, functioning as last (rightmost) n-counter code-component, Cn ∼ = Z(+) mod n. Recall an even [odd] permutation is obtained from e by swapping an even [odd] number of state pairs. Their composition is like addition mod 2, thus Z2 (+) with odd = 1, even = 0 which is isomorphic to a 2-cycle C2 . Cyclic permutation Cn of n states is obtained by n − 1 pair swaps: swap(i, i + 1), swap(i + 1, i + 2) etc., hence its parity is that of n − 1. Using the 2-part congruence of [odd, even] permutations in FGn−1 for coupling function γ : FGn−1 → aut(Cn ), the odd permutations activate multiplier unit −1 ∈ Zn (.) to yield permuted [Cn ] for coupling purposes. This odd/even property of the elements of FGn−1 , respectively FGn , can be represented by a first code component C2 in a decomposition of FGn , behaving as Z(+) mod 2, with code values: even = 0, odd = 1. Clearly each group with both odd and even permutations has this 2-part full congruence, hence with full image group C2 as leading (first, leftmost) component in a cascade decomposition. The order 60 of AG5 has prime structure |AG5 | = 22 .3.5 with C3 and C5 as even permutation cyclic subgroups of AG5 . A 4-cycle permutation with closure C4 (fixing one state) cannot occur in AG5 because it is an odd permutation, but a subgroup of order 4 does exist (by Sylow’s theorem), which must be C2 × C2 . Now generate AG5 by extending AG4 (Fig. 3.9) with a factor group d ∗ = C5 , hence AG5 ∼ = C5 .AG4 ∼ = AG4 .C5 where AG4 functions as stabilizer AG4 of state 4 in AG5 (Fig. 3.10). Such generation of AGn with an alphabet of size |A| = |AGn−1 | + n − 1 yields a flat spectrum of height |AGn−1 | and length n. Note: The sequential product of orthogonal subgroups (intersecting only at e) commutes. For instance C5 (AG4 ) = (AG4 ) C5 = AG5 despite non-commuting group elements, e.g. ad ≡ / da (Fig. 3.10). The alternating group AGn of the n!/2 even permutations in FGn is known to be a simple group for n > 4 [2, p. 69], so without full congruence resp. normal subgroup [2, p. 15]. But AGn (n > 4) does have subgroups, e.g. its Sylow p-subgroups, and as many r-congruences with corresponding coupled product (CP) as permutation machine of structure: AGn ∼ = AGn−1 |> Cn if n > 4 is prime, and in general with Sylow-compatible coupling(s) by Definition 3.1. Notice the orders of pair products of the four generators (table |xy ∗ | in Fig. 3.10) do not depend on commutation: xy and yx have the same order. Because let xy have order m, so (xy)m ≡ x(yx)m−1 y ≡ e and no smaller m yields e. Then (yx)m−1 y ≡ x −1 ⇒ (yx)m−1 yx ≡ e ⇒ (yx)m ≡ e where again m is minimal. In fact xy and yx have similar structure: yx ≡ sxys −1 mod Q for some similarity permutation s of state set Q. The structure of AG5 of order |AG4 |.5 = 60 extends that of AG4 by a coupled product with C5 having four symmetries (automorphisms): C4 ∼ = aut(C5 ) into which
3.6 Decomposing Simple Groups AGn ⊂ FGn for n > 4
47
Fig. 3.10 Alternating group AG5 is: AG4 extended by C5 (60 even permutations)
AG4 couples by Sylow component image (C2 × C2 )/γ = C2 = {0, 1}, transforming d ∈ C5 into d ≡ d if (a, b)/γ = 0, or d ≡ 4d ≡ −d mod 5 if (a, b)/γ = 1. This yields the next cascade structure of AG5 as state machine, a cascade network of coupled prime-counters: AG5 = AG4 |> C5 = C3 |> (C2 × C2 )|>γ C5 ∼ = {c, a, b, d}∗ .
(3.5)
To show this represents simple group AG5 = {a, b, c, d}∗ as given in Fig. 3.10, notice the iteration classes c∗ , a ∗ , b∗ , d ∗ are by construction of proper order: 3, 2, 2, 5 respectively. It remains to verify the four generators have a 4-code and coupling such that their pairwise compositions are isomorphic to those in Fig. 3.10 as follows. The four generators and their iterations have the next 4-codes, in network sequence as given in (Eq. 3.5) where c3 ≡ a 2 ≡ b2 ≡ d 5 ≡ e (mod AG5 ) with code [0, 0, 0, 0]: [c] = [1, 0, 0, 0];
[a] = [0, 1, 0, 0];
[b] = [0, 0, 1, 0];
[d] = [0, 0, 0, 1];
[c2 ] = [2, 0, 0, 0];
[a 2 ] = [0, 0, 0, 0];
[b2 ] = [0, 0, 0, 0];
[d 2 ] = [0, 0, 0, 2];
[c3 ] = [0, 0, 0, 0];
[d 3 ] = [0, 0, 0, 3];
[d 4 ] = [0, 0, 0, 4];
[d 5 ] = [0, 0, 0, 0].
The generators c, a, b of stabilizer AG4 and their pair products need not be verified since AG4 ∼ = AG4 . Only the products cd, ad, bd with the new generator d need be
48
3 Coupling State Machines
compared with those of their coded versions: [xd] = [x]|>γ [d] with x ∈ {c, a, b} under coupled product with mapping (C2 × C2 )/γ = C2 −→ aut(C5 ). In fact cd = ced = ca 2 d = caad, so only the coupled code product [a]|>γ [d] must yield the code [ad] of ad and similarly [b]|>γ [d] = [bd], as they do upon inspection. The coupled product (of p-subgroups) for groups relates to the following properties of sub-semigroups and image semigroups in general. Lemma 3.5 For any sub-semigroup: T ⊂ S ⇒ deg(T ) ≤ deg(S). Lemma 3.6 Any image semigroup: U ∼ = S/γ ⇒ dim(U ) ≤ dim(S). Proof Any subsemigroup T of a semigroup Sn with deg(S) = n states can also be represented over at most n states, since T is just a (closed) subset of the n-state transformations representing S. Similarly the dimension (the minimal number of generators) of an image semigroup U of S is at most dim(S), since U is obtained by equivalencing elements in S, which cannot increase its dimension. So any subgroup of FGn can be represented by at most n states. And conversely, any group H with deg(H ) = n is a subgroup of FGn . For groups: the coupled structure of H ⊂ G as subgroup can simply be derived from that of G because subgroup order |H | is known to divide the group order |G| (Lagrange’s theorem [2, p. 11]). So the prime structure of |H | derives from that of |G| by reducing one or more exponents of its prime divisors. Corollary 3.4 For subgroup H ⊂ G (finite): The compatible ordering of the Sylow components of H , viz. its ‘coupling structure’, is covered by that of G. From AGn ⊂ FGn follows that the coupling structure of alternating group AGn is similar to that of FGn , yielding a loopfree coupled network of compatibly ordered Sylow components (Theorem 3.1). Regarding the loopfree decomposition of a non-cyclic finite group G (dim(G) > 1) the property of being a simple group is irrelevant. The odd/even full congruence of FG5 yields image C2 and its Sylow component of order 23 contains odd permutations of order 4, since C4 ⊂ FG5 . So AG5 (Fig. 3.10) can be expanded to FG5 by replacing for instance a of order √ 2 by an odd permutation f of order 4, such as f = a (thus f 2 ≡ a) or f −1 .
3.7 Loop Composition Superfluous Apparently loop composition of two groups, both as dependent component in a coupled network, is not required—not even to decompose simple groups such as AGn (n > 4). From an engineering point of view with optimization in mind, minimizing the logic for coupling purposes, loop coupling two machines or semigroups is superfluous and will not be considered further. However, the term loopfree is useful to
References
49
characterize the type of general network decomposition: either a direct (uncoupled) product, or a cascade (coupled) product of component machines, or a combination of these. Such group decomposition results can be generalized to semigroups (Chap. 4) yielding a loopfree network decomposition in general, with subsemigroups as components. The basic machine components are those with a closure that has no proper subsemigroup, of which there are five types (Chap. 2). They coincide with the indecomposable components resulting from the discussed decomposition by rcongruences into a (coupled and loopfree) network of subsemigroups.
References 1. G. Birkhoff, T. Bartee: “Modern Applied Algebra”, McGraw-Hill, New York, 1970 2. D.J. Robinson: “A Course in the Theory of Groups”, Graduate Texts in Mathematics, vol. 80, Springer, New York, 1982 3. A. Suschkewitsch: “Über die endlichen Gruppen ohne das Gesetz der eindeutigen Umkehrbarkeit”, Math. Ann. 99, 30–50 (1928) 4. A. Clifford, G. Preston: “The Algebraic Theory of Semigroups”, AMS Surv. #7 1, 130–135 (1961) 5. J. Hartmanis, E. Stearns: “Algebraic Structure of Sequential Machines”, McGraw-Hill, Englewood Cliffs, 1970 6. K.B. Krohn, J.L. Rhodes: “Algebraic Theory of Machines, Part I”, Trans. AMS 116, 450–464 (1965) 7. A. Ginzburg: “Algebraic Theory of Automata”, Academic Press, New York, 1968 8. N.F. Benschop: “On State Machine Decomposition and the Five Primitives of Sequential Logic”, International Workshop on Logic Synthesis, MCNC, US, 1987 9. N.F. Benschop: “Semigroups of Constant Rank, and the Five Basic State Machine Types”, IFIP Workshop Logic and Architecture Synthesis, Paris, 1990. http://de.arxiv.org/pdf/math. GM/0103112
Chapter 4
General Network Decomposition of State Machines 4.1 Introduction The results of the previous chapters will be employed to derive the structure of a finite state machine specified by a state transition table, as a network of the five basic types of machines, which moreover are least coupled for an ‘optimal’ synthesis of the desired behavior. Each basic component then can be binary encoded readily, allowing binary digital implementation. Partial specification of state transitions, due to an incomplete state transition table, is implemented by filling the don’t cares by the ‘dc’ rule: “don’t care −→ don’t change”. As observed in Chap. 3, “representation over a minimal state set hides structural decompositions”, with full permutation group FG3 as example. Its composite structure as coupling of two cyclic groups (periodic counters) C2 and C3 is not clear from its minimal representation over stateset Q of three states, but does reveal itself if represented over the six states of the group itself as state set. By Lemma 3.2 “Each finite semigroup S can be represented by a state machine of at most |S| + 1 states”. This, combined with the previous observation does not mean that it is best to expand a given stateset Q of a machine M(Q, A) into the full sequential closure S = A∗ /Q to implement that machine, using its sequential (semigroup) structure, although for permutationmachines (having a group as closure) this canbe useful. For a group of order i (pi )j the number of states then becomes i j (j.pi ) which usually is much smaller than the group order. However, it does mean that it is useful in many cases to first explore the structure of closure S in order to find a possibly more profitable implementation of M than suggested by its generative definition of A/Q. Exploring S here means to generate S = A∗ /Q insofar as useful for instance to learn about the type of closure involved: is S a permutation group or some other constant-rank closure involving branch- and/or reset memory components? If so, its structure of semi-direct product of machine types G, L, R is as described in Chap. 2, and the group component G has a structure as given in Chap. 3. Or is S commutative (by testing in A2 /Q if ab = ba for all a, b ∈ A), in which case coupling between components does not occur. Or do reducing ranks play an important role in its rank spectrum? If so, what type of idempotent structure is apparent: do they commute, for instance forming a (sub-) structure of a Boolean lattice. Such information can be exploited to obtain an efficient and structurally relevant implementation of M. The general aim is to re-interpret the given state set Q as a sub-semigroup (an ideal) of closure S = A∗ /Q consisting of a possibly coupled network of basic machine types, thus giving ‘structure’ to the otherwise structureless set of states. For instance Z10 (.) given as a 3-input 6-state machine (Fig. 3.1) without recognizing it as a direct product of Z2 (.) and Z5 (.), will yield precisely this structure upon such N.F. Benschop, Associative Digital Network Theory, © Springer Science + Business Media B.V. 2009
51
52
4 General Network Decomposition of State Machines
closure analysis and re-interpretation of the six states (Figs. 3.1 and 3.2). Namely Q = {2∗ , 5, 0} is an ideal of Z10 (.) formed by the union of two subsemigroups with the structure of Z2 (.) = {5, 0} and Z5 (.) = {2∗ , 0}. And its set of commuting idempotents forms a 22 Boolean lattice, corresponding to a direct product of two coprime residue semigroups Zp × Zq . Notice that it suffices to implement the generators in alphabet A by a coupled network of the five basic component types, as described below.
4.2 Implementing M = (Q, A) by Its Alphabet A Each generator a ∈ A, as transformation of Q, is a disjoint union of 1-dimensional periodic- or monotone counters, ‘don’t-change’ (state q → q) or reset components (state subset Qsubset → q) in state space. They are implemented by corresponding basic machine types Cp , Un resp. Hn , Ln , Rn (Fig. 2.2). For Z10 (.) = {7∗ , 2∗ , 5, 0} (Fig. 3.1) with three generators A = {7, 6, 5}∗ of ranks 6, 5, 2 respectively this means, writing dc for don’t-change: for generator 7 a 4-counter C4 in states 1..4 and dc in states {0, 5}, for idempotent 6 a dc in states {1..4, 0} with a reset to 0 in state 5, for idempotent 5 a reset to 0 in states 1..4 with a dc in states {0, 5}.
Equivalencing 0 ≡ 5 implies input equivalence b ≡ e (Fig. 3.1), where e is the identity “don’t change any state” input, hence the two 4-cycles 7∗ ≡ 2∗ . This rcongruence merges two isomorphic subsystems {7∗ , 5} ∼ = {2∗ , 0} ∼ = Z5 (.) so S ∼ = Z2 (.) × Z5 (.). Similarly the generators {a, b} of the example machine M = A/Q in Sect. 4.5 are readily seen to be implemented by components of type C4 , C2 , U2 . Because a generates a 4-cycle on states {1, 2, 3, 0} while b is a 2-cycle on {0, 1} with a monotone counter U2 on states {3, 2} mapping both states onto state 2. In other words, we seek a structured coding of the not necessarily structured set of states Q, possibly expanding Q, in order to implement the set of generators A, and thus the given state machine, as a structured network of the five basic types of state machines.
4.2.1 Decomposition by Local Input Closures An efficient decomposition of M(Q, A) via its alphabet A can occur if some generator a ∈ A has a decomposable closure a ∗ , as for instance 7∗ ∼ = C4 in Z10 (.), which has image C2 due to congruence {9 = 1, 7 = 3} generated by equivalence 9 ≡ 1 and applying a ≡ b → ac ≡ bc. In Z10 this implies equivalences {4 = 6, 2 = 8}. The corresponding full image of Z10 then is Z6 (.) = Z3 × Z2 as leading component, and C2 as dependent cascade component, although no coupling is required because Z10 (.) is commutative. For a further decomposition of Z6 , equivalence its topgroup
4.3 Bottom-Up Rank Driven Decomposition of S = A∗ /Q
53
C2 to yield an image H2 × H2 (Figs. 2.2, 3.1): a 22 Boolean lattice of idempotents as leading component. Similarly, in the example system of Sect. 4.5 the two generators in A = {a, b} over four states, have closure a ∗ resp. b∗ with a homogeneous congruence (of equalsize parts), to be employed for efficient decomposition of M(Q, A).
4.3 Bottom-Up Rank Driven Decomposition of S = A∗ /Q The structure of a constant rank state machine is as described in Chap. 2, including that of a group machine (of state permutations) as in Chap. 3. If M = A/Q is not of constant-rank, we seek a sequence of right congruences for a cascade decomposition. For instance, the elements of minimal rank in S = A∗ /Q form, by Lemma 2.1d, a closure B1 (‘bottom’) of constant rank type, in fact the unique minimal ideal of S, called its kernel. If B1 is not a single element (the ‘zero’ element z of S) it can be implemented as in Chap. 2, including possibly a group (Chap. 3) and/or a left-copy semigroup L and/or a right-copy semigroup R. Otherwise extend B1 = z with the next higher rank elements, forming a ‘0-ideal’ B2 of S. For instance in Z10 this yields B2 = {0, 5} ∼ = Z2 (.) congruent to basic component H2 (Fig. 2.1) of two ordered commuting idempotents, with logic implemented by a 2-input AND gate. Such an ideal plays the role of a single zero z2 in the whole semigroup S. Collapsing B2 to a single zero z2 as an equivalenced part of S, with the remaining elements in S − B2 as singletons, yields a right congruence on S, with corresponding cascade decomposition (Lemma 3.3). In this case: 0 ≡ 5 → {2∗ ≡ 7∗ } ∼ = C4 yielding a parallel (uncoupled) composition of H2 and C4 . Now z2 can again be combined with the next higher rank-set in S, to repeat this bottom-up process of implementing the closure S of machine M(Q, A) by successive ideals. Note: It is important to realize that a r-congruence generated by equivalencing a subsemigroup T of S (intended as dependent component in a cascade), hence equivalencing set T x for each x ∈ S, produces only equivalences among elements of rank lower or equal to those in T (by Lemma 2.1c). All elements of higher rank remain singletons in such r-congruence, yielding in general a less efficient decomposition than a more homogeneous congruence, such as those generated in groups (Chap. 3) or generated by a subgroup at the top (-rank) of S. So a ‘bottom-up’ decomposition process is normally less efficient than a ‘top-down’ process, to be discussed next (Sect. 4.5.1).
4.4 Partial Direct Products, Unused Codes, Efficiency For an efficient implementation it is useful to look for a direct product in S with a corresponding encoding of such components, as was shown in Chap. 3 in the case of permutation groups, or arithmetic Z(.) mod 10. However, this is often only partially
54
4 General Network Decomposition of State Machines
possible, as for instance in the case of multiplication mod 10, where Z10 = Z2 × Z5 , while Z5 ⊂ Z2 × C4 is properly contained in a direct product, implying three unused codes (Fig. 3.2) for this encoding of Z5 , and six unused codes for Z10 . Clearly the coding efficiency of a decomposition is best served by a homogeneous partition (congruence), thus with equal-size parts. If there are m parts of order n each, then a corresponding cascade decomposition has independent and dependent components of order m resp. n. The rank-driven decomposition of Sect. 4.3 is rather inefficient, since at each level the corresponding congruence is very ‘skew’, with many singletons (the higher rank elements) as congruence parts. On the other hand, the group decomposition as in Chap. 3 is very efficient, with a homogeneous congruence at each level.
4.5 Example As an example of such structural approach to machine decomposition consider the simple case of a 2-generator 4-state machine M(A, Q), with expanded S = A∗ /Q as in Figs. 4.3 to 4.7. Its closure S has 176 transforms of Q = {1, 2, 3, 0}, generated lexically from alphabet A = {a, b} as described in Chap. 3 (Fig. 3.5, regarding group machine FG3 ). Notice that a is a permutation, and transform b of rank 3 permutes only states (0, 1) and maps (2, 3) to state 2, briefly denoted as C4 resp. C2 ∪ U2 . The two generators produce in a ∗ and b∗ no permutation of order 3, although two C3 do occur in this non-commutative S, which in fact contains four pairs FG3 (Fig. 4.7). In a commutative S this cannot occur, since then all maximal subgroups of lower rank are images of the top-rank maximal subgroup (Lemma 4.1). With 176 elements, S comprises a sizable part of the full semigroup F S4 over 4 states with 44 = 256 elements, which has three generators, including one producing C3 . It is readily verified that F Sn>3 of order nn has dim(F Sn ) = 3. The three generators contain in statespace Cn , Cn−1 ∪ C1 , Cn−2 ∪ U2 respectively (C1 symbolizes one fixed state); the first two produce the full group FGn (Fig. 3.8), while the first and last produce for n = 4 the example of this section. Since ab = ba (Fig. 4.3) S is not commutative. Its input spectrum over A is |Ak | = {2, 4, 7, 12, 16, 23, 27, 29, 25, 16, 10, 4, 1} specifying the order |Ak | of irreducible length k strings over A for each k. Apparently all strings of length k > 13 are reducible, hence equivalent (as state transforms) to shorter strings over A. Unrestricted exponential growth |A|k = 2k holds only till k = 2, and for k > 2 the structural restrictions reduce such growth to a ‘bell-shape’ down to 1 at k = 13, with a maximum of 29 new transforms at k = 8. All four ranks do occur as follows: |S(r=4)| |S(r=3)| |S(r=2)| |S(r=1)|
= 4 = 96 = 72 = 4
(one 4-cycle)
(Kernel = R4)
Order |S| = 176
The rank = 4 elements form a cyclic group C4 of order 4, and the four rank = 1 elements form a right-copy (reset) machine R4 also of order 4. This subsemigroup
4.5 Example
Fig. 4.1 Machine M(Q, A) → |S| = 176, Input spectrum: 2, 4, 7, 12, 16, 23, 27, . . .
55
56
4 General Network Decomposition of State Machines
Fig. 4.2 Machine M(Q, A) → |S| = 176, Input spectrum: 2, 4, 7, 12, 16, 23, 27, 29, 25, . . .
4.5 Example
Fig. 4.3 Machine M(Q, A) → |S| = 176, Input spectrum: 2, 4, 7, 12, 16, 23, . . .
57
58
4 General Network Decomposition of State Machines
Fig. 4.4 Machine M(Q, A), input spectrum: 2, 4, 7, 12, 16, 23, 27, 29, 25, 16, 10, 4, 1
R4 is the unique kernel (minimal ideal) Q of S, over which S is represented as state set. In the full semigroup of all 44 = 256 transforms of 4 states, the number |S(r = 3)| of rank-3 transforms is produced by: 4 choices of the missing state, 3 choices of the pair of equal next states, (2 of 4) = 6 ways to place such pair, and 2 ways to place the
4.5 Example
59
Fig. 4.5 Machine M(Q, A) → |S| = 176: 72 of rank = 2 (6 equal-range subsets)
remaining two next states, yielding |S(r = 3)| = 4.3.6.2 = 144 rank-3 transforms. Notice b3 = b hence {b, b2 } form a subsemigroup: a 2-cycle with identity b2 = e < e which is an idempotent ordered under the system identity e = a 4 . The example’s rank distribution is as follows. For the rank = 3 transforms in the example: consider the ‘distance’ (mod 4) between two merged states, e.g. b : 1230 → 0221 merging states 2 and 3 have distance = 1. State partition P (b) = {1, 2 = 3, 0} does by Lemma 2.1b not refine
60
4 General Network Decomposition of State Machines
Fig. 4.6 Machine M(Q, A) : |S| = 176, with 33 idts of rank(4, 3, 2, 1) = 1, 8, 20, 4
under composition: an adjacent pair (mod 4) will remain so under composition with other transforms. Hence no pair of equal next states of distance 2 occurs in rank 3 transforms, while distance 3 = distance −1 (mod 4) which equals distance 1 since ‘distance’ is bi-directional. There are (2 out of 4) = 6 ways to place a pair in 4
4.5 Example
61
Fig. 4.7 Rank = 3 subsystem over Q-0 (order 24) and iterations
next-state positions, of which the two with distance 2 don’t occur and distance 3 = distance 1 (mod 4) do occur, so only 2/3 of all possible 144 rank = 3 transforms, thus 96, will be generated. By a similar reasoning there are 72 rank-2 transforms, 4 of rank = 4, and 4 of rank = 1, hence in total |S| = 4 + 96 + 72 + 4 = 176. Consider now the bottom-up ideal reduction process discussed earlier, applied to this example. The four rank = 1 elements form the kernel B1 of S, being a rightcopy subsemigroup R4 , functioning as global zero: xB1 = B1 x ⊂ B1 for all x ∈ S. The 72 next higher rank = 2 elements, displayed in Fig. 4.5, combined with R4 collapsed as single zero z2 , yield a 0-ideal B2 of S. It consists of six subsystems of 12 elements of equal range, or alternatively six subsets of 12 elements of equal partition (of which three are displayed in Fig. 4.5). Each forms a subsemigroup if
62
4 General Network Decomposition of State Machines
extended with two generated rank = 1 reset elements in R4 . Given two states in a 4-state machine there are (2 of 4) = 6 such order = (12 + 2) subsemigroups of similar structure. Four of these are isomorphic—they have three rank-2 idempotents each, forming an L3 left copy semigroup (in a subsemigroup of equal partitions this is a Rn right copy closure), and two isomorphic subsystems with 4 idempotents (of rank 2) each. The remaining 9 (resp. 8) elements generate the corresponding idempotents and reset elements in R4 , by iterations of type Cn and/or Un . Hence basic types Cn , Un , Ln (resp. Rn ) are involved in each of these common-range (resp. common-partition) subsystems of given rank. This holds for each of the higher single-rank Bk 0-ideals. Two more steps follow in this decomposition process, first with rank = 3 elements of order |B3 | = 96 consisting of (3 of 4) = 4 equal-range subsystems of order 24 each (Fig. 4.7). And lastly the rank = 4 elements forming top group C4 , with B4 = (C4 ∪ z4 ) ∼ = Z5 (.) completing the analysis of this closure. Notice this last (and leading) image is of arithmetic type: Cp−1 ∪ 0 (prime p). At each level the ideal Bk of rank k, as dependent cascade component, is collapsed to a single zero, with corresponding right congruence. In such cascade decomposition the coupling involved (see Chap. 3) depends on the closure of automorphisms aut(Bk ) of Bk , and on a possible mapping from the independent component into it. Notice that an 0-ideal such as B1 , of single rank with additional zero element, is not a constant-rank system, hence the structure as given in Chap. 2 does not apply. Only a subset of Bk that is closed (viz. does not generate an element of lower rank: like a set of idempotents in B1 with equal range forming Ln or equal-partition idempotents forming Rn ) is a constant-rank system of that simple-semigroup structure. The isomorphisms among the four closures of rank 2 (Fig. 4.5), with rank-1 extension, derive from their ranges: cyclically replace (1, 2) → (2, 3) → (3, 0) → (0, 1) → (1, 2). And in the 4-idempotent closures: replace (0, 2) → (1, 3) → (0, 2). These are similarity transforms gxg −1 with g in cyclic topgroup G1 = a ∗ ∼ = C4 , resp. in rank-3 subgroup b∗ ∼ = C2 , allowing a direct product coding with factor C4 resp. C2 . Similarly, for rank 3 there are four equal-range subsets of order 96/4 = 24, with resp. ranges: Q-0, Q-1, Q-2, Q-3, each extended with some lower rank elements within that range to form a closure. Such extension contains rank-2 elements in ideal B2 ∪z2 . For instance the subset defined on Q-0 = {1, 2, 3} is given in Fig. 4.7, among others containing two copies of the full group FG3 . Section 4.5.2 shows these four subsystems are due to similarity transforms occurring only in a non-commutative semigroup, with a multiplicity equal to the number of units g ∈ Ge (in a commutative system gxg −1 = x).
4.5.1 Top-Down Decomposition by Local Input Closures By Lemma 2.1 (composition does not increase rank) it follows that at least some of the generators a ∈ A of a machine M(Q, A) have maximal rank in closure S. And striving for a homogeneous r-congruence of S, in order to achieve an efficient decomposition coding, it helps to generate such congruence by equivalencing
4.5 Example
63
a subsemigroup T , intended as the dependent component in a cascade, at the top (maximal rank) of S. For instance T = a ∗ generated by a single input a of maximal rank. In M(Q, A) of Fig. 4.3 input a has closure a ∗ ∼ = C4 where congruence {a 2 = e, 3 ∗ 3 a = a} yields image C2 . In b holds b = b so that b∗ = {b, b2 } ∼ = C2 (idempotent b2 ), with 2-cycle states (0, 1) and mapping states (2, 3) to state 2. From the state table follow two ‘least change’ 2-part homogeneous state partitions q1 [0, 1] : (0 = 1, 2 = 3) and q0 [0, 1] : (0 = 2, 1 = 3) with an efficient binary state code (q1 , q0 ) = {00, 01, 10, 11} for states {0, 1, 2, 3} respectively, without state set expansion. This code matches normal 4-counter binary code, accommodating the iterative structure of inputs a, b.
4.5.2 Global Decomposition by Maximal Iterative Components Alternatively, one can decompose S as a whole, being a binary (two operand) operator as it were, similar to Z(.) mod 10 (Figs. 2.2 and 3.1). Then it is useful to look upon S as a disjoint union of one-idempotent subsemigroups ([1, Sect. 4.3]). This is readily understood via the iterative structure x ∗ generated by each element x ∈ S (Fig. 2.1), which consists in general of a monotone- and a periodic (cyclic) part, with just one idempotent in the latter, at the unique multiple of the period in the cycle. Definition A maximal iterative (‘maxit’) component Te consists of all elements in S that generate the same idempotent e ∈ S. They form a maximal subsemigroup Te of S, and maxit components are disjoint, forming a complete partition of S. Decomposing S now means to find an efficient multi-component unique code for each element of S such that their pairwise composition is, as much as possible, a matter of component compositions: ab = [a1 , a2 , . . . , an ].[b1 , b2 , . . . , bn ] = [a1 .b1 , a2 .b2 , . . . , an .bn ]. Only for a direct product S = S1 × S2 × · · · × Sn is this possible. In general the local component-pair compositions must be corrected, by ‘coupling’ between components to obtain the correct result. This was shown in Chap. 3 regarding groups and their cyclic components in a cascade coupled network, where correction depends only on the component on the left. For a commutative S the above ‘iterative’ decomposition yields a partition of S which is a full congruence ([1, Theorem 4.12]). So the maximal one-idempotent ‘maxit’ components form an ordered lattice, and the idempotent of a product of two elements is the product of their idempotents. Hence, for idempotents e, f : Te Tf ⊆ Tef . The lattice is a partial ordering in general, and a Boolean 2n lattice if S is a direct product of n maxit components. Combinational logic is involved for implementing such lattice image (the leading component of a cascade decomposition), using basic components of type H (Fig. 2.2).
64
4 General Network Decomposition of State Machines
In a commutative semigroup S with identity e the top-group Ge of units (all generating e upon iteration) dominates the structure of each maximal subgroup Gf ⊂ S with identity (idempotent) f < e, since such Gf is an image of Ge , denoted as Gf |Ge . More generally: Lemma 4.1 For ordered idempotents f < e in semigroup S and maximal subgroups Gf and Ge holds: if f commutes with all g ∈ Ge then Gf |Ge where Gf = (Ge )f . Proof f commutes with e and all a, b ∈ Ge with ordering e > f (Lemma 2.2), hence (ab)f = (ab)ff = a(bf )f = af bf ∈ Gf . So Gf = (Ge )f is image of Ge . For commutative S this can be used to encode each periodic element of S by a combination [f, u] of an idempotent f ∈ S and a unit u ∈ Ge . For further decomposition, the leading (independent) component of such code involves combinational logic of the ordered idempotents f < e in S, and the other component corresponds to the decomposition of topgroup Ge as in Chap. 3. A complete decomposition of S results if this morphism between ordered maximal subgroups can be extended to a morphism between maxit subsemigroups, including non-periodic (monotone) elements of S of type U (see Fig. 2.2). To include non-commutative S with monotone elements, consider S with identity e and top maxit component Te , and idempotent f < e with maxit component Tf , neither of these necessarily commutative, represented over stateset Q. By Lemma 2.2 the idempotent ordering f < e means Qf ⊂ Qe and partitions Pf > Pe , independent of maxit component Te being commutative and/or periodic. For left- or right-equivalent idempotents (Sect. 2.3) holds (see also Lemma 2.7b): Corollary 4.1 Left- [right-] equivalent idempotents f, g ∈ S have isomorphic maximal subgroups Gf and Gg , with isomorphism l- [r-] composition by f resp. g. A right congruence on S (as preserved state partition [2]) suffices for semigroup decomposition, similar to the decomposition of groups (Chap. 3). The mentioned decomposition by maximal iterative (maxit) components does form a r-congruence also for non-commutative S, being based on equivalencing subsemigroups (possibly with monotone elements). Lemma 4.1 holds for all ordered maxit components in a commutative S. More precisely, for ordered idempotents f < e the lower f must commute with all elements of the higher ordered maxit Te . In the present example this is not the case, for instance idempotent X = (1233) < e = (1230) in Fig. 4.7 does not commute with generator a = (2301) ∈ Te since aX = (2331) and Xa = (2300). In fact aXa −1 = bb = (1220) (Fig. 4.6: the source of set I 3 of similar idempotents). For commutative semigroups, and others for which Lemma 4.1 holds, the next important structural result follows. Theorem 4.1 In a semigroup S with idempotents e, f and maximal iterative subsemigroups Te and Tf , where f commutes with each element of Te (Lemma 4.1), holds: f < e implies Tf |Te with morphism Tf ⊆ (Te )f .
4.6 Invariants: Ordered Commuting Idempotents
65
Proof f commutes with each element of Te so: (ab)f = (ab)f 2 = af bf ∈ Tf . So right composition .f is a morphism from Te to Tf as required. As mentioned before, in non-commutative S the concept of similarity transform plays an important role. Consider left- or right-equivalent maxit components Tf and Tg (Corollary 4.1) as the result of a similarity transformation. Let idempotent e > f and also e > g, then there is a unit u ∈ Ge ⊆ Te for which uxu−1 ∈ Tg for all x ∈ Tf , and conversely u−1 Tg u ⊆ Tf . Equivalencing similar maxit components of S yields a commutative image of S, for which the ordered structure of Theorem 4.1 holds. Notice in Fig. 4.6 the similarity transform axa −1 (a ∈ Ge ) between the four equivalent idempotents {r, s, t, u} of rank = 3 ordered under e of rank = 4. The iterative and combinational (idempotent) structure of the example is now analysed.
4.6 Invariants: Ordered Commuting Idempotents For an indication of the coarse structure of the sequential behavior of a state machine system S = A∗ /Q, it is useful to inspect its idempotents, and especially those that commute, which can be ordered as shown in Chap. 2. To generate efficiently the idempotents, consider first the ‘top group’ G1 , which is formed by the state permutations of maximal rank. Then take the set I of idempotents of the next lower rank which are iterations of generators in A of that rank, and produce all their similarity transforms x = gxg −1 for each x ∈ I and g ∈ G1 . Such transformation leaves the structure of x unchanged, so x and its similarity transform x are both idempotent of the same rank, and in fact x = x if g and x commute. This way all idempotents of that rank are produced, and they can be used as generators of all idempotents (necessarily of lower rank) in S, and the ordering of the commuting subset yields the invariant structure of the system semigroup S. This is done in Fig. 4.6 for the above example, where G1 ∼ = C4 is cyclic. The second generator b (rank 3) yields a set I3 of four idempotents similar to bb. There is one more set J3 of four idempotents similar to (aaab)2 . These two sets form eight idempotents of rank 3, generating a total of 20 rank-2 idempotents and 4 of lowest rank = 1 (called ‘reset’ transforms that map all states to one particular state). In total there are 1 + 8 + 20 + 4 = 33 idempotents (Fig. 4.6) of ranks 4, 3, 2, 1 resp. By inspection those of rank 3 commute in pairs, e.g. in I3 : rt = tr, su = us with rank-2 products of ranges {2, 0} resp. {1, 3} while of a non-commuting pair one is idempotent, like sr of rs = sr. In all, I3 I3 produces six rank-2 idempotents (marked =). The other set J3 of four similar rank-3 idempotents generates in J3 J3 six rank-2 idempotents (marked w), and in I3 J3 ∪ J3 I3 the remaining 8 rank-2 idempotents. The ‘top’ idempotent e of rank 4 is the identity of the top group C4 . Monotone elements are not involved in this maxit component, but they do occur in the eight maxit components of rank = 3 (Fig. 4.6) with idempotents I3 ∪ J3 , which also contain C3 and C2 . The ‘bottom’ idempotents of minimal rank 1, which form a right-copy closure R4 , have a maxit structure consisting of monotone elements only, produced
66
4 General Network Decomposition of State Machines
by higher ordered idempotents. Consider the four idempotents in set I = {r, s, t, u} (Fig. 4.6) which are similarity transforms of r = b2 of rank 3. They all cover ‘resetto-state 0’ idempotent z0 = (0000) = rut, produced by the iterations of tru, urt, rtu, utr, tur in a monotone fashion (tail 2 or 3, period = 1). Figure 4.7 shows the subsystem of all 24 rank-3 transforms over stateset Q0 = {1, 2, 3} and their iterations. There are two full subgroups FG3 , each with one C3 and three C2 (Fig. 3.6). The remaining 12 transforms generate 8 idempotents (marked ‘x’) of which four {ghj k} occur in a 2-cycle, the other four {f lmn} do not occur in a cycle and have monotone generators. Furthermore, idempotents {X, Y } = L2 form a left-copy closure, as do (see also Fig. 4.5): {f, g, j, l} = L4 , {m, k, c} = L3 , {d, h, n} = L3 , and right-copy closures R3 for instance (Fig. 4.5): {m, f, p} − {q, c, d} − {l, n, r}. Notice cross products here do not preserve rank, like g = (1133), q = (0200) with gq = (0000) = z0 and qg = (3133); hence no constant rank closure (Fig. 2.3) is formed, where transitive [L or R] equivalence would yield a direct product L m × Rn . To summarize, without going into much detail, the ordered structure of this example can be described as follows. Semigroup S = A∗ /Q is non-commutative with four ranks, from 4 down to 1, each with 4, 96, 72, 4 elements in that order, hence |S| = 176. There are 33 idempotents: 1, 8, 20, 4 of rank 4, 3, 2, 1 respectively. S has an identity e centered in the cyclic topgroup Ge ∼ = C4 , which gives rise to 4 simi−1 larity transformations a Tf a at each of the lower ranks, where Tf is the maxit component of idempotent f < e. Writing ‘k sim(Tf )’ for a k multiple of similarity transformed maxit component Tf , rank 3 consists of 4 sim(2FG3 ) of which the two FG3 represented over Q-0 = (1, 2, 3) are given in Fig. 4.7. It is useful to note the cyclic elements per rank. The remaining elements are of monotone type, generating elements and idempotents of lower rank. For instance rank 4 consists of one C4 , rank 3 contains 96 elements of which 8 idempotents in four similar versions of a pair of FG3 , thus 4 sim 2(C3 + 3C2 ). With |FG3 | = 6 this yields 48 periodic elements at rank 3, thus half of the total at that level. The other half are monotone elements, generating lower rank elements. Of the 72 elements of rank 2 (Fig. 4.5, the 6 subsets of equal range) there are 20 idempotents, each in a cycle C2 , thus 20.2 = 40 periodic elements. As is readily verified, the remaining 32 are monotone, each necessarily generating one of the four reset elements of rank = 1: z1 , z2 , z3 , z0 which together form a right-copy (‘reset’) closure R4 . Moreover, Fig. 4.7 shows that over stateset Q-0 there are three elements of rank 3 that generate z1 , z2 , z3 respectively in a monotone fashion, which occurs four times (over Q-0, Q-1, Q-2, Q-3) by similarity transformations. Considering random input sequences, the effect of a state machine’s behavior in state space is mirrored in its sequential closure S (semigroup). With growing sequence lengths the observed rank will decrease, to eventually end up at its minimal value, that is in the minimal ideal of S, which is a constant rank subsystem of general structure G |> (L × R) as described in Chap. 2. In this example it is a reset machine R4 where any state moves to a specific next state.
References
67
In other words, the non-increasing rank feature of transform composition models, in a discrete environment, the conservation (constant rank) and increasing entropy (reducing rank) laws of physics.
References 1. A. Clifford, G. Preston: “The Algebraic Theory of Semigroups”, AMS Surv. #7 1, 130–135 (1961) 2. J. Hartmanis, E. Stearns: “Algebraic Structure of Sequential Machines”, McGraw-Hill, Englewood Cliffs, 1970
Chapter 5
Symmetric and Planar Boolean Logic Synthesis The decomposition of any Boolean Function BF n of n binary inputs into an optimal inverter coupled network of Symmetric Boolean functions SF k (k ≤ n) is described. Each SF component is implemented by Threshold Logic Cells, forming a complete and compact T-Cell Library. Optimal phase assignment of input polarities maximizes local symmetries. Rank spectrum is a new BF n description independent of input ordering, obtained by mapping its minterms onto an orthogonal n × n grid of (transistor-) switched conductive paths, minimizing crossings in the silicon plane. Using this ortho-grid structure for the layout of SF k cells, without mapping to T-cells, yields better area efficiency, exploiting the maximal logic path sharing in SF’s. Results obtained with a CAD tool Ortolog based on these concepts, are reported. Relaxing Boolean symmetric functions to planar-functions covers a majority of Boolean functions, and improves synthesis, especially low-symmetry BF decomposition [1].
5.1 Introduction Since the early nineteen eighties the synthesis of combinational logic for the design of integrated circuits (IC’s) is increasingly automated. Present logic synthesis, near the bottom of the IC design hierarchy just above layout, is fairly mature and is intensively applied in the design of production IC’s. But some problems remain: • Logic synthesis tools often have a disturbing order dependence. Re-ordering signals, which should not affect the result, can cause a considerable increase or decrease of silicon area. To curb computer time, synthesis tools avoid global analysis which tends to grow exponentially with the number of inputs. Hence a local approach is preferred, with a greedy algorithm that takes the first improvement that comes along. The result then depends on the ordering of cubes in a PLA (programmable logic array) listing, or the input order in a BDD (binary decision diagram) [2, 3] representing a Boolean function (BF). This effect is reduced by global analysis, and by symmetric function components SF, being independent of input ordering. CPU time is reduced from an exponential growth with nr. inputs to polynomial, by the ‘arithmetization’ via rank spectrum analysis of BF n , a new method of characterizing BF’s, to be explained. • Optimal choice of polarity, or phase assignment of signals—either inputs or intermediate variables—is still an unsolved problem, although some heuristics are applied. The influence of input phases on logic symmetries will be exploited for an efficient BF decomposition. • The use of a standard cell library is forcing decomposition- and cell mapping stages to produce a sub-optimal gate network, versus compiled cells as needed [4]: not using a cell library but a programmable grid template, to be discussed. The N.F. Benschop, Associative Digital Network Theory, © Springer Science + Business Media B.V. 2009
69
70
5 Symmetric and Planar Boolean Logic Synthesis
proposed ‘orthogrid’ BF structure is an experiment in that direction, to be extended to planar BF’s beyond symmetric BF’s as grid template alternative to the known FPGA (field programmable gate array) or FPMUX (field programmable multiplexer) cells [5]. Performance prediction, which normally comes with a cell library, must then be provided by the cell compiler, which is quite feasible, replacing library maintenance by compiler support. • Complete testing of combinational logic circuits requires irredundancy, guaranteed only in sum of cubes 2-level implementation. Logic in factored form, the usual result of a synthesis tool, sometimes has testability problems. Restriction to a disjoint product is proposed, with factors having no common input. This guarantees the irredundancy needed for BF testability in factored form. And: disjoint products yield a spectral calculus, with a BF rank spectrum independent of input ordering, and a convolution composition rule.
5.2 Logic Synthesis Independent of Input Ordering The mentioned problems in present synthesis CAD imply that no optimality (nor full testability) is guaranteed, nor does one know how close/far the optimum is. Presently, only by many synthesis runs (design space exploration) a feeling is obtained for the complexity of the functions to be synthesized, aiming for trading off circuit area, delay and power dissipation, but at a high cost in CPU time. Our aim is to improve this situation, crucial for the future of digital VLSI systems. The emphasis is on order-independent function representation, using a spectral technique called rank spectrum, and on global analysis before synthesis, which then becomes feasible. In fact this is one step beyond BDD type of BF descriptions [3], by mapping minterms as paths in an orthogonal grid, using symmetric BF’s and signal phasing. Methods similar to those applied in signal processing, like the frequency spectrum, or convolution of impulse response and input sequence in the time domain, are then applicable to Boolean functions. This yields: • Logic synthesis employing global structure analysis by a rank-spectrum technique, that is: ‘arithmetization of Boolean algebra’.
5.2.1 Orthogrid Plot and Rank Spectrum Definition An Orthogrid plot is a mapping of each minterm (0/1 string of length n) of a BF n in an orthogonal grid, as an n-step path from the origin to the n-th diagonal. For n inputs, each path ends on the n-th diagonal. Following the input sequence of a minterm, step down if ‘0’, and right if ‘1’ (see Fig. 5.1). This models a network of pass transistors on silicon, with a conducting path from the origin to the n-th diagonal for the given minterm. OR-ing all paths yields function F = 1 only if some path connects the origin to the final diagonal.
5.2 Logic Synthesis Independent of Input Ordering
71
Fig. 5.1 Gridplot of F = Product of two XOR’s
Definition The rank of a minterm is its number of ones. All minterms of equal rank end in the same point on the n-th diagonal. Without confusion such minterm set is also called a rank of F . In Fig. 5.1 is given the orthogrid plot of a single rank XOR product (4 terms, rank 2). Definition A rank function RF has only one non-empty rank. And: the rank spectrum of BF n is the vector of minterm counts per rank. Hence a BF n is the sum (disjoint union) of its rank functions. Each rank has a number of minterms independent of input ordering, so the rank spectrum of any BF n is also independent of input ordering. In general, crossing paths in an orthogrid plot are not allowed to touch each other, to be drawn with a symbol for a bridge or tunnel. This makes the orthogrid style cumbersome to draw for larger functions, and probably explains the popularity of the well known (binary) Shannon expansion tree, which can be displayed free of crossings, thus as a planar a-cyclic graph. Path sharing is essential to recognize common factors, which is a clue to logic synthesis, showing the power of BDD and othogrid representations.
5.2.2 Factoring Paths by a Planar Node Definition A planar node in an orthoplot connects all paths through it. For instance the circled node in Fig. 5.1, and in fact all edge-nodes. All such paths are cut in two parts: each first section from the origin is continued (multiplied) by all second sections to the final diagonal. A function F with all paths (minterms) passing through a planar node is a product F = G ∗ H of two functions G(X) and H (Y ) sharing no inputs, so X ∩ Y = ∅. G is a rank function, and in Fig. 5.1: G(a, b) and H (c, d) are factors of F . A planar node plays the role of a factor node. Planarization is essential for synthesis, obtained by a proper choice of the ordering and polarity of inputs. Counting occupied gridpoints (nodes), multiple for non-planar nodes, yields a good factoring criterion for logic optimization (planarization):
72
5 Symmetric and Planar Boolean Logic Synthesis
Fig. 5.2 Planarize by permuting and/or inverting inputs
• Permute and invert (phase) inputs to minimize node count N . Alternatively the number of links L, counting transistors, can be minimized. Node count N dominates over link count for practical technological reasons. Because a bridge requires two via’s to another metal layer, costing more than a transistor which is simply a polysilicon line crossing (self aligned) a diffusion path [10, Chaps. 3 and 5.4.6]. In factored form Fig. 5.1, permuting and inverting inputs yields the minimal (N, L) = (6, 8) values of the three gridplots of F . This orthogrid representation allows characterization of special types of Boolean functions such as symmetric-, planar- and rank-functions, to be considered next. Notice the maximally 2n minterms are plotted in a square grid of n2 nodes, by virtue of dense path sharing as partial factors. Actually a half square suffices, up to diagonal n; the other half plane could be used for the complement or dual of F , as used in CMOS technology (Complementary MOS) [10].
5.3 Symmetric and Threshold BF’s The well known Pascal Triangle, displayed in orthogonal grid fashion (Fig. 5.3), gives in each node the number R(i, j ) of all paths connecting that node to the origin. This is easily verified by its generation rule: R(i, j ) = R(i − 1, j ) + R(i, j − 1) is the sum of its predecessor node path counts. Induction yields the path counting rank spectrum. Clearly the XOR-product function F (a, b, c, d) of Fig. 5.1 is not symmetric in all inputs, but it has two partial symmetries or input equivalences (permute without changing F ), written a ∼ = b and c ∼ = d. Detecting and enhancing such partial symmetries is the basis of the ‘ortolog’ algorithm (Sect. 5.5).
Fig. 5.3 Binomial path-count for full ranks
5.3 Symmetric and Threshold BF’s
73
A rank = 2 symmetric function in 4 inputs contains all minterms of rank 2, otherwise it cannot be a SF: there are (2 of 4) = 6 minterms. In fact a full rank has a binomial coefficient number of minterms. Notice in Fig. 5.1 there are two paths missing from a full rank = 2: 0011 and 1100 (see dotted lines), so F is not symmetric.
5.3.1 Symmetric Functions ‘Count’ Define a symmetric function SF as invariant for permuting its inputs. Hence a function SF is symmetric in all inputs if it depends only on the number of high inputs in each minterm, and not on their ordering. The ranks of a SF are either full or empty, so: • A symmetric function SF[R] is determined by the set R of its full ranks, which is a subset of {0, . . . , n} An n-input function has n + 1 ranks, with 2n+1 subsets, which is precisely the number of symmetric functions of n inputs. For instance the parity function is symmetric: it is active for each minterm with an odd number of 1-inputs. So the odd ranks are full, and all even ranks are empty: Parity(X) = SF[odd], such as the sum function of a 3-input Full Adder. Symmetric functions count , typical for arithmetic. The well known ORn function of n inputs is symmetric, written SF n [>0]: at least one high input, so only rank 0 is empty (see Fig. 5.4). The ANDn function of n inputs is SF n [n], thus active only if all n inputs are high, so only rank n is full (containing just one minterm). And in a 3-input Full-Adder (FA): sum s = 1 iff 1 or 3 inputs are high, so ranks [1, 3] are full, written s = SF[1, 3]. And the carry c = 1 iff 2 or 3 inputs are high, so c = SF[2, 3]. Most BF however are not symmetric in all inputs, although many have partial symmetries (in some inputs). A factored function F cannot be symmetric, since inputs to different factors are not equivalent. So an SF has no factor, explaining why most logic synthesis tools, based on factoring, have trouble with efficient decomposition. This suggests putting SF’s in the Cell Library, with 2k cells SF k of k inputs, halving the number of cells by using an inverter to exploit SF(−X) = −SF(X).
Fig. 5.4 Rank plots of logic gates, and arithmetic Full Adder (FA)
74
5 Symmetric and Planar Boolean Logic Synthesis
5.3.2 T -Cell Library, Threshold Logic Cells Define a threshold function Tk of n inputs, with a threshold 1 ≤ k ≤ n, to be active Tk = 1 whenever at least k inputs are active (= 1). Any SF can be implemented by threshold logic functions TF as follows. The full ranks of an SF occur in intervals [i, . . . , j − 1] of successive ranks. Each interval of full ranks is the AND of two threshold functions Ti .Tj so an SF with m fullrank intervals is the sum of m TF pair products. For instance the FullAdder sum output (Fig. 5.4) yields: S[1, 3] = (T1 .T2 ) + T3 ,
using the inverse of carry T2 .
There are just n TF functions of n inputs, with thresholds 1, . . . , n. They form a compact and complete T -cell Library. Including an inverter, a T-cell library contains sum(1, . . . , n) = n(n + 1)/2 cells, that is 10 cells if n = 4, or 15 cells for n = 5. This is less than a complete S-cell library of 1 + (3 + 7 + 15) = 26 cells (n = 4), or 57 cells (n = 5), which however will yield more efficient synthesized circuits (see Sect. 5.6 on experiments).
5.4 Planar Cut and Factoring The smallest asymmetric functions are: a(b + c), a + bc and a b, a + b. The first two cases use both (.) and (+) where the role of a essentially differs from b, c which are equivalent (permutable). The last two cases are asymmetric in (a, b) but symmetric in (a, b). In general, input phasing costs little, making a function more symmetric and increases local symmetries (with dense path sharing), thus improving logic optimization (Figs. 5.1, 5.2). In fact, it appears that: the two basic causes for asymmetry are: factoring and inverse. Spectral product, and planar cut: Function F = G(X) H (Y ) is a disjoint product if factors G and H share no inputs, so X ∩ Y is empty. Multiplying the rank spectra sp(G) and sp(H ), as a convolution, yields the spectrum of composition F = G.H : sp(GX .HY ) = sp(GX ) ∗ sp(HY ).
(5.1)
Order input sets X and Y adjacent in the gridplot. Each path in G(X) is continued by (in series with) each path in H (Y ), thus forming all paths (minterms) of length |X| + |Y | in F , implying spectral product rule (5.1). Let |X| = m then the gridplot of F has diagonal m consisting of only planar nodes, called a planar cut, with corresponding factor property. For example G = a # b and H = c + d + e have spectra G[0, 2, 0] and H [0, 3, 3, 1] and m = 2. Then product function F = G.H has as spectrum the product [0, 3, 3, 1] × [0, 2, 0] = [0, 0, 6, 6, 2, 0] (longhand multiplication without carry).
5.5 Fast Symmetric Synthesis: Quadratic in nr. Inputs
75
5.5 Fast Symmetric Synthesis: Quadratic in nr. Inputs The ‘Ortolog’ algorithm is designed for global yet fast detection of (partial) symmetries, enhancing them by input phasing. The rank spectrum is a simple and fast symmetry test for any sub function, by checking if each rank is full or empty. The input format is that of a PLA (2-level and/or logic), hence a list of cubes as generalized minterms, each with all n inputs (length n strings over 1/0/– for input straight or inverse or independent). The algorithm is double recursive: start with a minimized 2-level logic BF n (X) as a list of m cubes, and proceed as follows: 1. Core(a, b): Collect all cubes symmetric in a, b for each input pair (a, b). Maximize core by choosing input phase a if Core(a, b) has more cubes. 2. Input-expand maximal (phased) paircores to Core(a, b, Y ) with inputs c (or c) from rest-input set Y . Criterion: maximize |Core| × |inputs|2 , preferring wide (more inputs) over deep Core (more cubes). Select one such ‘best’ multi input Core(Z), symmetric for all inputs in Z ⊆ X. Let Y = Z = X − Z. 3. Factorize Core(Z)= n0 Gr (Z) ∗ Hr (Y ) for ranks r ≤ n with non-zero symmetric rank-functions Gr (Z) as factors (planar cut). 4. Recursively decompose (1-4) cofactors Hr until all components are symmetric. 5. Recursively decompose (1-5) remainder F (X) − Core(Z), yielding an optimally phased network of symmetric functions coupled by inverters. Speedup option: First partition F by collecting cubes with equal number of don’t-cares (DC class), since cubes symmetric in the same subset of inputs likely have the same number of DC’s. Decompose the k subfunctions FDCi separately, and OR them: F = k1 FDCi . The SF components can be implemented by T -cells, if a small T -cell library is preferred. However, not decomposing the SF cells yields better area efficiency, using their grid plot as layout pattern on silicon (grid template), maximally sharing logic paths. The time complexity of the algorithm is O(n2 m), for a BF n list of m cubes with n inputs (step 1 is quadratic in n). So only quadratic in the number of inputs (not exponential), and linear in the number of cubes. This allows very fast synthesis of many alternatives in a search for an optimal binary code at a higher level, as described in Chap. 6: error correction codes in Boolean circuit design [6–8], or state-machine logic [9].
5.6 Experiments and Conclusion The described symmetric synthesis with a 15 T -cells (max 5 inputs) library was compared with a known tool Ambit (Cadence) using a basic library of ANDn /ORn /inv (n = 2, . . . , 5) cells, or the usual extensive (full) library of several hundreds of cells. The logic density is the 0/1 filling % in the PLA table to be decomposed. Rather than number of cells, the total number of cell pitches is compared in Table 5.1 as area estimate.
76
5 Symmetric and Planar Boolean Logic Synthesis
Table 5.1 Comparison of synthesis areas (Standard cell # pitches) cct
# inp
# cub
% density
Ambit
Ambit
Ortolog
Ratio
binom5
6
32
74
(126)
128
148
0.86
cordic
22
27
24
(135)
226
194
1.16
table3
14
52
75
(448)
718
902
0.80
parity
4
8
100
(18)
41
48
0.85
AOI
TC
Cell-Lib:
(full)
AOI/TC
The threshold T-cell library is too restricted to compete with the usually very large cell libraries, since most BF n do not have sizable local symmetries. Lacking special cells, such as XOR in the parity function, the area cost of T -cell mapping of SF’s is high. The Ortolog algorithm performs fast global analysis, including phase assignment, of local symmetries in a BF n . So one can employ it to detect, and enhance by input phasing, the (dense) symmetric parts of a circuit, for separate symmetric synthesis, with the remaining (sparse) asymmetric logic to be synthesized otherwise. Moreover, its fast execution allows one to run it thousands of times within a few hours in order to optimize error correction code alternatives, with synthesized logic area as cost criterium, as reported in the next chapter. Flexible compiled cell logic synthesis by a wider class of planar BF, derived from symmetric SF n as programmable grid template, is described next.
5.7 Planar Boolean Logic Synthesis The efficiency of decomposing to a network of symmetric Boolean functions clearly depends on the amount of (local) symmetries in the initial BF. Table 5.1 shows that restriction to a library of AND/OR (column AOI) resp. threshold T -cells (column TC) is too severe: results do not compete with the usually large cell library, except the cordic circuit which has much structure, viz. many local symmetries. Symmetric components SF k , with dense sharing of logic paths, should not be mapped onto T -cells, since the cost of decomposition is too high. Rather, they should be implemented directly as planar compiled grid cells. Definition A planar Boolean function PF n has a planar gridplot, possibly after permuting and inverting inputs and/or inverting the output. A symmetric SF n is planar, having a gridplot with only planar nodes.
(5.2)
A symmetric SF n can generate a set of planar functions is follows. Let a ‘link’ be a path of length = 1 anywhere in a gridplot of some SF n , in an MOS (metal oxide silicon) technology implementation corresponding to a transistor.
5.7 Planar Boolean Logic Synthesis
77
Any SF n is then a ‘template’ for a class of PF n derived from it by removing one or more links. Conversely, any PF n has a unique smallest covering SF n , with the same set of non-empty ranks. The class of PF is much larger than SF, while being easily derived by ’programming’ (deleting links from) the SF’s as templates. The number of links in any SF n is maximally n1 2i = n(n + 1), hence in the order of |PF n | = 2n(n+1) planar functions of n inputs. Compared to |SF n | = 2n+1 there are some 2n times more planar functions of n inputs than there are symmetric functions. A more precise estimate requires further investigation, for PF n as logic synthesis components.
5.7.1 All BFn Are Planar upto n = 4 Inputs Define the ‘structure’ of a Boolean function to be invariant under some symmetry transformation. For instance: • Permute/complement some or all inputs and/or complement the output. This defines the so called structural pcio equivalence between functions BF n (X) of n inputs X = (x1 , . . . , xn ). For instance the ‘dual’ F (X) of F (X): complementing all inputs and the output preserves structure. The Boolean 2-input logic gates AND(a, b) and OR(a, b) are each others dual, since by De Morgan’s law a + b = a.b and conversely a.b = a + b, so complementing both inputs and the output transfers them into each other (‘same structure’ = isomorphic). ‘Planarity’ is a structural property of Boolean functions. Crossing of paths requires at least three inputs, so n ≥ 3 for non-trivial planar BF n . In fact all BF n with n ≤ 4 inputs are shown to be planar, thus each BF n (n < 5) is pcio equivalent to some n-input function with a planar ortho-plot, to be shown by complete inspection. Of a given BF n each of the 2n input combinations (minterms) has a value true ‘1’ n or false ‘0’. So there are 2(2 ) Boolean functions of n inputs. By convention only the true minterms ti are listed (Fig. 5.6), and a BF n is the OR of its minterms in arbitrary order. Define the ‘weight’ of a BF n as the number of minterms making the function true, denoted W (BF n ) ≤ 2n . Exclude the trivial true BF n (X) = 1 and false BF n (X) = 0 functions, and the functions that in fact depend on less than n inputs. Then there are only seven pcio equivalence classes among the 28 functions in BF 3 (Lemma 5.2). This will be shown, using ortho-plot and spectrum, starting at n = 1: BF 1 (x) is x or x, equivalent under input inversion, so there is one equivalence class for n = 1. Lemma 5.1 There are two pcio-equivalence classes of functions BF 2 , equivalent to Z(+) and Z(.) mod 2, respectively XOR(a, b) and AND(a, b).
78
5 Symmetric and Planar Boolean Logic Synthesis
Proof The full spectrum [1, 2, 1] of BF 2 (a, b) = 1 covers the next non-trivial spectra of increasing weight: [0, 0, 1], [0, 2, 0], [0, 1, 1], [1, 1, 1] and [0, 2, 1]. However, the latter two have complemented spectrum [0, 1, 0] resp. [1, 0, 0] which are pcio equivalent to [0, 0, 1]. Moreover [0, 1, 1] represents ab + ab = a(b + b) = a or ab + ab = (a + a)b which do not depend on b resp. a, to be discarded as well. This leaves only two distinct pcio classes for n = 2, with spectra [0, 2, 0] and [0, 0, 1] for Boolean expressions ab + ab = XOR(a, b) and ab = AND(a, b). In fact they are the two basic arithmetic operations Z(+) and Z(.) mod 2, represented in Fig. 5.5.
Lemma 5.2 There are seven pcio-equivalence classes of functions BF 3 , all corresponding to planar functions. Proof The proof is by inspection of spectra and corresponding equivalent functions. The full spectrum [1, 3, 3, 1] of BF 3 (a, b, c) = 1 covers all 3-input spectra. Spectra of weights 5, 6 or 7 are obtained by function (output) complementation of BF 3 with weights upto 4. Moreover, the spectrum of any BF n is mirrored by inverting all inputs. Table 5.2 shows the five symmetric SF 3 , with spectra [*] having only empty or full ranks. The other non-equivalent BF 3 spectra of weight ≤ 4 are derived from these. Write a − b for XOR(a, b), and ∼ = for pcio-equivalence. All five non-eqv. spectra [∗ ] of symmetric functions SF 3 are planar by (5.2). By inspection the remaining two non-eqv. spectra of BF 3 correspond to planar functions. Moreover:
Fig. 5.5 The two basic BF 2 (a, b) equivalence classes: XOR2 and AND2 Table 5.2 The seven pcio-eqv. BF 3 classes; five are symmetric SF 3 [. . .]∗ Weight W
Spectrum
Functions of W < 5 in BF 3
Pcio-eqv. spectra
1
[0, 0, 0, 1]∗
abc
all single term functions
2
[1, 0, 0, 1]∗
abc + a b c
[0, 1, 1, 0] by c → c
3
[0, 0, 3, 0]∗
2 high inputs, one low inp.
[0, 2, 0, 1] by c → c
4
[0, 0, 3, 1]∗
2 or 3 high inps. (FA-carry)
[0, 2, 1, 1] by c → c
4
[0, 3, 0, 1]∗
1 or 3 high inps. (FA-sum)
[1, 0, 3, 0] by c → c
2
[0, 0, 2, 0]
a(b − c)
3
[0, 0, 2, 1]
a(b + c)
[0, 1, 0, 1] by b → b [0, 1, 1, 1] ∼ = [0, 1, 2, 0]
5.7 Planar Boolean Logic Synthesis
79
Fig. 5.6 Max-crossing XF 3 with one crossing (left), and planarized (right)
[0, 0, 1, 1] of ab(c + c) = ab is shifted full spectrum BF 1 (c): not in BF 3 ; [0, 1, 2, 1] of F (a, b, c) = a is shifted full spectrum BF 2 (b, c): not in BF 3 ; [0, 2, 2, 0] of XF 3 has planar complement [1, 1, 1, 1] → a − c in BF 2 ; (Fig. 5.6). The smallest case of a crossing is in BF 3 (Fig. 5.6: terms t1 , t3 at b, c). As an exercise to find non-planar functions, consider the worst case BF n with a maximum number of crossings: the n-input ‘maximal crossing function’ XF n for each n > 2. Such function is unique, having one crossing at each non-edge ‘inner node’ of its ortho-plot, thus n−2 i i=1 crossings, with near-flat spectrum [0, 2, . . . , 2, 0] (Figs. 5.6–5.8). Crossings are characterized by: A crossing node has only [. . . , 0, 0, . . .] and [. . . , 1, 1, . . .] term subsequences. (5.3) Including subsequences [. . . , 0, 1, . . .] [. . . , 1, 0, . . .] yields a planar crossing. (5.4) A node missing just one of these cannot be implemented, because any conducting contact between the two crossing paths of (5.3) implies both subsequences in (5.4), for brevity referred to as diagonal connections. As examples of planarization consider crossing functions XF n for n ≤ 5. Lemma 5.3 XF n>2 with a crossing at each inner node has a near flat spectrum [0, 2, . . . , 2, 0] and is planarized for n ≤ 5 by swap xn ←→ x2 with spectra [1, 1, 1, 1] for n = 3, [1, 1, 2, 1, 1] for n = 4, and [1, 1, 2, 2, 1, 1] for n = 5. Proof By construction of XF n the columns of first input x1 and inverted last input xn are identical. Permuting xn and x2 yields a planar ortho-plot only for n = 3, 4, 5—seen by inspection as follows. Maximal crossing function XF 3 (a, b, c) is given in Fig. 5.6: the crossing node is not planar due to missing terms [1, 0, 1] and [0, 1, 0]. The plot is planarized by permuting inverted last input c and second input b, yielding a flat spectrum [1, 1, 1, 1]. In general the spectrum varies with input inversions, but the sum total of minterms (paths) is invariant.
80
5 Symmetric and Planar Boolean Logic Synthesis
Fig. 5.7 Maximal crossing XF 4 with three crossings (left), and planarized (right)
Fig. 5.8 XF 5 with 6 crossings (left), and planarized (right)
Maximal crossing function XF 4 has three crossings (Fig. 5.7), one at each inner node, with spectrum [0, 2, 2, 2, 0]. It is planarized by swapping (d, b) which yields spectrum [1, 1, 2, 1, 1]. No other BF 4 exists with a crossing at each inner node due to the absence of diagonal connections (5.3). Maximal crossing function XF 5 (a, b, c, d, e) (Fig. 5.8) has six crossings and spectrum [0, 2, 2, 2, 2, 0]. Permute (e, b) to planarize XF 5 with near flat spectrum [1, 1, 2, 2, 1, 1]. The crossing node at [0, 0, 1, 1] and [1, 1, 0, 0] is planar since all four subsequences of (5.3) and (5.4) are present. The aim of input inversions is to minimize the Hamming distance D between subsets (pairs) of columns in the minterm representation of a BF n . A permutation then clusters such minimal distance columns, and orders these clusters left-to-right with increasing mutual distance. For instance in XF 5 (Fig. 5.8) the zero distance cluster D(a, e) = 0 is placed leftmost, followed by pair (c, d) with D(c, d) = 2. In fact, by the structure of XF n holds D(xi , xi+1 ) = 2 for 1 ≤ i < n, and pairwise clustering without inversions, except D(x1 , xn ) = 0, is optimal. Definition A function F (X, y) ∈ BF n+1 is an extension of F (X) ∈ BF n if F (X, 1) + F (X, 0) = F (X). Theorem 5.1 All Boolean functions BF n for n ≤ 4 are planar.
5.7 Planar Boolean Logic Synthesis
81
Fig. 5.9 Planarization in BF 4 of the five (Table 5.2) extended BF 3 functions
Proof A crossing requires at least 3 inputs, so by Lemma 5.2 it suffices to show that each 4-input function in BF 4 is a planar extension of some function in BF 3 . Each planar representative of the 7 pcio-equivalent classes (Table 5.2, column spectrum) is considered for initial non-planar extension, to be shown easily planarized. Only functions with ranks 1 and 2 of value at least 2 can be extended in a nonplanar fashion, to produce a crossing at node [0, 0, 1] and/or [1, 1, 0] as in Fig. 5.9. This excludes the first two functions (W = 1, W = 2) leaving the remaining five functions to be considered. Path extensions by extra input d are chosen such that two paths cd and c d form a non-planar crossing. It is readily verified (see Fig. 5.9) that this can in all five cases be planarized, for each of the chosen extension paths (dashed) at the remaining enddiagonal node ‘o’ of the considered BF 3 function. Namely by using inverted inputs c and d. Moreover, in the middle case sp[0, 3, 0, 1] (Full Adder sum function) with extension spectra sp[0, 2, 1, 0, 1] and sp[0, 2, 1, 1, 0] the input pairs (a, b) and (c, d) must be swapped as well. The smallest non-planar Boolean functions are in BF 5 , thus at least 5 inputs, and they cannot be planarized by input permutations and/or input/output inversion(s). For instance the function BF 5 in Fig. 5.10 as non-planar extension of a BF 4 function, where ‘v’ denotes a non-planar crossing, and ‘∗’ a remaining non-planar node with two diagonal connections (5.4).
82
5 Symmetric and Planar Boolean Logic Synthesis
Fig. 5.10 Non-planar BF 5 function, as extension of a planar BF 4 function
References 1. N.F. Benschop: “Symmetric Boolean Synthesis with Phase Assignment”, Information Theory Symposium, U-Twente, Enschede, 2001 2. K. Akers: “Binary Decision Diagrams”, IEEE Comput. C-27, 509–516 (1978) 3. R. Bryant: “Graph-Based Algorithms for Boolean Function Manipulation”, IEEE Comput. C-35, 677–691 (1986) 4. J. van Eijndhoven: “CMOS Cell Generation for Logic Synthesis”, ASICON’94, 75–78, W.Y. Yuan (ed.), Beijing, 1994 5. T. Courtney et al.: “Multiplexer Based Reconfiguration for Virtex Multipliers”, Field Prog. Logic Appl., FPL2000, 749–758, Villach, Austria, 2000 6. G. Muurling: “Fault Tolerance in I C Design Using Error Correcting Codes”, MSc thesis, TUDelft, NL, 2000 7. G. Muurling et al.: “Error Correction for Combinational Logic Circuits”, 21st Symposium on Info-Theory, 25–31, Wassenaar, NL, 2000 8. R. Kleihorst et al.: “Experiments with Fault Tolerant I C Design Using Error Correcting Codes”, International Online Testing Workshop, Sicily, 2001 9. N.F. Benschop: “Structure of Constant Rank State Machines”, IFIP Workshop Logic and Architecture Synthesis, 167–176, Paris, 1990 10. M.J. Howes, D.V. Morgan: “Large Scale Integration”, Wiley, New York, 1981
Chapter 6
Fault Tolerant Logic with Error Correcting Codes A method for error correction in integrated circuit (IC) implementations of Boolean functions is described. Additional logic, implementing error correcting codes known from channel coding, corrects both ‘hard’ manufacturing errors and ‘soft’ temporary errors. Experimental results are presented, with code optimization based on a fast algorithm for Boolean symmetry analysis. Apart from the well known majority voting (triplication), Hamming- and Product codes are described, having an implementation overhead much less than for majority voting.
6.1 Introduction In recent technologies for Integrated Circuits (ICs) one can distinguish two types of malfunctioning behavior, namely ‘hard’ and ‘soft’ errors [2]. Defects occurring during the manufacturing of ICs, for example due to dust particles, cause the implemented logic to be malfunctioning. These errors can be detected by structural IC testing. Especially with the current increase of IC area, the yield (the percentage of correctly manufactured chips) is dropping [17]. ‘Soft’ or ‘transient’ errors are temporary faults that occur during circuit operation, for instance caused by radiation and alpha particles from the package or the environment, supply voltage variations and timing glitches. There is an increasing interest in making circuits more reliable in the presence of such errors. This can be achieved by making IC implementations fault tolerant using error correction circuitry. Pioneered by Von Neumann [3] in the fifties, error correction of Boolean logic circuits has regained interest [4, 5]. See also [6–9] for different ways to treat soft and hard errors. Error correction operates by adding redundancy that allows the errors to be detected and corrected. The more redundancy is added, the more errors can be corrected. The redundancy is in the form of an encoding circuit, while a decoding circuit corrects the errors. Correction of circuit defects differs in some important aspects from transmission error correction [6]. In error correction for transmission (channel coding) the rate of a code, that is the amount of redundant transmitted information to correct transmission errors, is usually the most important code parameter. The complexity of the encoder and decoder is less important, provided they are within reasonable limits. Contrary to channel coding, an error-protected Boolean circuit does in general not produce all possible code words, since some may not occur as circuit outputs Co-authors: R. Kleihorst, R.v.d. Vleuten: Philips Research, Prof. Holstlaan 4, Eindhoven, NL. G. Muurling (MSc thesis), prof. J. Simonis: TU-Delft, Mekelweg 4, Delft, NL. N.F. Benschop, Associative Digital Network Theory, © Springer Science + Business Media B.V. 2009
83
84
6 Fault Tolerant Logic with Error Correcting Codes
(don’t-care code words). Hence a logic circuit represents a non-invertible process from input to output, essentially different from channel transmission. The proposed method finds a new application for the error-correcting codes known in channel coding. Error patterns are considered at the functional level. So this method is capable of correcting both hard and soft errors, independent of error causes. This is a major advantage over other methods. The design of the original circuit is hardly affected, since the error correction circuit is simply added, mainly in parallel, to the original design. A minimum of error correcting gates is in series with the datapath, minimally affecting its performance (timing behavior). Overview: Section 6.2 describes the context of IC design which is important for the presented method. In Sect. 6.3 some design criteria are discussed, and the various methods applicable to fault tolerant IC design are reviewed. Sections 6.4 and 6.5 give some examples, including code optimization. In Sect. 6.6 follow conclusions and suggestions for further research.
6.2 Fault Tolerant IC Design Environment Figure 6.1 shows a typical IC as system-on-a-chip (SoC) containing memory, logic circuitry C, registers R and their interconnections. The memory consists of embedded RAMs and/or ROMs and the connections or wiring are usually implemented as busses. The logic circuitry consists of blocks of Boolean logic gates, coupled by clocked registers, called Register Transfer Logic (RTL). Memory, logic and registers/busses each occupy typically one third of the active silicon area. Error correction for logic circuits is different from error correcting random access memories (RAMs). For RAMs, the outputs are identical to the inputs, in the absence
Fig. 6.1 IC environment: synchronous logic at register transfer level
6.2 Fault Tolerant IC Design Environment
85
of errors. For logic circuits, this is not the case, which significantly increases the complexity of the encoding circuit for error correction, as shall be illustrated. In correcting circuit errors the complexity of encoding and decoding circuits is a significant factor in the total circuit cost. Furthermore, the decoding circuit that performs the final error correction cannot be completely protected from errors (although errors in its operation can be detected by making the circuit totally self checking [6]). For this reason the decoding circuit must be kept small compared to the circuit to be protected.
6.2.1 Implementation at Register Transfer Level Synchronous IC design is specified at register transfer level (RTL, Fig. 6.1). All data registers R are clocked by the same clock signal, with a frequency determined by the maximum delay (logic depth) of the combinatorial circuits C between the registers. Well known techniques are used for protecting RAMs and ROMs, such as spare columns of memory cells replacing defective columns [6]. However, the protection of Boolean logic circuits received relatively little attention, so this will have emphasis. Moreover, registers and busses can be protected at no extra cost. To protect logic circuit C against malfunction (Fig. 6.2) an extra encoder circuit E is placed in parallel with C, with the same inputs. Its function is to extend the output signals of circuit C with ‘tags’ to obtain code words in a code space with the desired Hamming distance, that is the number of bits that two code words differ, for instance three for single error correction [10, 11]. All code word bits have equal protection, so both C and E are protected from errors. But the decoder D doing the correction is not protected. The encoding to an extended code space is done in block E, which is in parallel with the original circuit, so it has little effect on circuit performance (delay time). The only extra circuit in series with the datapath logic is decoder D which consists of a few gates in cascade, slightly increasing the total delay. However, this method has much impact on area. As a rough estimate, let circuit C have area A (say 104 μm2 for a few hundred logic gates in a 0.25 μm CMOS process) with probability 10−4 of anyone of its outputs to be in error. Let single error
Fig. 6.2 Error correction in Boolean logic
86
6 Fault Tolerant Logic with Error Correcting Codes
Fig. 6.3 Register transfer logic: (a) normal, (b) protects also registers R
correction require a doubling of the area to 2A. Then the circuit will malfunction when two outputs are faulty, with probability 10−8 per original area, thus 2 × 10−8 per extended area 2A. If the original total logic area L is one third of the chip area (3L), its doubling yields an extended chip area of 4L, that is a 33% increase. The combination of C, E and decoder D accepts stimuli from assumed correct inputs to produce correct outputs, at a certain level of assurance. Based on this model an entire IC consisting of RTL blocks can be protected as shown in Fig. 6.3a.
6.2.2 Protecting Registers and Connections The assumption of correct inputs fails if the inter-module busses or registers are malfunctioning. A simple solution is to put the decoder behind the circuit output register, as shown in Fig. 6.3b. All registers and connection wires between modules are then also protected. By combining these techniques with the known methods to protect memory modules [6], fairly robust ICs can be designed. Most of the circuit is now protected, except power and clock distribution. Robust layout techniques can increase their reliability.
6.3 Three Error Correction Methods for Logic Circuits Three error correction methods to logic circuit design are now discussed.
6.3 Three Error Correction Methods for Logic Circuits
87
6.3.1 Majority Voting The error correction method that is easiest to understand and to implement is majority voting, also known as a repetition code. Here a number of redundant circuits is added, each identical to the original circuit that is to be protected, and operating on the same input data. The output is taken to be the result produced by the majority of the circuits. Thus, to correct a single error, two redundant circuits have to be added. If one of the three circuits produces an erroneous output, and the other two circuits produce the correct result, then the majority yields a correct output. Detecting—rather than correcting—a single error, requires only one redundant circuit. A faulty circuit is detected by comparing the outputs of the two circuits. Majority voting has the advantage of no additional circuit design effort, and it has a simple correction circuit, causing little extra delay. However, the threefold increase in logic area (and power consumption) is larger than for other methods. Majority voting is an extreme case in the solution space of methods for error correction. To minimize the total cost, an error correction method requiring a much lower increase in chip area and power dissipation is preferred, at the cost of a small increase in design effort and complexity. Two such methods are now discussed.
6.3.2 Hamming Codes (Block Codes) In the Hamming code error correction method, the size of the encoding circuit is proportional to the amount of redundant extra information (viz. signal tags). So less redundancy translates to a smaller area overhead. Research on error correcting codes has led to more efficient codes, thus codes that need less redundant information to be added for the same correction capabilities [11]. In the wide selection of error correcting codes, consider Hamming codes because they have a low-complexity decoding circuit, and are most efficient for correcting single errors. A systematic Hamming code does not recode original outputs. Because of these properties, they are widely used today, over 50 years after their invention [12]. A disadvantage of the Hamming code is that it corrects only a single error in the outputs of a circuit. However, a single defect on the chip can cause multiple output errors in case they use common intermediate results. In order to guarantee correct operation, the output functions should be independent from each other, thus only depend on input signals and not share common sub functions. Therefore special logic synthesis must be used, and the generated circuit may occupy a larger area. For these reasons, a different solution is preferred.
6.3.3 Product Codes (Array Codes) As explained, it is preferred that all outputs of a logic circuit need not be independently derived from the inputs. So an error correcting code must be able to correct
88
6 Fault Tolerant Logic with Error Correcting Codes
burst errors [11], meaning that several outputs are in error simultaneously. Burst error correcting codes can protect multiple independent logic circuits (or independent parts of a single large circuit). Codes that are often used for burst error correction are the Reed-Solomon codes [11]. However, the decoding circuit for these codes is too complex relative to the complexity of the circuits to be protected. Hence less efficient codes, yet with low complexity encoding and decoding circuits, are of interest. The selected codes are known as array codes [13] or product codes. A product code places all outputs in a rectangle (matrix), adding a parity bit to each row and each column of the matrix, computed by the encoder directly from the relevant inputs. By placing the outputs of each circuit on the same matrix diagonal [13], all output errors of one faulty circuit are corrected, called burst error correction. Both the Hamming code and the normal product code have the disadvantage that all outputs must be independently synthesized, without using possible common sub functions. The diagonal product code method does not have this drawback, since it can correct burst errors per circuit.
6.4 Demonstration of Experimental Circuit To demonstrate the impact of the various protection techniques they will first be analyzed for a fairly simple circuit (Fig. 6.4). This design consists of a 4-bit counter (implemented as a state machine) with a 7-segment display decoder as the output function. In total the design has four inputs and eleven outputs, to be protected by either majority voting, Hamming code or normal product code, and these methods for single error correction will be compared. In Sect. 6.5 the proposed methods will be applied to more complex circuits. The (area) overhead “factor” is defined as the ratio of the final (protected) design area over the original design area.
Fig. 6.4 Original BCD counter design
6.4 Demonstration of Experimental Circuit
89
Fig. 6.5 Majority voting protection
Table 6.1 Majority vote protection costs Circuit
Area (μm2 )
Factor
BCD counter
2421
1.0
encoder
4842
2.0
decoder
693
0.29
1 gate
7956
3.29
1 gate
total
Delay
Prot. Y Y N
• Majority voting In the majority voting method the design is copied twice. Special threshold gates compare the outputs and produce the majority. If an error occurs in one of the outputs, majority voting gives the correct answer. Figure 6.5 shows a design protected by majority voting. Area costs (in μm2 ) of majority voting are shown in Table 6.1. The overhead due to the encoder dominates, while the decoder/corrector (voting mechanism) overhead is a small amount per output, which is an unprotected part of the circuit. Although costly, the majority voting performs well, as multiple errors in any of the three copies are corrected, with only one extra threshold cell delay. • Hamming protection This method is based on a systematic Hamming code [10, 11]. The schematic of the example design is shown in Fig. 6.6. The 11-bit output is embedded into a distance-3 code space by adding four tag bits according to a (15, 11, 4) Hamming code, generated by encoder circuit E. The tags are generated from the circuit inputs by a Boolean gate network (encoder E) which in general is highly non-linear, in contrast to transmission line Hamming codes [11]. The decoder circuit D checks if the 15-bit combination of the eleven original outputs and the four tags is a valid code word. A detected error in one of the eleven
90
6 Fault Tolerant Logic with Error Correcting Codes
Fig. 6.6 Hamming code protection
original outputs is changed by the decoder via the corresponding XOR gate, yielding the nearest code word. The first column in Table 6.2 holds the present state (input) signals. The remaining columns show the desired BCD counter next state, the outputs for a 7-segment display, and the tags, forming the 15-bit Hamming code words. The various logic functions in Table 6.2 were synthesized by the Ortolog tool [14]. This tool analyses and enhances the (local) symmetries of a Boolean function. It has a time complexity of only O(n2 ) per BF n of n inputs, much lower than the expected exponential growth. This fast algorithm is used for obtaining an estimate of the complexity of a synthesized BF n , applied by randomly searching for optimal codes. The tags were chosen in order to minimize the silicon area of the encoder. A complete search of all possible 15-bit Hamming codes was done, and the resulting Ortolog- synthesized circuit areas were listed. The minimum area found was 333 μm2 , versus max. 1521 μm2 , stressing the importance of code optimization: max/min area ratios of upto ten were observed for some circuits. For larger circuits a complete search is not feasible, prompting further research regarding optimization. The optimized Hamming code syndrome computation matrix in the decoder is given by Table 6.3. The inner product of its rows with the [output, tag] string are computed. This results in a 4-bit syndrome, which if non-zero is the faulty output ‘address’ (one of the first 11 columns of Table 6.3), to be decoded for driving the XOR gate which corrects that output. Notice the decoder size is proportional to the number of code word bits. The correction circuit size depends only on the number of outputs. So the number of inputs and original design complexity play no role, but do influence the encoder area [1].
6.4 Demonstration of Experimental Circuit Table 6.2 BCD counter: Hamming code protection
91
State
Next-state
7 segments
Tags
0000
0001
0010010
1100
0001
0010
1011101
1100
0010
0011
1011011
1000
0011
0100
0111010
1000
0100
0101
1101011
0010
0101
0110
1101111
0001
0110
0111
1110010
0010
0111
1000
1111111
0001
1000
1001
1111010
1000
1001
0000
1110111
1000
Table 6.3 Hamming code syndrome computation matrix BCD state
7-segment outputs
Tags
1
1
1
1
1
0
1
0
0
1
0
1
0
0
0
1
0
0
1
0
1
1
1
1
1
0
0
1
0
0
0
1
0
0
1
1
1
0
1
1
1
0
0
1
0
0
0
1
1
1
0
1
1
1
0
1
0
0
0
1
Table 6.4 Hamming code protection costs
Circuit
Area
Factor
BCD design
Delay
Prot.
2421
1.00
Y
encoder
333
0.14
Y
decoder
2538
1.05
4 gates
N
594
0.25
1 gate
N
5886
2.44
5 gates
correction total
Table 6.4 gives an overview of the silicon areas occupied by the various parts of the Hamming-code protected counter circuit. The decoder and corrector are in series with the signal path so they cause an additional delay. The decoder consists of XOR trees for fast syndrome calculation. Note that a large part of the area (decoder + corrector: 1.30 of total 2.44) is unprotected, so the Hamming method is not suitable for such a small design, yet quite practical for larger designs (see Sect. 6.5). • Product code method This method is based on normal product codes [11, 13]. The principle is shown in Fig. 6.7. All output bits are arranged in a 3 × 4 matrix. The tags, computed from the inputs by encoder E, are the horizontal (row) parities and vertical (column) parities.
92
6 Fault Tolerant Logic with Error Correcting Codes
Fig. 6.7 Product code protection
Decoder D computes these seven parities from the output bits and compares them with the seven parities generated by encoder E. The row and column with faulty parity indicate the output to be corrected. As a result of optimizing for minimum encoder area, the outputs are not ordered as shown in Fig. 6.7, but rather as in Table 6.5. Outputs [q0, q1, q2, q3] are the counter state-bits, [a, b, c, d, e, f, g] the 7-segment display outputs, and [p0, . . . , p6] the seven row/column parity bits. The areas found were between 756 μm2 and 2475 μm2 , a ratio > 3. The decoder consists of XOR gate trees for fast parallel parity computation, with AND gates to combine horizontal and vertical parities. The correction circuit again consists of XOR gates, one per output. Table 6.6 gives an overview of the areas of separate blocks. The decoder is now also protected, since horizontal and vertical parities are separated before their coincident AND gate, allowing single errors.
6.5 Results for Typical Designs Table 6.5 Product code: area-optimized output order
Table 6.6 Product code protection costs
93
q3
a
g
q1
e
q2
f
p1
q0
d
c
b
p2
p3
p4
p5
p6
Circuit
Area
Factor
BCD design
p0
Delay
Prot.
2421
1.0
encoder
756
0.31
decoder
810
0.33
3 gates
Y
correction
990
0.41
2 gates
N
4977
2.05
5 gates
total
Y Y
6.5 Results for Typical Designs The simple BCD counter with 7-segment decoder shown in the previous section just demonstrated the concept of various protection schemes. However, typical logic modules in ICs are much more complex. The small example gives a wrong impression of the relative merits of the three methods. The decoder-correction area depends only on the number of protected outputs, which here yields an area comparable to the original design. Some experimental results regarding more typical circuits, comparing the three error correction methods, will now be described. The next eight circuits were used for the analysis of the various error correction methods. The last four circuits were taken from practical IC designs: Sum: 4 bit sum of two 3 bit inputs. Absdiff : 3 bit absolute value of difference of two 3 bit inputs. Product: 6 bit product of two 3 bit inputs. Square: 12 bit square of 6 bit input. Pager: control logic of a pager chip with 10 inp, 6 outp. Tab3: state transition function with 15 inp, 15 outp. VLE: MPEG Huffman encoder: 39 inp, 28 outp [15]. pp16: part of linear array processor 360 inp, 176 outp [16]. C area Protection = C area+Unprotected area × 100%. The unprotected area consists of at least the output correction XOR gates, and for the Hamming codes also the decoder, see Tables 6.1, 6.4, and 6.6. If ‘protection’ is below 50% the protection effort is in vain.
Define:
94
6 Fault Tolerant Logic with Error Correcting Codes
Table 6.7 Majority voting Design
C (μm2 )
E (μm2 )
D (μm2 )
Factor
Protection
sum
1557
3114
252
3.16
83.8%
absdiff
1881
3762
189
3.10
90.0%
product
2844
5688
378
3.13
86.7%
square
4752
9504
756
3.16
84.1%
pager
4419
8838
378
3.09
91.4%
tab3
88605
177210
945
3.01
98.9%
VLE
8872
17744
1764
3.20
83.4%
pp16
150503
301006
11088
3.07
93.1%
D (μm2 )
Factor
Protection
936
3.89
62.5% 68.1%
Table 6.8 Hamming code (block code) C (μm2 )
E (μm2 )
sum
1557
3556
absdiff
1881
4509
882
3.87
product
2844
4014
2862
3.42
49.8%
square
4752
4149
3186
2.54
60.0%
Design
pager
4419
2853
2862
2.29
60.1%
tab3
88605
43911
7137
1.58
92.5%
• Results for majority voting In Table 6.7 are results of the majority voting principle applied to protect these circuits. Notice the high level of protection (except for small circuits with a relatively large number of outputs), and the large overhead factor of just over three. • Results for Hamming code In Table 6.8 the results of the Hamming code are shown (circuits VLE and pp16 are not shown, by lack of an automatic Hamming code design tool for their large number of outputs). Notice that for designs sum, absdiff and product the Hamming code with an overhead factor of more than 3 is not a good option, compared to majority voting which has an overhead factor of just over 3. The complexity of the synthesized (factored) form of a Boolean function is not known in general, so without logic synthesis one cannot predict if the majority rule is better than a Hamming code (probably only for circuits of low complexity). Note that the level of protection is determined by the size of the unprotected decoder, which is proportional to the number of outputs, versus the original circuit size. Block code methods (such as a Hamming code) are better suited to protect large circuits with a small number of outputs. Protection < 50% for the product design shows this method is futile since it yields a larger unprotected area than the original circuit.
6.6 Conclusions
95
Table 6.9 Diagonal product method C (μm2 )
E (μm2 )
D (μm2 )
tab3
88605
73728
VLE
8872
9875
pp16
150503
159855
Design
Factor
Protection
2592
1.86
98.3%
3793
2.51
71.6%
24752
2.23
89.5%
• Results for product code The normal method (for single error correction) allows in general more variation of placing outputs in a matrix, for area minimization, than the diagonal method (which however provides burst error correction for ‘linked’ outputs on the same diagonal). But the normal product method requires all outputs to be independently synthesized from the inputs, blocking efficient logic synthesis if some outputs share subfunctions. The diagonal product method can allow interdependence of outputs in the same diagonal cluster. Optimized results from the diagonal product code method as applied to circuits tab3, VLE and pp16, are reported in Table 6.9. The level of protection only depends on the number of outputs. The unprotected area is the part of the decoder combining (AND) the vertical and horizontal parity and performing corrections (XOR), which is equal in both product methods. Circuit VLE has a low protection level relative to circuit C due to large decoder corrector D for 28 outputs (4 × 7 matrix). The pp16 circuit is an array of 16 identical image processors of 63 inputs and 11 outputs each, with a total of 360 different inputs, which are partially shared. The diagonal product method uses a 16 × 11 matrix, with the sets of 11 processor outputs in successive diagonals (‘wrapped around’).
6.6 Conclusions Fault tolerant IC design is described, using three error correcting methods known from channel coding. As these schemes have different properties, the method must be chosen to fit each application. Apart from the area overhead, an important issue is the remaining unprotected area: the output corrector (and the decoder in case of Hamming protection). This area depends only on the number of outputs, which may dominate in small designs with relatively many outputs. There is a trade-off between area overhead and the level of protection. Majority voting offers the best protection, at the cost of more than tripling the design size. The Product code (diagonal) method yields a somewhat lower protection, however at half the overhead. On the other hand, the Hamming code only adds some 50% to the original size, but leaves a larger portion of the original area unprotected. The added redundancy complicates structural testing: not only the original design but also the tag signals must be scan tested to detect if hard errors are corrected.
96
6 Fault Tolerant Logic with Error Correcting Codes
For the Hamming code and product code methods, the extra delay is proportional to the number of outputs to be combined in the protection scheme (i.e. partitioning into circuits C). For high speed applications the majority voting principle is well suited, since it has the least impact on delay, namely a single threshold gate in series with the datapath. Further research concentrates on improving the various protection methods for fault tolerant IC design, focusing on code optimization.
References 1. G. Muurling, R. Kleihorst, N. Benschop, R.v.d. Vleuten, J. Simonis: “Error Correction for Combinational Logic Circuits”, Benelux Symp. Information Theory, 25–31, Wassenaar, The Netherlands, 2000 2. V. Agrawal, S. Seth, P. Agrawal: “Fault Coverage Requirement in Production Testing of LSI Circuits”, IEEE JSSC SC-17, 57–61 (1982) 3. J. von Neumann: “Probabilistic Logics and the Synthesis of Reliable Organisms from Unreliable Components”, Princeton University Press, Princeton, 1956 4. W. Evans, L. Schulman: “Signal Propagation and Noisy Circuits”, IEEE Trans. Inf. Theory 45, 2367–2373 (1999) 5. N. Pippenger: “Reliable Computation by Formulas in the Presence of Noise”, IEEE Trans. Inf. Theory 34, 194–197 (1988) 6. D. Pradhan, J. Stiffler: “Error-Correcting Codes and Self-Checking Circuits”, Computer, 27– 37 (1980) 7. M. Nicolaidis: “Time Redundancy Based Soft-Error Tolerance to Rescue Nanometer Technologies”, VLSI Test Symposium, Proc. IEEE, 86–94 (1999) 8. M. Favalli, C. Metra: “Bus Crosstalk Fault-Detection Capabilities of Error Detection Codes for On-line Testing”, IEEE Trans. VLSI Syst. 7, 392–396 (1999) 9. C. Metra, M. Favalli, B. Ricco: “Signal Coding Technique and CMOS Gates for Strongly Fault-Secure Combinatorial Function Blocks”, Proc. IEEE 174–182 (1998) 10. S. Lin, D. Costello: “Error Control Coding: Fundamentals and Applications”, Prentice-Hall, London, 1983 11. F. MacWilliams, N. Sloane: “The Theory of Error-Correcting Codes”, North-Holland Mathematical Library, vol. 16, North-Holland, Amsterdam (2nd edn.), 1983 12. K. Gray: “Adding Error-Correcting Circuitry to ASIC Memory”, IEEE Spectrum 37, 55–60 (2000) 13. M. Blaum, P. Farrell, H.v. Tilborg: “A Class of Burst Error Correcting Array Codes”, IEEE Trans. Inf. Theory IT-32, 836–839 (1986) 14. N. Benschop: “Symmetric Boolean Synthesis with Phase Assignment”, Information Theory Symposium, U-Twente, Enschede, 2001. 15. A.v.d. Werf, W. Brüls, R. Kleihorst, E. Waterlander, M. Verstraelen, T. Friedrich: “I.McIC—A Single-Chip MPEG2 Video Encoder for Storage”, IEEE JSSC 32, 1817–1823 (1997) 16. J. Hsieh, A.v.d. Avoird, R. Kleihorst, T. Meng: “Transpose Switch Matrix Memory for Motion JPEG Video Compression on Single Chip Digital CMOS Camcorder”, ICIP 2000, Vancouver, Canada 17. A.K. Nieuwland, R.K. Kleihorst: “IC Cost Reduction by Applying Embedded Fault Tolerance for Soft Errors”, J. Electron. Test. Theory Appl. 20(5), 533–542 (2004). http://portal.acm.org/ citation.cfm?id=1024106
Chapter 7
Fermat’s Small Theorem Extended to r p−1 mod p 3 By the carries involved in (p ± 1)p ≡ p 2 ± 1 mod p 3 , and by the lattice structure of Z(.) mod q for q = p ± 1 (odd prime p), all idempotents taken as naturals e < p are shown to have distinct ep−1 mod p 3 , and divisors r of p − 1 (resp. p + 1) with different primesets have distinct r p−1 mod p 3 . Moreover 2p ≡ / 2 mod p 3 for prime p, related to Wieferich primes [4] and FLT case1 for integers (Chap. 8). Conjecture: Some g|p ± 1 is semi primitive root of 1 mod p k>2 , with units group {−1, g}∗ .
7.1 Introduction In ring Z mod p k (prime p > 2) the group Gk of units (coprime to p) of order (p − 1)p k−1 , is known to be cyclic [1]. For a simplified notation parameter p (odd prime) is omitted, since the following analysis does not depend on p. Coprime factors p − 1 and p k−1 yield a units group Gk mod p k with product structure: Gk ≡ Ak Bk mod p k : core|Ak | = p − 1,
extension group |Bk | = p k−1 . (7.1)
It is readily verified that p + 1 generates extension group Bk ≡ {xp + 1} mod p k of m−1 order p k−1 . And by (p − 1)p ≡ p m − 1 mod p m+1 , p − 1 generates all 2p k−1 residues ±1 mod p of ±Bk . Core Ak ≡ {n|Bk | } mod p k is cyclic of order p − 1 for all k > 0 [6], so x p−1 ≡ 1 mod p k for each x ∈ Ak which extends Fermat’s Small Theorem (FST) to k > 1. Moreover, for the known problem of a simple rule for primitive roots of 1 mod p k (prime p > 2), consider the divisors r of p − 1, or of p + 1. It stands to reason to look for generators of Gk (primitive roots of 1 mod p k ) among the divisors r of such powerful generators as p − 1 and p + 1. − Boolean lattice of idempotents in Z(.) mod q In the lattice of idempotents in Zq (.) each pair of complementary idempotents as naturals e, f < q has sum e + f = q + 1 which, although known, is recalled in the next section. With q = p − 1, it is shown that the divisors r|p − 1 have distinct r p−1 ∈ B3 mod p 3 , and similarly for all r|p + 1. The analysis is via the lattice of idempotents in Z(.) mod q (base q = p − 1, resp. p + 1), which also have this property in B3 mod p 3 . Notice that no generator g of Gk can be in core Ak , since |g ∗ | = (p − 1)p k−1 , while the order |x ∗ | of x ∈ Ak divides |Ak | = p − 1. So p (resp. p 2 ) must divide the order of a non-core residue (resp. primitive root of 1 mod p k>2 ). N.F. Benschop, Associative Digital Network Theory, © Springer Science + Business Media B.V. 2009
97
98
7 Fermat’s Small Theorem Extended to r p−1 mod p 3
Note Residue n mod p k , with a unique k-digit representation (base p), can be interpreted as non-negative integer < p k , its principle value, also denoted by n when no confusion can arise. So Bk consists of all p k−1 k-digit representations with least significant digit 1, generated as powers of 11 (base p) mod p k . Subgroup Fk = {x p } of p-th power residues in Gk has order |Gk |/p = (p − 1)p k−2 , and core Ak mod p k has order p − 1 for each k > 0, so F2 = A2 . − Fermat’s Small Theorem mod p k extended to k > 1 By FST: x p−1 ≡ 1 mod p (all x ≡ / 0 mod p), so all 0 < x < p, also referred to as natural x < p, have equal x p−1 mod p. For odd prime p the question then is: Let X be a subset of naturals x < p, then: for which least precision k do all x p−1 mod p k differ,
shown to be k = 3 for some special natural subsets, namely divisors r|q = p ± 1, and idempotents e2 ≡ e mod q. Definition the image of integer or unit x ∈ G3 is residue x p−1 mod p 3 in B3 , and x = 2i=0 xi p i = [x2 , x1 , xo ] with digits 0 ≤ xi < p (base p) denotes integer 0 ≤ x < p 3 and also its residue mod p 3 . Regarding the divisors of q = p ± 1: if p − 1 (and similarly p + 1) has prime e structure ui=1 pi i then there are ui=1 (ei + 1) divisors forming a lattice, which is a Boolean lattice if q is squarefree. The coprime divisors r|p − 1 generate 2u idempotents e2 ≡ e mod q, forming a Boolean Lattice [3]. There are as many maximal one-idempotent subsemigroups of Zq = Z(.) mod q (Chap. 4: maxit components, or ’Archimedian components’ [2, 3]). By the lattice structure of semigroup Zq (.), (see Corollary. 7.1): if x = y < p yet x p−1 ≡ y p−1 mod p 3 then not both x, y can divide p − 1 (resp. p + 1). Two such rare cases for p < 4.104 with coprime x, y are p = 19: 618 ≡ 1118 ≡ [11, 2, 1] and
p = 41: 740 ≡ 1040 ≡ [31, 37, 1].
We will need the following simple but essential well known result for integers: Lemma 7.1 Any integer pair (r, s) is fixed by product rs and sum r + s. Proof Let r + s = √ b and rs = c. Substitute s = c/r then r 2 − br + c = 0 with two roots (r, s) = (b ± b2 − 4c)/2. Determinant b2 − 4c = (r + s)2 − 4rs = (r − s)2 is indeed a perfect square, with the two integer root solutions r and s.
7.2 Lattice Structure of Semigroup Z(.) mod q
99
7.1.1 Divisors r|p ± 1 and Residues (p ± 1)p mod p 3 Recall FST: x p−1 ≡ 1 mod p (prime p > 2, natural x < p) and the question for which k all are distinct mod p k . Rare case p = 113 has 68112 ≡ 1 mod p 3 , showing k > 3 if all x p−1 mod p k are to be distinct. Notice both addition and multiplication are associative and commutative, while exponentiation is neither. Positive integer arithmetic misses the two symmetries (automorphisms of order 2) of residue arithmetic mod p k : additive complement −x, and multiplicative inverse x −1 of units. p
In fact (x1 p + xo )p ≡ xo ≡ co p + xo mod p 2 has carry co independent of x1 . The known binomial expansion (Pascal’s triangle) links addition to exponentiation. In quadratic analysis (p ± x)p (mod p 3 ) yields p 2 ± x p due to FST: (p ± x)p ≡ x p−1 p 2 ± x p ≡ p 2 ± x p mod p 3 ,
for x ≡ / 0 mod p.
(7.2a)
A ’shift’ (base p) over m positions results by taking m times the p-th power: m
(p ± 1)p ≡ p m+1 ± 1 mod p m+2 ⇒ r p ≡ / r mod p 3
for r = p ± 1.
(7.2b)
This shift in p-th power residues (base p) causes distinct r p−1 mod p 3 for all divisors r|p ± 1 (Corollary 7.1), so r p−1 ≡ 1 mod p 3 only if r = 1. In fact: rs = p − 1 ⇒ r p s p ≡ p 2 − 1 ≡ / rs mod p 3
so: r p ≡ / r and/or s p ≡ / s mod p 3 .
It will be shown that ‘and’ holds here, for any pair of cofactors r, s of p − 1. Note Additive p-th power anti-closure property x p +y p = zp for all integers x, y, z coprime to p (FLT case1 ) follows from 2p ≡ / 2 mod p 2 , true for all primes p < 12 4 × 10 except ‘Wieferich primes’ 1093, 3511 for which 2p ≡ 2 mod p 2 [4, 5]. Clearly 2|p ± 1 for all odd primes, suggesting to study more generally r|p ± 1. Many primes have x p ≡ x mod p 2 for some 1 < x < p. Table 7.1 lists the 60 cases in 43 of the 78 odd primes p ≤ 401, with one case of r|p + 1 : 3|11 + 1, and four cases of r|p − 1 denoted r(p): 14(29), 18(37), 20(281), 104(313). Note For prime p = 113 holds 68113−1 ≡ 1 mod p 3 with 68 not dividing 113 ± 1.
7.2 Lattice Structure of Semigroup Z(.) mod q The divisors of q = p ± 1 are best studied in Z(.) mod q, followed by base transfer q → p, for their properties mod p 3 . Recall the lattice structure [2, 3] of multiplicative semigroup Zq (.) of residues mod q, with q = p − 1, resp. q = p + 1.
7 Fermat’s Small Theorem Extended to r p−1 mod p3
100
Table 7.1 All cases 1 < n < p − 1 with np = n mod p 2 (prime p < 402) 3( 11)+ -6( 59) 43(103) 58(131) -79(163) -46(211) 33(233) -89(269) 40(307) -7(331) 14(353) -162(367)
-2( 11) 11( 71) -13(109) -20(131) 78(181) -29(211) 94(241) -62(269) 104(313)75(347) -157(353) -131(373)
n(p)+ : n|p+1,
14( 29)26( 71) -45(113)< 19(137) -15(191) 69(223) 48(257) 20(281)-100(313) 156(347) -102(359) 174(379)
n(p)- : n|p-1.
18( 37)31( 79) 38(127) -73(151) -54(197) 44(229) 79(263) -136(283) 18(331) -126(349) -28(359) 175(397)
19( 43) -44( 97) 62(127) 65(163) -25(199) -20(229) -98(269) 91(293) 71(331) -32(349) 159(367) -121(401)
p=113: 68^[p-1]=001
Definition For natural q: primeset P (q) is the set of prime divisors of q. Definition Pq (x), 0 < x ≤ q is the set of prime divisors common to x and q. Since q is a fixed modulus, notation P (x) will be used for Pq (x). Hence P (x) ⊆ P (q), and for units u < q of Zq : P (u) = ∅, while P (xy) = P (x) ∪ P (y) and P (x n ) = P (x) for n >0. Now P (q) = P (0) by q ≡ 0 mod q. Let x ∗ be the ‘iteration class’ of all distinct powers x n ∈ Zq , known to contain precisely one idempotent x ≡ (x )2 . If modulus q is the product of k coprime factors piei then e Zq is the direct product of k semigroups Z(.) mod pi i . Definition An Archimedian component of Zq , or briefly ‘P-component’, consists of all residues x generating idempotent e, with primeset P (x) = P (e) [2]. These are the maximal one-idempotent subsemigroups of Zq , one per idempotent resp. subset of P (0) = P (q) (of which there are 2u for u prime divisors of q), ordered in a Boolean Lattice Lq as their commuting idempotents (Chap. 2, Sect. 2.2.2). Definition idempotent ordering e ⊇ f denotes ef ≡ f e ≡ f in Zq (.): e is identity for f ⇐⇒ P (e) ⊆ P (f ), with lattice top 1: P (1) = ∅, and bottom 0: P (0) = P (q). Notice this ordering differs from the arithmetic ordering e ≥ f of idempotents as naturals < q, to be used later as well. Semigroup Zq (.) is the disjoint union of its Boolean lattice Lq of P-components. It is readily verified that if 1 ∈ x ∗ then iteration class x ∗ is a cycle (cyclic group). In fact all x that generate 1, the semigroup identity, form a group G(1) ordered at the lattice top. Such x must be coprime to q, hence is a ‘unit’ of Zq , so primeset P (1) = φ is empty, and P (0) = P (q) = {pi } is the full primeset of q, with trivial subgroup G(0) ≡ 0 as lattice bottom idempotent.
7.2 Lattice Structure of Semigroup Z(.) mod q
101
Definition Denote by r the idempotent generated by r in Zq . The product eg (mod q) of two idempotents is idempotent since: (eg)2 ≡ egeg ≡ eegg ≡ eg, so Boolean lattice Lq (.) of idempotents is closed under multiplication. Recall each pair of idempotents a = b to yield a pair (e, g) of idempotents with: (a + b) = e = g = ab ∈ Lq having primesets P (e) = P (a) ∪ P (b) and P (g) = P (a) ∩ P (b) and ordering e ⊇ {a, b} ⊇ g in Lq , repectively least upper bound e = lub(a, b) and greatest lower bound g = glb(a, b). For non-ordered a, b each quadruple e ⊃ {a, b} ⊃ g = ab forms a sublattice: a direct product of two ordered pairs in Lq , and its four idempotents have distinct images mod p 3 , shown next.
7.2.1 Distinct ep−1 mod p 3 for Idempotents e ∈ Zp−1 Divisors r|q = p − 1 with differing primesets are in distinct P -components of Zq (.) with different idempotents r mod q, shown to yield distinct images (r )p−1 mod p 3 (combinational inequivalence). The powers r n mod q of r are in one P -component. If r p−1 ≡ cp + 1 mod p 3 has carry c ≡ / 0 mod p 2 then (r n )p−1 ≡ mcp + 1 mod p 3 where m depends on n, with resulting sequential inequivalence mod p 3 , considered next. Lemma 7.2 Each pair of complementary idempotents (co-idempotents) e, f ∈ Zq as naturals e, f < q satisfies, for any base q > 1: P (e) ∪ P (f ) = P (q) = P (0)
and P (e) ∩ P (f ) = P (1) = φ,
with: ef ≡ 0 mod q,
(7.3a)
e + f ≡ 1 mod q.
(7.3b)
and
Proof (7.3a) is obvious, and (7.3b) is verified as follows. Notice (7.3a) implies e +f is idempotent, since (e + f )2 ≡ e2 + f 2 + 2ef ≡ e2 + f 2 ≡ e + f mod q. Moreover ef ≡ 0 implies: e +f is identity for e because (e +f )e ≡ e(e +f ) ≡ e2 +ef ≡ e2 ≡ e ⇒ e + f ⊇ e. Similarly e + f ⊇ f . Hence e + f is identity for both idempotents e, f ∈ Zq and e + f is coprime to q, so it must be the lattice identity 1 mod q. Taking q = p − 1 then e + f = p so e, f are additive complementary mod p. Using (7.3a), (7.3b) any pair of co-idempotents e, f as naturals < p satisfies: ef = mef (p − 1)
(7.4a)
7 Fermat’s Small Theorem Extended to r p−1 mod p 3
102
where 1 ≤ mef < p, and: e + f = p.
(7.4b)
By (7.2a): ep = (p − f )p ≡ p 2 − f p mod p 3 , so: ep + f p ≡ p 2 mod p 3 .
(7.4c)
Lemma 7.3 Distinct co-idempotent pairs in Zp−1 as naturals e, f < p have distinct products ef = mef (p − 1), hence different mef < p. Proof By (7.4b) all co-idempotent pairs have sum p, so by Lemma 7.1 and (7.4a) they have distinct products: ef = mef (p − 1), thus distinct mef < p. Lemma 7.4 For co-idempotent pairs e, f ∈ Zp−1 : ep−1 ≡ / f p−1 mod p 3 . Proof By (7.4b): ep−1 ≡ (p − f )p /(p − f ) ≡ (p 2 − f p )/(p − f ) ≡ / f p−1 mod p 3 p−1 2 p 3 p−1 2 since f (p − f ) ≡ / p − f mod p , where f ≡ / p mod p (by FST). Notice minimal value mef = 1 holds for co-pair (e, f ) = (1, p − 1). By (7.4b), (7.4c) and FST at most one of ep ≡ e, f p ≡ f mod p 3 can hold. Only e = 1 yields equivalence ep ≡ e, and f = p − 1 so f p ≡ (p − 1)p ≡ p 2 − 1 ≡ / f mod p 3 , so e = 1 is the only idempotent of Zp−1 (.) with ep ≡ 1 mod p 3 . Corollary 7.1 (Odd prime p) For idempotents e ∈ Zp−1 as naturals e < p: ep ≡ e mod p 3 ⇒ e = 1. For q = p − 1 and some carry 0 ≤ c < q: idempotent e2 ≡ e mod q implies e2 = cq + e = c(p − 1) + e < q 2 . Notice that carry c = 0 resp. c > 0 yield: c = 0 ⇐⇒ e = 1,
and e > 1 ⇒ e2 > q ⇒ e >
(#)
p − 1.
(7.5)
Lemma 7.5 For co-idempotents e, f ∈ Zq with e2 = e + cq and f 2 = f + dq: the carries 0 ≤ {c, d} < q = p − 1 satisfy: c < e and d < f.
(7.6a)
In ef = m(p − 1) (7.4a) holds: m = e − c = f − d < q.
(7.6b)
Proof For (7.6a): e < p ⇒ e2 < ep, hence by (#): cq + e < e(p − 1) + e = eq + e ⇒ c < e, and similarly d < f . For (7.6b): e2 − f 2 = (e − f )(e + f ) = (e − f ) + (c − d)q for given carries c, d and by (7.4b): (e − f )p − (e − f ) = (e − f )q = (c − d)q. So: e−f =c−d
and e − c = f − d.
(*)
7.3 Distinct r p−1 mod p3 for Divisors r|p ± 1
103
Moreover by e + f = p = q + 1: (e + f )2 = (q + 1)2 ⇒ e2 + f 2 + 2ef = (c + d)q + q + 1 + 2mq = q 2 + 2q + 1. Hence (c + d)q + 2mq = q 2 + q ⇒ c + d + 2m = q + 1 = e + f , yielding: (e − c) + (f − d) = 2m, and with (*) follows: e − c = f − d = m < q. Theorem 7.1 All idempotents e ∈ Zp−1 , as naturals e ≤ p − 1, have distinct ep−1 mod p 3 . Proof Ordered idempotents e ⊃ a have eq ≡ / a q mod p 3 since a ≡ ge mod q for q some idempotent g ⊂ 1 with g ≡ / 1 mod p 3 (Corollary 7.1). So a q ≡ g q eq ≡ / q 3 e mod p in B3 . Non-ordered idempotents a ≡ / b have a ⊂ 1, b ⊂ 1 so a q ≡ / 1, bq ≡ / 1 mod 3 q q p (Corollary 7.1) and let glb(a, b) ≡ z ≡ ab. Assume a ≡ b mod p 3 then zq ≡ a q bq ≡ (a 2 )q mod p 3 . But ordered pair z ⊂ a ≡ a 2 mod q yields different images as just shown, falsifying the assumption, so a q ≡ / bq mod p 3 .
7.3 Distinct r p−1 mod p 3 for Divisors r|p ± 1 Definition Divisors of p − 1 with the same set of prime divisors are defined as equivalent divisors. Notice they generate the same idempotent in Zp−1 . The fact that the idempotents of Zp−1 have distinct images ep−1 mod p 3 (Theorem 7.1) implies the same property for non-equivalent divisors of p − 1, seen as follows. Theorem 7.2 For odd prime p: non-equivalent divisors r|p −1 have distinct images r p−1 mod p 3 . Proof Each divisor r of q = p − 1 generates in semigroup Zp−1 (.) a unique idempotent r mod q. By Theorem 7.1 these idempotents generate as many distinct images (r )p−1 mod p 3 . Assume non-equivalent divisors (r, s) to generate the same image r p−1 ≡ p−1 s ≡ t mod p 3 . Let r ≡ r m and s ≡ s n with k = lcm(m, n) then r ≡ r k and also s ≡ s k . But r p−1 ≡ s p−1 ⇒ r (p−1)k ≡ s (p−1)k ⇒ (r )p−1 ≡ (s )p−1 . So the assumption of equal image implies the same idempotent image, contradicting Theorem 7.1. Hence non-equivalent divisors (distinct idempotents) have distinct images. Notice 2|p − 1 for all odd primes p, and 2p ≡ / 2 mod p 3 for p=2, so by Corollary 7.1: Corollary 7.2 For prime p: 2p ≡ / 2 mod p 3 .
7 Fermat’s Small Theorem Extended to r p−1 mod p 3
104
7.3.1 Idempotents of Zp+1 (.) and Divisors of p + 1 Similar to (7.4a), (7.4b) for modulus p − 1, consider q = p + 1 (prime p > 2). Then for u prime divisors of p + 1 the 2u−1 co-idempotent pairs e, f ∈ Zp+1 satisfy with as many distinct multiples mef : ef = mef (p + 1)
where 1 ≤ mef ≤ p + 1,
e + f = p + 2.
(7.7a) (7.7b)
As naturals, trivial pair (1, p + 1) has images 1 and [1, p − 1, 1] base p, because: (p + 1)p−1 ≡ (p 2 + 1)/(p + 1) ≡ 2p 2 − p + 1 ≡ p 2 + (p − 1)p + 1 mod p 3 . It is left to the reader to verify the next similar results for q = p + 1: Theorem 7.3 (Odd prime p) All idempotents e ∈ Zp+1 as naturals e ≤ p + 1 have distinct ep−1 mod p 3 . Corollary 7.3 (Odd prime p) Non-equivalent divisors r|p + 1 have distinct images r p−1 mod p 3 . Notes 1. In units group Gk ≡ g ∗ mod p k>2 prime p divides its order |g ∗ | = (p − 1)p k−1 . So g is not in core A3 of order p − 1, which by Theorem 7.1 is satisfied if g|(p ± 1), but this is not sufficient for a primitive root. In fact p = 73 (Gk = 5∗ ) is the smallest prime with no primitive root r|p ± 1. But 6, 12 and their cofactors do generate half of Gk , in fact missing −1 mod p k . The next such case is p = 193 with no r|p ± 1 as primitive root of 1, yet with semi-generators 2, 6, 32, 96, 97. For most primes it appears that at least one of (p ± 1)/2 is a semi-generator. Conjecture: At least one divisor r|p ± 1 is a semi primitive root of 1 mod p k>2 : Gk = {−1, r}∗ . 2. It is known [1] that Gk is cyclic (one generator) for odd primes p and any precision k ≥ 1, but not for p = 2 and k ≥ 3 (re: the multiplicative Klein group G3 = C2 × C2 of odd residues mod 23 , a direct product of 2-cycles), due to (p + 1)2 > p 3 only for p = 2. With trivial core of order p − 1 = 1, the units mod 2k>2 have semi-generator p + 1 = 3 with {3, −1} generating all 2k−1 units [7]. 3. Recall an old result of Wieferich (1909) [4, 5]: “If 2p ≡ / 2 mod p 2 for odd prime p then FLT case1 holds for exponent p.” (that is: x p + y p = zp for all natural x, y, z coprime to p). The Wieferich inequivalence holds at least for all primes p < 4.1012 , except 1093 and 3511. If his could be extended to 2p mod p 3 , then FST mod p 3 (Corollary 7.2) would yield a direct proof of FLT case1 . 4. The finite precision nature is characterized by a critical precision [6] of 3, corresponding to quadratic analysis mod p 3 . This concept was applied in [6] to study the range of residues covered by the pair sums of p-th power units a p + bp mod
References
105
p k , shown to cover half the units group Gk for k ≥ Kp , thus of at least critical precision Kp for prime p, which for most primes is Kp = 2. The results presented here extend a side result (Theorem 7.1) in [6].
References 1. T. Apostol: “Introduction to Analytic Number Theory” Springer, Berlin, 1976 (Theorem 10.4-6) 2. A. Clifford, G. Preston: “The Algebraic Theory of Semigroups”, AMS Surv. #7, 1 130–135 (1961) 3. S. Schwarz: “The Role of Semigroups in the Elementary Theory of Numbers”, Math. Slovaca 31(4), 369–395 (1981) 4. A. Wieferich: “Zum letzten Fermat’schen Theorem”, J. Reine Angew. Math. 136, 293–302 (1909) 5. S. Mohit, M. Ram Murty: “Wieferich Primes and Hall’s Conjecture”, C. R. Acad. Sci. (Can.), 20(1), 29–32 (1998) 6. N. Benschop: “Powersums representing residues mod pk , from Fermat to Waring”, Comput. Math. Appl., 39(8), 253–261 (2000) 7. N. Benschop: Patent US-5923888 (July 1999) on a Logarithmic Binary Multiplier (Dual Bases 2 and 3)
Chapter 8
Additive Structure of Units Group mod p k , with Carry Extension for a Proof of Fermat’s Last Theorem The additive structure of multiplicative semigroup Zpk = Z(.) mod p k is analysed for prime p > 2. Order (p − 1)p k−1 of cyclic group Gk of units mod p k implies product Gk ≡ Ak Bk , with cyclic ‘core’ Ak of order p − 1 so np ≡ n for core elements, and ‘extension subgroup’ Bk of order p k−1 consisting of all units n ≡ 1 mod p, generated by p + 1. The p-th power residues np mod p k in Gk form an order |Gk |/p subgroup Fk , with |Fk |/|Ak | = p k−2 , so Fk properly contains core Ak for k ≥ 3. The additive structure of subgroups Ak , Fk and Gk is derived by successor function S(n) = n + 1, and by considering the two arithmetic symmetries C(n) = −n and I (n) = n−1 as functions, with commuting I C = CI , where S does not commute with I nor C. The four distinct compositions SCI, CI S, CSI, I SC all have period 3 upon iteration. This yields a triplet structure in Gk of three in−1 for i = 0, 1, 2 where n .n .n ≡ verse pairs (ni , n−1 0 1 2 i ) with ni + 1 ≡ −(ni+1 ) k 1 mod p , generalizing the cubic root solution n + 1 ≡ −n−1 ≡ −n2 mod p k (p ≡ 1 mod 6). Any solution in core: (x + y)p ≡ x + y ≡ x p + y p mod p k>1 has exponent p distributing over a sum, shown to imply the known FLT inequality for integers. In such equivalence mod p k (FLT case 1) the three terms can be interpreted as naturals n < p k , so np < p kp , and the (p − 1)k produced carries cause FLT inequality. Inequivalence mod p 3k+1 is shown for the cubic roots of 1 mod p k (p ≡ 1 mod 6).
8.1 Introduction The commutative semigroup Zpk (.) of multiplication mod p k (prime p > 2) has for all k > 0 just two idempotents: 12 ≡ 1 and 02 ≡ 0, and is the disjoint union of the corresponding maximal subsemigroups (Archimedian components [3, 4]). Namely the group Gk of units (ni ≡ 1 mod p k for some i > 0) relative prime to p, and maximal ideal Nk as nilpotent subsemigroup of all p k−1 multiples of p (ni ≡ 0 mod p k for some i >0). Since the analysis holds for any odd prime p, the index p in Gk and Nk is omitted for brevity of notation. Order |Gk | = (p − 1)p k−1 has two coprime factors, so that Gk ≡ Ak Bk , with ‘core’ Ak and ‘extension group’ Bk of orders p − 1 and p k−1 respectively. Residues of np form a subgroup Fk ⊂ Gk of order |Fk | = |Gk |/p, to be analysed for its additive structure. Each n ∈ Ak has np ≡ n mod p k denoted as FST k , since this is related to Fermat’s Small Theorem (k = 1) [2]. (c) 2005 Bratislava University Press, with permission taken from [10]. N.F. Benschop, Associative Digital Network Theory, © Springer Science + Business Media B.V. 2009
107
108
8 Additive Structure of Units Group mod p k , with Carry Extension
Notation Base p number representation is used, which is useful for computer experiments. This models residue arithmetic mod p k by considering only the k less significant digits, and ignoring the more significant digits (carries). Congruence class [n] mod p k is represented by natural number n < p k , encoded by k digits (base p). Class [n] consists of all integers with the same least significant k digits as n. Concatenation of operands indicates multiplication. Define the 0-extension of residue n mod p k as the natural number n < p k with the same k-digit representation (base p), and all more significant digits (at p m , m ≥ k) set to 0. Signed residue −n is only a convenient notation for the complement p k − n of n, which are both positive. C[n] is a cyclic group of order n, such as Zpk (+) ∼ = C[p k ]. Units mod p form a cyclic group G1 = C[p − 1], and Gk of order (p − 1)p k−1 is also cyclic for k > 1 [1]. Finite semigroup structure is applied, and digit analysis of prime-base residue arithmetic, to study the combination of (+) and (.) mod p k , especially the additive properties of multiplicative subgroups of ring Zpk (+, .). Elementary residue arithmetic, cyclic groups, and (associative) function composition will be used, starting at the known cyclic (one generator) nature [1] of group Gk of units mod p k . The direct product structure of Gk (Lemma 8.1) and Corollary 8.2 on the p k−2 extensions of np mod p 2 to cover all p-th power residues mod p k for k > 2 are known, but they are derived for completeness. Results beyond Sect. 8.2 are believed to be new. The two symmetries of residue arithmetic (automorphisms of order 2) are complement −n under (+) and inverse n−1 under (.). Their role as functions C(n) = −n and I (n) = n−1 , in the triplet additive structure of Z(.) mod p k (Lemma 8.7, Theorem 8.2) is essential. Symbols
and Definitions (odd prime p)
Zpk (.) C[m] 0-extension X extension U (finite) Gk ≡ Ak .Bk (units) Ak Bk ≡ (p + 1)∗ u ∈ Gpk (.) Fk Ak ⊂ Fk ⊂ Gk d(n) FST k solution in core period of n ∈ Gk normation (mod p k ) complement −n
multiplicative semigroup mod p k (k digits base p) cyclic group of order m: e.g. Zpk (+) ∼ = C[p k ] k of residue x mod p : smallest natural X ≡ x mod p k of x mod p k : any integer U ≡ x mod p k u ∈ Gk : ui ≡ 1 mod p k (some i > 0), |Gk | ≡ (p − 1)p k−1 core of Gk , |Ak | = p − 1 (np ≡ n mod p k for n ∈ Ak ) extension group of all n ≡ 1 mod p, |Bk | = p k−1 unit u = g i (p + 1)j mod p k (unique i, j ) (Ak ≡ g ∗ ) subgroup of all p-th power residues in Gk , |Fk | = |Gk |/p proper inclusions only for k ≥ 3 (A2 ≡ F2 ⊂ G2 ) increment A(n + 1) − A(n) of core function A(n) ≡ n|Bk | core Ak extends FST (np ≡ n mod p) to mod p k>1 x p + y p ≡ zp mod p k with x, y, z in core Ak order |n∗ | of subgroup generated by n in Gk (.) divide x p + y p ≡ zp by one Fk term → one term ±1 unique in Zpk (+): −n + n ≡ 0 mod p k
8.2 Structure of the Group Gk of Units
inverse n−1 1-complement pair inverse-pair triplet (in Gk ) tripletp symmetry (mod p k ) EDS property
109
unique in Gk (.): n−1 .n ≡ 1 mod p k pair {m, n} in Zpk (+): m + n ≡ −1 mod p k pair {a, a −1 } of inverses in Gk 3 inv.pairs: a + b−1 ≡ b + c−1 ≡ c + a −1 ≡ −1, abc ≡ 1 a triplet of p-th power residues in subgroup Fk −n and n−1 : order 2 automorphism of Zpk (+) resp. Gk (.) Exponent Distributes over Sum: (a + b)p ≡ a p + bp mod p k
8.2 Structure of the Group Gk of Units Lemma 8.1 Gk ∼ = A k × Bk ∼ = C[p − 1].C[p k−1 ] and Z(.) mod p k has a subsemigroup isomorphic to Z(.) mod p. Proof Cyclic group Gk of units n (ni ≡ 1 for some i > 0) has order (p − 1)p k−1 , namely p k minus p k−1 multiples of p. Then Gk = A k × Bk , the direct product of two relative prime cycles, with corresponding subgroups Ak and Bk , so that Gk ≡ Ak Bk where extension group Bk = C[p k−1 ] consists of all p k−1 residues mod p k that are 1 mod p, and core Ak = C[p −1], so Zpk (.) contains sub-semigroup Ak ∪ 0 ∼ = Zp (.) Core Ak , as p − 1 cycle mod p k , is Fermat’s Small Theorem np ≡ n mod p extended to k >1 for p residues (including 0), to be denoted as FST k . Recall that np−1 ≡ 1 mod p for n ≡ / 0 mod p (FST), then Lemma 8.1 implies: Corollary 8.1 With |B| = p k−1 = q and |A| = p − 1: Core Ak = {nq } mod p k (n = 1..p − 1) extends FST for k > 1, and: Bk = {np−1 } mod p k consists of all p k−1 residues 1 mod p in Gk . Subgroup Fk ≡ {np } mod p k of all p-th power residues in Gk , with Fk ⊇ Ak (only F2 ≡ A2 ) and order |Fk | = |Gk |/p = (p − 1)p k−2 , consists of all p k−2 extensions mod p k of the p − 1 p-th power residues in G2 , which has order (p − 1)p. Consequently: Corollary 8.2 Each extension of np mod p 2 (in F2 ) is a p-th power residue in Fk . Core generation: The p − 1 residues nq mod p k (q = p k−1 ) define core Ak for 0< n < p. Cores Ak for successive k are produced as the p-th power of each n0 < p recursively: (n0 )p ≡ n1 , (n1 )p ≡ n2 , (n2 )p ≡ n3 , etc., where ni has i + 1 digits (base p). In detail: Lemma 8.2 For non-negative digits ai < p: the p − 1 naturals a0 < p define k−1 i k p core Ak (a0 ) ≡ (a0 )p ≡ a0 + k−1 i=1 ai p mod p , and Ak+1 (a0 ) ≡ [Ak (a0 )] k+1 mod p .
8 Additive Structure of Units Group mod p k , with Carry Extension
110
Proof Let a = a0 + mp < p 2 be in core A2 , so a p ≡ a mod p 2 . Then a p = (mp + p−1 p p a0 )p ≡ a0 mp 2 + a0 ≡ mp 2 + a0 mod p 3 , by FST. Core digit a1 of weight p is not found this way as function of a0 , requiring actual computation, except for a ≡ p ± 1 as in (1), (1 ). It depends on the carries produced in computing the p-th power of a0 . Similarly, the next more significant digit in core Ak+1 (n) is found by computing, with k+1 digit precision, the p-th power a p of 0-extension a < p k in core Ak , leaving core Ak fixed, since a p ≡ a mod p k . Notice (p 2 ± 1)p ≡ p 3 ± 1 mod p 5 , and (p + 1)p ≡ p 2 + 1 mod p 3 by induction on m: m
(1) (p + 1)p ≡ p m+1 + 1 mod p m+2 m (1 ) (p − 1)p ≡ p m+1 − 1 mod p m+2 k k−1 Lemma 8.3 Extension group Bk is generated by p + 1 (mod p ), withk |Bk | = p k , s and each subgroup S ⊆ Bk , |S| = |Bk |/p has sum S ≡ |S| mod p ≡ / 0 mod p .
Proof For the smallest x with (p + 1)x ≡ 1 mod p k , the period of p + 1, (1) implies m + 1 = k. So m = k − 1, thus period p k−1 . No smaller x generates 1 mod p k since only p s divide |Bk |. Bk consists of all p k−1 residues which are 1 mod p. The order of each subgroup S ⊂ Bk must divide |Bk |, so that |S| = |Bk |/p s (0 ≤ s < k) and S = {1 + m.p s+1 } (m = 0..|S| − 1). Then p s+1 .|S|(|S| − 1)/2 mod p k , S = |S| +k−1−s s+1 k where p .|S| = p.|Bk | = p , so that S = |S| = p mod p k . Hence no subk group of Bk sums to 0 mod p . Corollary 8.3 For core Ak ≡ g ∗ : each unit n ∈ Gk ≡ Ak Bk has the form: n ≡ g i (p + 1)j mod p k for a unique pair of non-neg. exponents i < |Ak | and j < |Bk |. Pair (i, j ) are the exponents in the core- and extension- component of unit n. In case p = 2, the most interesting prime for computer engineering purposes, the next binary number representation is readily verified [8, 9]: Lemma 8.4 For p = 2: p + 1 = 3 is a semi-primitive root of 1 mod 2k for k > 2. In other words, for base p = 2 and precision k > 2: each odd residue mod 2k is a unique signed power of 3. So an efficient k-bit binary number code is n = ±3i .2j mod 2k , for all integers 0 ≤ n < 2k , with unique non-negative index pair i < 2k−2 and j ≤ k. Clearly, this allows a dual-base (2), (3) binary logarithmic code, which reduces multiplication to addition of the two indices, and XOR (add mod 2) of the involved signs (see US-patent [9]). Theorem 8.1 Each subgroup S ⊃ 1 of core Ak sums to 0 mod p k (k > 0). Proof For even |S|: −1 in S implies pairwise zero-sums. In general: c.S = S for all c in S, and c S = S, so S.x = x, writing x for S. Now for any g in Gk :
8.3 Cubic Root Solution in Core, and Core Symmetries
111
|S.g| = |S| so that |S.x|=1 implies x not in Gk , hence x = g.p e for some g in Gk and 0 < e < k or x = 0 (e = k). Then S.x = S(g.p e ) = (S.g)p e with |S.g| = |S| if e < k. So |S.x| = 1 yields e = k and x = S = 0. Consider the normation of an additive equivalence a + b ≡ c mod p k in units group Gk , multiplying all terms by the inverse of one of these terms, to yield −1 as right hand side: (2) 1-complement form: a + b ≡ −1 mod p k in Gk (digitwise sum p − 1, no carry). For instance the known p-th power residue equivalence: x p + y p ≡ zp in Fk yields: (2 ) normal form: a p + bp ≡ −1 mod p k in Gk , with a special case in core Ak , considered next.
8.3 Cubic Root Solution in Core, and Core Symmetries Lemma 8.5 Cubic roots a 3 ≡ 1 mod p k (p ≡ 1 mod 6, k >1) are p-th power residues in core Ak , and a + a −1 ≡ −1 mod p k (a ≡ / 1) has no corresponding integer p-th powers < p kp . Proof If p ≡ 1 mod 6 then 3 divides p − 1, implying a core subgroup S = {a, a 2 , 1} of three p-th powers: the cubic roots a 3 ≡ 1 in Gk , with sum 0 mod p k (Theorem 8.1). Now a 3 − 1 = (a − 1)(a 2 + a + 1), so for a ≡ / 1 : a 2 + a + 1 ≡ 0, hence −1 a + a ≡ −1 solves the normed (2 ), being a root-pair of inverses with a 2 ≡ a −1 . Subgroup S ⊂ Ak consists of p-th power residues with np ≡ n mod p k . Write b for a −1 , then a p + bp ≡ −1 and a + b ≡ −1, so a p + bp ≡ (a + p b) mod p k . Property: “exponent p distributes over a sum” (EDS) implies Ap + B p < (A + B)p for the corresponding 0-extensions A, B, A + B of residues a, b, a + b mod p k . 1. Successive powers g i of generator g of Gk produce |Gk | points (k-digit residues) counter clockwise on a unit circle (Figs. 8.1, 8.2). Inverse pairs (a, a −1 ) are connected vertically, complements (a, −a) diagonally, and pairs (a, −a −1 ) horizontally, representing functions I , C and I C = CI respectively (Theorem 8.2). 2. Scaling any equation, such as a + 1 ≡ −b−1 , by a factor s ≡ g i ∈ Gk ≡ g ∗ , yields s(a + 1) ≡ −s/b mod p k , represented by a rotation counter clockwise over i positions.
8.3.1 Another Derivation of the Cubic Roots of 1 mod p k The cubic root solution was derived, for 3 dividing p − 1, via subgroup S ⊂ Ak of order 3 (Theorem 8.1). On the other hand, Fermat could have used elementary
112
8 Additive Structure of Units Group mod p k , with Carry Extension
Fig. 8.1 Core A2 mod 72 (6-cycle), Cubic roots {42, 24, 01} (3-cycle) in core Fig. 8.2 G= A. B = g ∗ (mod 52 ), Cycle in the plane
arithmetic as follows. Notice a + b ≡ −1 to yield a 2 + b2 ≡ (a + b)2 − 2ab ≡ 3 1 − 2ab, anda 3 + b3 ≡ (a + b) b)ab ≡ −1 + 3ab. The combined sum is 3− 3(ai + 3 i i ab − 1, so: i=1 (a + b ) ≡ i=1 a + 3i=1 bi ≡ ab − 1 mod p k . Find a, b for ab ≡ 1 mod p k . Now n2 + n + 1 = (n3 − 1)/(n − 1)=0 for n3 ≡ 1 (n = 1), hence ab ≡ 1 mod p k>0 if a 3 ≡ b3 ≡ 1 mod p k , with 3 dividing p −1 (p ≡ 1 mod 6). Cubic roots a 3 ≡ 1 mod p k exist for any prime p ≡ 1 mod 6 at any precision k > 0.
8.3 Cubic Root Solution in Core, and Core Symmetries
113
3 3 i i k In the next section other solutions of i=1 a + i=1 b ≡ 0 mod p will be shown, depending not only on p but also on k, with ab ≡ 1 mod p 2 but ab ≡ / 1 mod p 3 , for some primes p ≥ 59.
8.3.2 Core Increment Symmetry mod p 2k+1 , Asymmetry mod p 3k+1 Consider core function Ak (n) = nq (q = |Bk | = p k−1 ) as natural monomial, core increment dk (n) = Ak (n + 1) − Ak (n) = (n + 1)q − nq [even degree q − 1], natural Core Ck (n) < p k (0-extension) with Ak (n) ≡ Ck (n) mod p k , integer Core increment Dk+1 (n) = [Ck (n + 1)]p − [Ck (n)]p , absolute value < p kp . Recall: for natural n < p the p-th power residues [Ak (n)]p mod p k+1 form core Ak+1 (Lemma 8.2). For any core element a ∈ Ck : a p−1 ≡ 1 mod p k . By FST: Ck (n) ≡ n mod p, so Dk (n) ≡ 1 mod p, and Dk (n) is called core increment, although in general Dk (n) ≡ / 1 mod p k for k > 2. Core naturals Ck (n) < p k are considered in order to study natural p-th power sums. For example p = 7 (Fig. 8.1). The cubic roots in core A2 are {42, 24, 01} mod 72 , with 7-th powers {642, 024, 001} in core A3 . In full 14 digits (base 7): 427 + 247 = 0 14 24 06 25 00 66 6 (k = 2) versus 667 = 6 02 62 04 64 00 66 6 which are equivalent mod 72k+1 = 75 , but differ mod 76 hence also mod 73.2+1 = 77 . Cubic roots {3642, 3024} in core A4 , as 7-th powers of cubic roots in A3 (k = 3), have increment 1 mod 77 with increment symmetry mod 72k+1 = 77 , and asymmetry mod p 3k+1 = 710 . See Table 8.1. This core/carry effect is now generalized to integers. Lemma 8.6 (Core increment symmetry and asymmetry) For q = |Bk | = p k−1 (k ≥ 1) and natural m, n < p: (a) Core residues Ak (n) ≡ nq mod p k and increments dk (n) ≡ Ak (n + 1) − Ak (n) mod p k have period p in n. (b) For m + n = p: Ak (p − n) ≡ Ak (−n) ≡ −Ak (n) mod p k [odd symm.]. (c) For m + n = p − 1: Dk+1 (m) ≡ Dk+1 (n) mod p 2k+1 [even symm.]. (d) For m + n = p − 1 and natural cubic roots Ck (m) + Ck (n) = p k − 1: Dk+1 (m) ≡ / Dk+1 (n) mod p 3k+1 [asymmetry]. Proof (a) Core function Ak (n) ≡ nq mod p k (q = p k−1 , n ≡ / 0 mod p) has just p − 1 distinct residues with (nq )p ≡ nq mod p k , and Ak (n) ≡ n mod p (FST). Include non-core Ak (0) ≡ 0 then Ak (n) mod p k is periodic in n with period p, so Ak (n +
114
8 Additive Structure of Units Group mod p k , with Carry Extension
Table 8.1 Cores C1 ..C3 , increment symmetry mod p 2k+1 of C2 ..C4 . For cubic roots of 1 mod pk : asymmetry mod p3k+1 in C2 ..C4
p) ≡ Ak (n) mod p k . Hence difference dk (n) mod p k of two functions of period p also has period p. (b) (−n)q = −nq , odd q = p k−1 , yields odd symmetry Ak (p − n) ≡ Ak (−n) ≡ −Ak (n) mod p k (c) Difference polynomial dk (n) = (n + 1)q − nq has leading term qnq−1 . Even degree q − 1 results in even symmetry as follows: dk (n − 1) = nq − (n − 1)q = −(−n)q + (−n + 1)q = dk (−n). Now Ck (n) = p k − Ck (p − n) < p k , and for m + n = p − 1 : Ck (m + 1) = p k − Ck (n), so: Dk+1 (m) = [p k − Ck (n)]p − [Ck (m)]p and Dk+1 (n) = [p k − Ck (m)]p − [Ck (n)]p . For a brief notation write: Ck (m) = a, Ck (n) = b, and h = (p − 1)/2 then: Dk+1 (m) − Dk+1 (n) = [(p k − b)p + bp ] − [(p k − a)p + a p ] ≡ −h[bp−2 − a p−2 ]p 2k+1 + [bp−1 − a p−1 ]p k+1 mod p 3k+1 ≡ 0 mod p 2k+1 , because by FST: a p−1 ≡ bp−1 ≡ 1 mod p k .
(∗ )
8.4 Symmetries as Functions Yield ‘Triplets’
115
(d) Carry difference (bp−1 − a p−1 )/p k ≡ / h(bp−2 − a p−2 ) mod p k is required, ∗ to avoid cancellation in ( ). It suffices to show this for k=1 and 0-extensions 1 < a, b < p of cubic roots of 1 mod p. Using b ≡ a 2 ≡ a −1 , bp−2 − a p−2 ≡ −(b − a) mod p, and h = (p − 1)/2 ≡ −1/2 mod p: the carry difference must satisfy (cd): (bp−1 − a p−1 )/p ≡ / (b − a)/2 mod p. Let a 3 ≡ cp + 1 mod p 2 with carry c, then for 3m m > 0: a ≡ mcp + 1 mod p 2 . So a p−1 ≡ [(p − 1)/3]cp + 1 mod p 2 , and similarly for cubic root power b3 . In other words, in extension group B2 ≡ {xp + 1} ≡ (p + 1)x mod p 2 the coeff. of p is proportional to the exponent. For a p−1 vs. a 3 the ratio is (p − 1)/3. However in (cd), adapted for third powers a 3 , b3 it is (p − 1)/(3/2) = 2(p − 1)/3, hence the (cd) inequivalence holds. So for the cubic roots of 1 mod p k , with a + b = Ck (m) + Ck (n) = p k − 1: Core increment has asymmetry: Dk+1 (m) ≡ / Dk+1 (n) mod p 3k+1 . Corollary 8.4 Prime p ≡ 1 mod 6, and any precision k > 0: For x 3 ≡ y 3 ≡ 1 mod p k (cubic roots x, y ≡ / 1): 0-extensions X, Y < p k of x, y have X p , Y p k+1 mod p in core Ak+1 with X p + Y p ≡ −1 mod p k+1 and X p + Y p ≡ / (p k − p 3k+1 1) mod p .
8.4 Symmetries as Functions Yield ‘Triplets’ Any solution of (2 ): a p + bp = −1 mod p k has at least one term (−1) in core, and at most all three terms in core Ak . To characterize such solution by the number of terms in core Ak , quadratic analysis (mod p 3 ) is essential since proper inclusion Ak ⊂ Fk requires k ≥ 3 (Corollary 8.1). The cubic root solution, involving one inverse pair has all three terms in core Ak>1 . A computer search (Table 8.2) reveals another type of (2 ) mod p 2 solution for some p ≥ 59: a tripletp of three inverse pairs of p-th power residues in core A2 . Lemma 8.7 A tripletp of three inverse-pairs of p-th power residues in Fk satisfies: (3a) a + b−1 ≡ −1 (mod p k ) (3b) b + c−1 ≡ −1 „ (3c) c + a −1 ≡ −1 „ with abc ≡ 1 mod p k . Proof Multiplying by b, c, a resp. maps (3a) to (3b) if ab ≡ c−1 , and (3b) to (3c) if bc ≡ a −1 , and (3c) to (3a) if ac ≡ b−1 , together implying abc ≡ 1 mod p k . Table 8.2 shows all normed solutions of (2 ) mod p 2 for p < 200, with a tripletp at p = 59, 79, 83, 179, 193. The cubic roots indicated by C3 occur only at p ≡ 1 mod 6, while a tripletp can occur for either prime type ±1 mod 6. More than one tripletp can occur per prime: two at p = 59, three at 1093 (dec) = [1111111] base 3 (one of the two known Wieferich primes [6, 7]), and four at 36847, each the first occurrence of such multiple tripletp . There are primes for which both root forms occur, e.g. p = 79 has a cubic root solution as well as a tripletp .
116
8 Additive Structure of Units Group mod p k , with Carry Extension
Table 8.2 FLT2 root: inv-pair (C3 ) & tripletp (for p < 200)
Such loop of inverse-pairs in residue ring Z mod p k has no length beyond 3, seen as follows. Consider the successor S(n) = n + 1 and the two symmetries: complement C(n) = −n and inverse I (n) = n−1 , as functions which compose associatively.
8.4 Symmetries as Functions Yield ‘Triplets’
117
Theorem 8.2 (Two basic solution types) Each normed solution of (2 ) is (an extension of) a tripletp or an inverse-pair. Proof Assume r equations 1 − n−1 i ≡ ni+1 form a loop of length r (indices mod r). Consider function I CS(n) ≡ 1 − n−1 , composed of the three elementary functions: Inverse, Complement and Successor, in that sequence. Let E(n) ≡ n be the identity function, and n = 0, 1, −1 to prevent division by zero, then under function composition the third iteration [I CS]3 = E, because [I CS]2 (n) ≡ −1/(n − 1) → [I CS]3 (n) ≡ n (repeat substituting 1 − n−1 for n). Since C and I commute, I C = CI , the 3! = 6 permutations of {I, C, S} yield only four distinct dual-foldedsuccessor “dfs” functions: I CS(n) = 1 − n−1 , CSI (n) = (1 − n)−1 ,
SCI (n) = −(1 + n)−1 , I SC(n) = −(1 + n−1 ).
By inspection each of these has [df s]3 = E, referred to as loop length 3. For a cubic rootpair dfs = E, and 2-loops do not occur since there are no duplets (Sect. 8.4.1 note 2). Hence solutions of (2 ) have only dfs function loops of length 1 and 3: inverse pair and tripletp . A special tripletp occurs if one of a, b, c equals 1, say a ≡ 1. Then bc ≡ 1 since abc ≡ 1, while (3a) and (3c) yield b−1 ≡ c ≡ −2, so b ≡ c−1 ≡ −2−1 . Although triplet (a, b, c) ≡ (1, −2, −2−1 ) satisfies conditions (3), 2 is not in core Ak>2 , and by symmetry a, b, c ≡ / 1 for any tripletp of form (3). If 2p ≡ / 2 mod p 2 then 2 is not a p-th power residue, so triplet (1, −2, −2−1 ) is not a tripletp for such primes, for at least all primes upto 4.1012 [7], except the two Wieferich primes [6]: 1093 (dec) = [1111111] base 3, and 3511 (dec) = [6667] base 8.
8.4.1 A Triplet for Each Unit n in Gk Notice the proof of Theorem 8.2 does not require p-th power residues. So any n ∈ Gk generates a triplet by iteration of one of the four dfs functions, yielding the main triplet structure of Gk : Corollary 8.5 Each unit n in Gk (k > 0) generates a triplet of three inverse pairs, except if n3 ≡ 1 and n ≡ / 1 mod p k (p ≡ 1 mod 6), which involves one inverse pair. Starting at n0 ∈ Gk six triplet residues are generated upon iteration of e.g. SCI (n): ni+1 ≡ −(ni + 1)−1 (indices mod 3), or another dfs function to prevent a non-invertible residue. Less than 6 residues are involved if 3 or 4 divides p − 1: If 3|(p − 1) then a cubic root of 1 (a 3 ≡ 1, a ≡ / 1) generates just 3 residues: a + 1 ≡ −a −1 , yielding with its complement a subgroup (a + 1)∗ ≡ C6 (Fig. 8.1, p = 7).
118
8 Additive Structure of Units Group mod p k , with Carry Extension
If 4 divides p − 1 then an x on the vertical axis has x 2 ≡ −1 so x ≡ −x −1 , so then the three inverse pairs involve only five residues (Fig. 8.2: p = 5). 1. It is no coincidence that the period 3 of each dfs composition exceeds by one the number of symmetries of finite ring Z(+, .) mod p k . 2. No duplet occurs: multiply a + b−1 ≡ −1, b + a −1 ≡ −1 by b resp. a. Then ab + 1 ≡ −b and ab + 1 ≡ −a, so that −b ≡ −a and a ≡ b. 3. Basic triplet mod 32 : G2 ≡ 2∗ ≡ {2, 4, 8, 7, 5, 1} is a 6-cycle of residues mod 9. Iterate: SCI (1)∗ : −(1 + 1)−1 ≡ 4, −(4 + 1)−1 ≡ 7, −(7 + 1)−1 ≡ 1, and abc ≡ 1.4.7 ≡ 1 mod 9.
8.4.2 The EDS Argument Extended to Non-Core Triplets The EDS argument for the cubic root solution CR (Lemma 8.5), with all three terms in core, also holds for any tripletp mod p 2 . Because A2 ≡ F2 mod p 2 , so all three terms are in core for some linear transform (5). Then for each of the three equivalences (3a–c) holds the EDS property: (x + y)p ≡ x p + y p , and thus no finite (equality preserving) extension exists, yielding inequality for the corresponding integers for all k > 1, to be shown next. For p ≡ 1 mod 6 a cubic root solution is a special tripletp with a ≡ b ≡ c in (3a–c). Denote the p − 1 core elements as residues of integer function Ak (n) = n|Bk | (0 < n < p), then for any k > 2 consider: (4) Core increment form Ak (n + 1) − Ak (n) ≡ (rn )p mod p k , with (rn )p ≡ 1 mod p 2 . This tripletp rootform with two terms in core, and (rn )p ≡ / 1 mod p 3 , is useful for the additive analysis of subgroup Fk of p-th power residues mod p k , in essence: the known Fermat’s Last Theorem FLT case1 for residues coprime to p, discussed in the next section. Any assumed FLT case1 solution (5) for integers < p kp can be transformed to (4), in two equality preserving steps. Namely first a multiplicative scaling by an integer p-th power factor s p that is 1 mod p 2 (so s ≡ 1 mod p), to yield as one lefthand term the core residue Ak (n + 1) mod p k . And secondly an additive translation by integer term t which is 0 mod p 2 applied to both sides, resulting in the other left-hand term −Ak (n) mod p k , while preserving integer equality. Assuming, without loss, the normed form with zp ≡ 1 mod p 2 , such linear transformation (s, t) yields: (5) x p + y p = zp ←→ (sx)p + (sy)p + t = (sz)p + t [integers], with s p x p ≡ Ak (n + 1), (sy)p + t ≡ −Ak (n) mod p k , so: (5 ) Ak (n + 1) − Ak (n) ≡ (sz)p + t mod p k , equivalent to 1 mod p 2 . With s p ≡ zp ≡ 1, t ≡ 0 mod p 2 this yields an equivalence which is 1 mod p 2 , hence a p-th power residue, and (5 ) has two of the three terms in core, for k > 2. All three terms of a tripletp mod p 2 are in core (Corollary 8.2). In core increment
8.5 Relation to Fermat’s Small and Last Theorem
119
form (4) for k >2 this holds apparently only if the right-hand side (rn )p ≡ 1 mod p k , yielding: Corollary 8.6 For precision k > 2 (base p): Core increment form (4) with three terms in core Ak is the cubic root solution, and: an FLT equivalence mod p k with three terms in core is a (scaled) cubic root solution. Lemma 8.8 The p-th powers of 0-extended terms of a triplet p (mod p k ) yield integer inequality. Proof In a tripletp for some odd prime p the core increment form (4) holds for three distinct values of n < p. Consider each tripletp equivalence separately, and let r denote any of the three rn , with core residues Ak (n + 1) ≡ x p ≡ x, −Ak (n) ≡ y p ≡ y mod p k . Then x p + y p ≡ x + y ≡ r p mod p k , where r p ≡ 1 mod p 2 , has both summands in core, but r p ≡ / 1 mod p k for k > 2 is not in core, with deviation p k d ≡r −r ≡ / 0 mod p . Hence r ≡ r p + d ≡ (x + y) + d mod p k (with d ≡ 0 mod p k in the cubic root case), and x p + y p ≡ x + y ≡ (x + y + d)p mod p k . The corresponding 0-extensions yield integer p-th power inequality: X p + Y p < (X + Y + D)p . In the case of cubic roots in core Ak , less than full pk digit precision (base p), namely mod p 3k+1 suffices to yield the FLT inequality (Corollary 8.4). For any tripletp mod p 2 , necessarily in core A2 , and for cubic roots of 1 mod p k (any k > 0), holds (x + y)p ≡ x + y ≡ x p + y p , where exponent p distributes over a sum. By binomial expansion the sum of mixed terms yields integer (X + Y )p − (X p + Y p ) = 0 of precision kp, which is 0 mod p 2 for any tripletp . For any tripletp mod p k (k > 2), say in core increment form (5 ), it is conjectured that there is a least precision m(k) [base p], not exceeding that for cubic roots, which implies inequivalence X p − Y p ≡ / Z p mod p m (Z p ≡ 1 mod p 2 ) for successive core 0-extensions X, Y < pk : Conjecture The 0-extensions X, Y, Z < p k of terms in any triplet p mod p k equivalence, in core increment form (5 ), with X − Y = Z ≡ 1 mod p 2 yield: X p − Yp ≡ / Z p mod p 3k+1 .
8.5 Relation to Fermat’s Small and Last Theorem Core Ak as FST extension mod p k>1 , the additive zero-sum property of its subgroups (Theorem 8.1), and the triplet structure of units group Gk (Theorem 8.2), allow a direct approach to Fermat’s Last Theorem: (6) x p + y p = zp (prime p > 2) has no solution for positive integers x, y, z with case1 : xyz ≡ / 0 mod p, and case2 : p divides one of x, y, z.
120
8 Additive Structure of Units Group mod p k , with Carry Extension
Usually (6) mentions exponent n > 2, but it suffices to show inequality for primes p > 2, because composite exponent m = p.q yields a pq = (a p )q = (a q )p . In case2 : p divides just one term, because if p divides two terms then it also divides the third, and all terms can be divided by p p . A finite integer FLT solution of (6) has three p-th powers < p m for some finite fixed m = kp, with x, y, z < pk , so (6) holds mod p m , yet with no carry beyond p m−1 , 0-extending all terms. The present approach needs only a simple form of Hensel’s lemma [5] (in the general p-adic number theory), which is a direct consequence of Corollary 8.2: extend digit-wise the normed 1-complement form (2 ) such that the i-th digit of weight p i in a p and bp sum to p − 1 (0 ≤ i < k), with p choices per extra digit. Thus to each normed solution of (2 ) mod p 2 correspond p k−2 solutions mod p k : Corollary 8.7 (1-complement extension) For k > 2: a normed FLT k root is an extended FLT 2 root.
8.5.1 Proof of the FLT Inequality Regarding FLT case1 , cubic root of 1 and tripletp are the only (normed) FLT k roots (Theorem 8.2). Any assumed integer case1 solution has a corresponding equivalent core increment form (4) with two terms in core, which by Lemma 8.8 has no integer extension, contradicting the assumption, as follows: Theorem 8.3 (FLT Case 1): For prime p >2 and integers x, y, z > 0 coprime to p: x p + y p = zp has no solution. Proof An FLT k (k > 1) solution is a linear transformed extension of an FLT 2 root in core A2 = F2 (Corollary 8.7). By Lemma 8.8 it has no finite p-th power extension, yielding the theorem. In FLT case2 just one of x, y, z is a multiple of p, hence p p divides one of the three p-th powers in x p + y p = zp . Again, any assumed case2 equality can be transformed to an equivalence mod p p with two terms in core Ap , having no integer extension, contra the assumption. Theorem 8.4 (FLT case2 ) For prime p >2 and positive integers x, y, z: if p divides only one of x, y, z then x p + y p = zp has no solution. Proof In a case2 solution p divides a left-hand term, x = cp or y = cp (c > 0), or the right hand side z = cp. Bring the multiple of p to the right hand side, for instance if y = cp then zp − x p = (cp)p , while otherwise x p + y p = (cp)p . So the sum or difference of two p-th powers coprime to p must be shown not to yield a p-th power (cp)p for any c > 0:
8.6 Conclusions and Remarks
121
(7) x p ± y p = (cp)p has no solution for integers x, y, c > 0. Notice that core increment form (4) does not apply here. However, by FST the two left-hand terms, coprime to p, are either complementary or equivalent mod p, depending on their sum or difference being (cp)p . Scaling by s p for some s ≡ 1 mod p, so s p ≡ 1 mod p 2 , transforms one left-hand term into a core residue Ap (n) mod p p , with n ≡ x mod p. And translation by adding t ≡ 0 mod p 2 yields the other term Ap (n) or −Ap (n) mod p p respectively. The right hand side then becomes s p (cp)p + t, equivalent to t mod p p . So an assumed equality (7) yields, by two equality preserving transformations, the next equivalence (8), where Ap (n) ≡ u ≡ up mod p p (u in core Ap for 0 < n < p with x ≡ n mod p) and s ≡ 1, t ≡ 0 mod p 2 : (8) up ± up ≡ u ± u ≡ t mod p p (u ∈ Ap ), with u ≡ (sx)p , ±u ≡ ±(sy)p + t mod p p . Equivalence (8) does not extend to integers, because U p + U p > U + U , and U p − U p = 0 = T , where U, T are the 0-extensions of u, t mod p p respectively. But this contradicts assumed equalities (7), which consequently must be false. Note From a practical point of view the FLT integer inequality with terms < ppk of a 0-extended FLT k root (case1 ) is caused by the carries beyond p k , amounting to a multiple of the modulus p k , produced in the arithmetic (base p). In the expansion of (a + b)p , the mixed terms can vanish mod p k for some a, b, p. Ignoring the carries yields (a + b)p ≡ a p + bp mod p k , and the EDS’ property is as it were the syntactical expression of ignoring the carry (overflow) in residue arithmetic. In other words, in terms of p-adic number theory, this means ‘breaking the Hensel lift’: the residue equivalence of an FLT k root mod p k , although it holds for all k > 0, does imply inequality for integer p-th powers < p pk due to its special triplet structure, where exponent p distributes over a sum.
8.6 Conclusions and Remarks 1. The two symmetries −n, n−1 determine FLT k roots, which are necessary for an FLT integer solution. However, these symmetries (automorphisms) do not exist for positive integers. 2. Another proof of FLT case1 might use product 1 mod p k of FLT k root terms: ab ≡ 1 or abc ≡ 1, which is impossible for integers > 1. The p-th power of a k-digit natural requires upto pk digits. Arithmetic mod p k ignores carries of weight p k and beyond. Interpreting a given FLT k equivalence in naturals < p k , their p-th powers produce for p > 2 carries that cause inequality. 3. Core Ak ⊂ Gk as extension of FST to mod p k>1 , and the zero-sum of its subgroups (Theorem 8.1) yielding the cubic FLT root (Lemma 8.5), initiated this work. The triplets were found by analysing a computer listing (Table 8.2) of the FLT roots mod p 2 for primes p < 200.
122
8 Additive Structure of Units Group mod p k , with Carry Extension
4. Linear analysis (mod p 2 ) suffices for root existence (Hensel, Corollary 8.2), but tripletp core increment form (4) with two successor terms in core requires quadratic analysis (mod p 3 ). Similarly, FLT case1 inequivalence mod p 3k+1 holds for increments of Ck+1 ≡ (Ck )p for 0-extended core Ak . 5. “FLT has no finite solution” and “[I CS]3 has no finite fixed point” are equivalent, yet each n ∈ Gk is a fixed point of [I CS]3 mod p k (re: FLT 2 roots imply all roots for k > 2, yet no 0-extension to integers). 6. Crucial in finding the arithmetic triplet structure were extensive computer experiments, and the application of associative function composition, the essence of semi-groups, to the three elementary functions: successor S(n) = n + 1, complement C(n) = −n and inverse I (n) = n−1 , with period 3 for SCI (n) = −(n + 1)−1 and the other three such compositions. In this sense FLT is not a purely arithmetic problem, but essentially requires non-commutative and associative function composition.
References 1. T. Apostol: “Introduction to Analytical Number Theory”, Springer, Berlin, 1976 (Theorem 10.4-6) 2. N. Benschop: “The Semigroup of Multiplication mod pk , an Extension of Fermat’s Small Theorem, and Its Additive Structure”, International Conference on Semigroups and Their Applications, Prague, July 1996 3. A. Clifford, G. Preston: “The Algebraic Theory of Semigroups”, AMS Surv. #7 1, 130–135 (1961) 4. S. Schwarz: “The Role of Semigroups in the Elementary Theory of Numbers”, Math. Slovaca 31(4), 369–395 (1981) 5. G. Hardy, E. Wright: “An Introduction to the Theory of Numbers”, Oxford University Press, Oxford, 1979 (Chap. 8.3, Theorem 123) 6. A. Wieferich: “Zum letzten Fermat’schen Theorem”, J. Reine Angew. Math. 136, 293–302 (1909) 7. S. Mohit, M. Ram Murty: “Wieferich Primes and Hall’s Conjecture”, C. R. Acad. Sci. (Can.) 20(1), 29–32 (1998) 8. N. Benschop: “Powersums Representing Residues mod pk , from Fermat to Waring”, Comput. Math. Appl. 39(7–8), 253–261 (2000) 9. N. Benschop: US-5923888 (13 July 1999) on a Logarithmic Binary Multiplier, with Dual Bases 2 and 3 (Using 3 as Semi-Primitive Root of 1 mod 2k ) 10. N. Benschop: “Additive Structure of Z(.) mod p k , with Core and Carry Concepts for Extension to Integers”, Acta Mathematica Univ. Bratislava (Nov. 2005). http:// pc2.iam.fmph.uniba.sk/amuc/_vol74n2.html (pp. 169–184)
Chapter 9
Additive Structure of Z(.) mod mk (Squarefree) and Goldbach’s Conjecture The product mk of the first k primes (2..pk ) has neighbors mk ± 1 with all prime divisors beyond pk , implying there are infinitely many primes [Euclid]. All primes between pk and mk are in the group G1 of units in semigroup Zmk (.) of multiplication mod mk . Due to its squarefree modulus Zmk is a disjoint union of 2k groups, with as many idempotents—one per divisor of mk , which form a Boolean lattice BL. The additive properties of Zmk and its lattice are studied. It is shown that each complementary pair in BL adds to 1 mod mk , and each even idempotent e in BL has successor e + 1 in G1 . It follows that G1 + G1 ≡ E, the set of even residues in Zmk , so each even residue is the sum of two roots of unity, proving “Goldbach 2 for Residues” mod mk (GR). The smallest composite unit in G1 mod mk is pk+1 2 so its units between pk+1 and pk+1 are all prime, to be used as summands for successive 2n. Induction on k by extending these unit residues mod mk with ‘carry’ a < pk+1 of weight mk yields a Euclidean prime sieve for integers. Failure of Goldbach’s Conjecture (GC) for some 2n contradicts GR(k) for some k, yielding GC: Each 2n > 4 is the sum of two odd primes.
9.1 Introduction Detailed analysis of the algebraic structure of modulo arithmetic is pursued, especially multiplication in relation to addition and exponentiation. Addition and multiplication are associative operations, so semigroup structure analysis provides a good perspective for basic problems in arithmetic [2, 3, 6, 8] such as Goldbach’s conjecture of every even number 2n > 4 being the sum of two odd primes. The additive structure of multiplicative semigroups with squarefree moduli is studied, in ring Z(+, .) mod mk . Choosing as modulus the product mk of the first k primes, all primes between pk and mk are in the group of roots of 1 mod mk , denoted as the group G1 of units. As shown (Theorem 9.1), G1 + G1 covers all even residues 2n in Z mod mk . The direct product Zrs = Zr × Zs of multiplications with coprime component moduli r and s, is represented by component-wise multiplication [4]. Squarefree modulus mk implies Zmk (.) = Zp1 × · · · × Zpk is a direct product of multiplications mod pi . This direct product is analysed as an ordered disjoint union of maximal subgroups derived from the component semigroups Zpi . The emphasis is on the additive properties of idempotents, and the “fine structure” of residue ring Z(+, .) mod mk . Induction on k and carry extension transfers additive results from residues to positive integers. In fact residues x mod mk are viewed as naturals x < mk without carry, and sum x + y has natural upper bound x + y < 2mk with a possible carry of at most 1. For N.F. Benschop, Associative Digital Network Theory, © Springer Science + Business Media B.V. 2009
123
124
9 Additive Structure of Z(.) mod mk (Squarefree) and Goldbach’s Conjecture
instance in Lemma 9.1: the sum of each pair of complementary idempotents equals 1 mod mk , yielding the natural sum mk + 1 for pairs other than {0, 1}. Notation: The known number representation (base m) n = c.m + r with carry c and rest 0 ≤ r < m is used. Operation + is natural addition, and two summands < mk can produce a maximal carry of 1 (base mk ). For residue arithmetic c = 0. If no confusion arises, m will denote modulus mk , ≡ denotes congruence mod mk . Section 9.3 interprets residues n mod mk as naturals n < mk , and by extension with carry a < pk+1 of weight mk this yields all naturals n + a.mk < mk+1 . The required proof applies induction over k. The idempotents e2 ≡ e of Zm (.) play an essential role. For prime modulus p it is known that Zp has just two idempotents: 0 and 1 mod p. And all residues 1, .., p − 1, coprime to p, are in some permutation generated as residues of powers g i of some primitive root g < p of unity [1]. They form an order p − 1 cyclic subgroup G of Zp , written G = g ∗ ≡ {g i } (i = 1..p − 1), with g p−1 ≡ 1. Hence Zp (.) is a cyclic group, adjoined to zero. Summary: The product mk of the first k primes, and induction on k, are used for analysis of all primes and their additive properties. Each of the 2k divisors d of mk yields a maximal subgroup Gd of Zmk containing all n < mk with the same set of prime divisors as d. The respective group identities are the 2k idempotents of Zmk , ordered as Boolean lattice BL [4, 6] of which the additive properties are studied. The additive properties of Zmk are characterized by the successor n + 1 of any n, especially of the idempotents. An essential additive property is that each complementary pair of idempotents in BL sums to 1 mod mk (Lemma 9.1), and every even e2 = e has successor e + 1 in G1 , while G1 + G1 covers all 2n mod mk . This residue version GR of Goldbach’s Conjecture (GC) is extended, by induction on k, to prove GC for positive integers. Results listed in the Conclusions may be new. For completeness, these essential concepts [5, 6] are reviewed in Sects. 9.1 and 9.2. Section 9.3 specifies a “Euclidean prime sieve” by induction on k, for extending residues to integers by a carry mechanism. Section 9.4 gives the approach to Goldbach’s conjecture, followed by conclusions.
9.2 Lattice of Groups In modulus mk = pi (i = 1..k) each prime factor has exponent one. So mk , having no square divisor, is called square free. The prime divisors of mk are referred to as base primes. Residues n with the same base-prime divisors as squarefree divisor d|mk form a maximal subgroup Gd ⊂ Zmk (.) with closure due to all possible products having the same base primes. If e is the identity (idempotent) of Gd , then each n in subgroup Gd ≡ Ge has a unique local inverse n−1 defined by n.n−1 ≡ e. The 2k divisors of mk correspond to as many subsets of the k base primes. Each divisor d of mk generates a finite cycle d ∗ = {d i } with an idempotent d, the identity of subgroup Gd . Each subgroup has just one idempotent as its identity. So Zmk has 2k disjoint subgroups Gd , one for each divisor d of mk , ordered in a Boolean lattice as their identities are ordered, as follows.
9.2 Lattice of Groups
125
9.2.1 Ordering of Commuting Idempotents Zmk is a disjoint union of 2k groups Gd , and the group identities, the idempotents, form a Boolean lattice. In fact, commuting idempotents e2 = e, f 2 = f can be ordered e ≥ f whenever ef = f e = f , in other words e is identity for f . This is readily verified to be an ordering relation, being transitive, anti-symmetric and reflexive [4]. The lattice meet (greatest lower bound) operation is modeled by multiplication. The product of two commuting idempotents e, f is idempotent: ef.ef = eff e = ef e = eef = ef , while e, f are left- and right-identity for ef since e.ef = ef = f e = f e.e, so that e ≥ ef , and similarly f ≥ e. Also, ef is the greatest idempotent ordered under e and f , since c ≤ e and c ≤ f imply c ≤ ef , which is easily verified. The join (least upper bound) of two idempotents is the idempotent with the intersection of the corresponding baseprime sets. Idempotent ‘1’ at the top has the smallest (empty) base-prime set, while ‘0’ at the bottom contains all base-primes since 0 ≡ m mod m. The sum of two idempotents is generally not an idempotent, nor is its generated idempotent their lattice-join, except for complementary idempotents, derived next.
9.2.2 Lattice of Idempotents: Add vs Join As shown earlier, the set of idempotents of Z mod m is closed under multiplication, forming a lower semi-lattice [4, 6]. Multiplication models the meet (glb: greatest lower bound) operation of two idempotents, yielding an idempotent with the union of the respective base-prime sets. Notice all primes p: pk < p < mk are in topgroup G1 . In the base-prime set of any idempotent or subgroup they are considered equivalent to 1 mod mk . For instance, cycle 2* mod m (in G2 ) produces residues c.2n , where c ∈ G1 are relative prime to m, and c has prime divisors pr > pk . Residues in G1 can occur as factor in each n ∈ Zm , according to their name of the units of Zm . The join (least upper bound lub) of two idempotents follows by intersecting their baseprime sets, yielding an idempotent with their common baseprimes. Definition Two idempotents a, b are complementary iff ab ≡ 0 and lub(a, b) ≡ 1. The endomorphism ‘.e’ for idempotents e in commutative Zm (.) models the lattice meet operation by multiplication, since for each x, y ∈ Zm : xy.e ≡ xy.e2 ≡ xe.ye. Although in general the sum of two idempotents is not an idempotent, the next exception is an essential additive property of Zm (.): Lemma 9.1 For any squarefree m > 1 with at least two prime divisors: Any complementary pair {a, b} = {0, 1} of idempotents in Zm (.) has a + b = m + 1.
126
9 Additive Structure of Z(.) mod mk (Squarefree) and Goldbach’s Conjecture
Proof The lattice of idempotents has order 2k , with 2k−1 complementary pairs. Consider a sublattice of order four: 0, 1 and any other complementary pair a, b. It must be shown that a + b ≡ 1 mod m. Now idempotents a, b are complementary, so ab ≡ 0 mod m, implying: (a + b)2 ≡ a 2 + 2ab + b2 ≡ a + b (mod m), thus a + b is idempotent. And (a + b)a ≡ a 2 + ba ≡ a mod m, so a + b ≥ a, and similarly a + b ≥ b. Hence a + b ≡ 1 mod m, because by lub(a, b) ≡ 1 the only idempotent covering complementary a and b is 1. Since a + b < 2m a possible carry is at most 1, so a + b = m + 1 for {a, b} = {0, 1}. In other words: complementary idempotents a, b have disjoint base-prime sets A and B, and union A ∪ B consists of all base-primes in m. For square-free m, a.b ≡ 0 is the idempotent containing all base-primes. And join(a, b) has the trivial intersection A ∩ B = 1 as base-prime set, relative prime to m, with idempotent ‘1’ of G1 . Lemma 9.2 For squarefree modulus m = 2.odd: h = m/2 is the lowest odd idempotent in Zm (.) and a → a + h is the only additive automorphism of Zm (.) Proof Notice 2h ≡ 0, so for each even or odd pair a, b in Zm holds (a + b)h ≡ 0. Hence (a + h)(b + h) ≡ ab + (a + b)h + h2 ≡ ab + h , and only if h2 ≡ h this yields a → a + h as additive automorphism of Zm (.). Furthermore, h = m/2 is the lowest odd idempotent, namely the image under +h of the lowest even idempotent 0 in Zm (for squarefree m: no divisors of 0 exist). It is readily verified that this morphism is 1-1 onto, mapping Zm (even) and Zm (odd) into each other. Now consider product m = mk = ki=1 pi of the first k primes. Unit 1 is ordered at the top of the lattice of idempotents, being the identity for all idempotents in Zm = ×i Zpi . Top group G1 of all residues relative prime to m misses all base primes. Thus G1 = ×i C(pi − 1) [i = 2..k] is a direct product of k − 1 cycles of period pi − 1. Corollary 9.1 In Z(.) mod m with square-free m = 2.odd, and let h = m/2 then: Odd and even top-groups are isomorphic G1 ∼ = G2 with additive automorphism +h. ∼ 2∗ in G1 resp. G2 (e.g. if m = 30 then Notice isomorphic max cycles (2 + h)∗ = i h = 15 and p = 15 ± 2 holds for primes 5 < p < 25).
9.3 Primes, Composites and Neighbors Equivalent sum and difference: (−1)2 =1 implies −1 ∈ G1 , so G1 ≡ −G1 and: G1 + G1 ≡ G1 − G1 .
(9.1)
9.3 Primes, Composites and Neighbors
127
So sums and differences of pairs in G1 yield the same set of residues mod m. Notice (−n)2 = n2 so n and −n, generating the same idempotent, are in the same subgroup: For every group Gd ⊂ Zm : if n ∈ Gd then so is −n, while Gd + Gd ≡ Gd − Gd . (9.2) – On neighbors n+1 and n − 1 of n in the lattice of Zm : For integers and residues: n and n+1 are coprime for each n so their prime divisors form disjoint sets. The same holds for n and n − 1. Then one would expect n and n+1 to be in complementary subgroups of Zm . More precisely, the subgroup ordering of their idempotents implies: Lemma 9.3 For each n ∈ Zm and base-prime complementary n: Gn±1 ≥ Gn . Proof Due to subgroup ordering, a subset of baseprimes disjoint from (complementary to) those in n defines a subgroup ordered above or equal to Gn . Hence e + 1 for any even idempotent e must be in an odd subgroup Gd that is ordered Gd ≥ Ge , with e the complement of e in the lattice of Zm . In fact, as shown next: e + 1 is in topgroup G1 .
9.3.1 Each Idempotent’s Successor is in G1 or G2 The sum of two complementary idempotents yields an idempotent namely 1 mod mk (Lemma 9.1), which is their join or least upper bound. This is an exception, and in general idempotents do not sum to an idempotent, let alone their join. For instance, in Z10 with idempotents 1, 5, 6, 0 : 5 + 1 = 6 is idempotent, but join(5, 1) = 1. And join(6, 1) = 1 while 6 + 1 = 7 is not idempotent, although 7 does generate the proper idempotent 1, due to: Lemma 9.4 In Z(.) mod m, with square-free m = 2.odd: (a) Each even idempotent e has e + 1 in G1 , and (b) each odd idempotent d has d + 1 in G2 . (c) For period n of e + 1 in G1 mod mk holds: (2n − 1)e ≡ 0. Proof (a), (c): Given e2 = e, notice that (e + 1)(e − 1) ≡ e2 − 1 ≡ e − 1, so e + 1 is identity for e − 1, hence Ge+1 ≥ Ge−1 for every idempotent e. Now (e + 1)2 ≡ e2 + 2e + 1 ≡ 3e + 1, and in general expanding (e + 1)n , with ei ≡ e for all i > 0 and factoring out e, yields: (e + 1) ≡ 1 + n
n n i=1
i
ei ≡ 1 + (2n − 1)e.
We need to show c = − 1)e ≡ 0 for every even idempotent e, where n is the period of e + 1, with corresponding odd idempotent d = (e + 1)n = c + 1, which (2n
128
9 Additive Structure of Z(.) mod mk (Squarefree) and Goldbach’s Conjecture
equals 1 iff c ≡ 0. In fact it suffices if 2n − 1 is in a group complementary to Ge in the lattice of Zm . The baseprimes in 2n − 1, which are all necessarily odd, would then complement those in even idempotent e. This can be seen as follows: d 2 = d implies (c + 1)2 ≡ c + 1, hence c2 + c ≡ 0, so: (2n − 1)2 e + (2n − 1)e ≡ (2n − 1)(2n − 1 + 1)e ≡ (2n − 1)2n e ≡ 0. Apparently, the odd baseprimes in 2n − 1 complement at least those in e because their union is complete (product 0). This implies (2n − 1)e = c ≡ 0, independent of the extra factor 2n . So: (e + 1)n ≡ 1 + (2n − 1)e ≡ 1, where n is the period of e + 1 in G1 . Part (b) is dual to (a), proven similarly by using G1 ∼ = G2 (Corollary 9.1)
(9.3)
Theorem 9.1 (Goldbach for Residues GR) For squarefree mk = pi (i = 1..k) with p1 =2, and set E of even residues mod mk : In Z mod mk holds E ≡ {2n} ≡ G1 + G1 ≡ G1 − G1 , so: Each even residue in Zmk is a sum or difference of two units. Proof In short write G for G1 . Let e be any even idempotent, then multiply e ∈ G − 1 (Lemma 9.4) on both sides by G. On the left-hand side this yields G.e = Ge which is the max-subgroup on e, and on the right-hand side G(G − 1) = G2 − G = G − G, so that Ge ⊆ G − G. Using (1) yields: Ge ⊆ G − G = G + G for all even Ge , so G + G covers all even residues. This also holds for any even squarefree modulus m = 2.odd. Theorem 9.1 can be generalized for naturals by careful extension of residues with carries, and by induction over k, as shown next.
9.4 Euclidean Prime Sieve Define G1 (k) as group of units mod mk , corresponding set G(k) of naturals {1, u} where pk < u < mk and u coprime to base primes p ≤ pk . Use notation G (k) if excluding 1, and set P (k) of all primes in G(k). If no confusion arises, the term unit is used for both residues and naturals. A Euclidean prime sieve with bases mk is derived by induction on k and carry-extending G(k). The primes p > pk−1 are congruent mod mk−1 to units in G1 (k − 1), and all those p < mk are covered by G(k − 1) + amk−1 (0 ≤ a < pk ). Notice each unit u ∈ G(k − 1) generates at most pk primes p = u + amk−1 ∈ P (k), with pk−1 < u < mk . For large enough 2n there are many additive prime pair representations in GC format. Since (pk+1 )2 is the smallest composite in G(k), all units u with pk < u < (pk+1 )2 in G(k) are prime. In fact each natural n < mk is represented uniquely by k digits of a multi base code using the successive baseprimes: p1 . . . pk . The k − 1 lower significant digits are extended with a most significant digit or carry a < pk , of weight mk .
9.4 Euclidean Prime Sieve
129
This in contrast to the usual single base code, e.g. decimal, using powers of ten. The successive bases 2, 6, 30, 210, . . . have maximal digit values pk − 1: 1, 2, 4, 6, . . . respectively. For instance decimal 331 = 210 + 112 = 1.210 + 4.30 + 0.6 + 0.2 + 1 yields 5-digit code 1 4 0 0 1. Definition Set Ta (k) ⊂ G(k + 1) of extensions of n ∈ G(k) by a positive digit a < pk+1 : Ta (k) = G(k) + a mk
for 0 < a < pk+1 (‘carry’ a),
(9.4)
translating G(k) by a multiple of mk , hence Ta (k) ≡ G1 (k) mod mk for all a. Notice G(k) ∪ Ta (k) for all a < pk+1 covers units set G(k + 1), thus all primes p > pk less than mk+1 and their composites starting at (pk+1 )2 . For k = 3 consider 31 = 1 + 1.30 and smallest composite 72 = 19 + 30 ∈ G(3) + 1.30 = T1 , while 209 = 11.19 = 29 + 6.30 ∈ T6 . Extensions Ta are in pk+1 − 1 adjacent disjoint intervals of size mk : G(k + 1) ⊂ G(k) ∪ {Ta (k) | 0 < a < pk+1 },
where Ta ∩ Tb = ∅ for a = b. (9.4a)
All primes p > 3 are congruent to {1, 5} mod 6, while primes p > p3 = 5 are congruent to the eight prime residues {1, 7, . . . , 23, 29} mod 30 in G1 (3), obtained from G(2) = {1, 5} by 5 − 1 = 4 extensions with increment m2 = 6, namely {7, 11}; {13, 17}; {19, 23}; {25, 29}. Composite 25 = 52 is not coprime to 30, hence is not in G(3). The other seven extensions are all primes p3 < p < 30 = m3 , forming with 1 the units in G1 (3) = C2 × C4 , in fact of form 15 ± 2i (Corollary 9.1). The 7 − 1 = 6 extensions Ta (3) of G(3) generate all 2.4.6 = 48 units in G(4): the 5 composites 11.{11, 13, 17, 19} and 132 , and all 6.8 − 5 = 43 primes in open interval (7, 210).
9.4.1 Pair Sums of Carry Extended Units Definition Set S0 (k) = G(k) + G(k) of pair sums of units, if excluding 1: S0 (k) = G (k) + G (k), and denote even numbers set E(k) = {4 < 2n < 2mk }. Table 9.1 shows these sums for k = 2 and 3 (by commutation half an array suffices). Notice G(2) = {1, 5} with pair sums S0 (2) = {2, 6, 10} and pair sums 2n in S0 (3) = G (3) + G (3) where G (3) = {7, . . . , 29} coprime to 2.3.5 = 30 = m3 , with 2p4 ≤ 2n < 2m3 , in interval [14, 58]. Moreover S0 (2) + m2 = {8, 12, 16} and S0 (2)+9m2 = {56, 60, 64} are required to extend S0 (2)∪S0 (3) to cover E(3), using 3 and 5 to avoid non-prime 1. In fact all 2n > 20 have several GC pair sums, e.g. each 2n ∈ S0 (2) + 6c = {2, 6, 10} + 6c for c > 2 has distinct unit pair sums, of which many prime pair sums.
130
9 Additive Structure of Z(.) mod mk (Squarefree) and Goldbach’s Conjecture
Table 9.1 Extension sums: carry sum diagonal a + b = c covers {2n, 2n ± 4} = S0 (2) + 6c Ta+Tb | 0 1 2 3 4 | carry b (wgt 6) _______#__1___5 # 7__11 13__17 19__23 25__29 | shift Tb 1 | .2. 6 | 37 | 38 42 44 48 50 54 60 62 66 |
9.4.2 Induction Base: Pair Sums of Primes in G(3) Definition Set Pc (k) of primes in extension Tc = G(k) + cmk−1 ⊂ G(k + 1). Then by (9.4): Pa (k) + Pb (k) ⊆ G(k) + G(k) mod mk
for a, b ≥ 0.
(9.4b)
So the cover mod mk given by prime sums over P (k) is not extended in the induction step to prime pair sums over P (k + 1). Essential is that if some 2n < mk would have no GC pair sum, this would contradict GR(k) [Theorem 9.1], not to be covered by residues for larger k. Definition Set Sa+b (k) = Ta (k) + Tb (k) = S0 (k) + (a + b)mk is the set of pair sums of extended units, with carries 0 ≤ a, b < pk+1 . For instance extend m2 = 6 to m3 = 30 (p3 = 5) then translations Sa+b of S0 = {2, 6, 10} yield 2(5 − 1) = 8 diagonals of 2 × 2 sums with carries a + b < 2(p3 − 1) (Table 9.1): S1 {8, 12, 16}, S4 {26, 30, 34},
S2 {14, 18, 22}, ...,
S3 {20, 24, 28},
S8 {50, 54, 58}.
9.4 Euclidean Prime Sieve
131
To avoid non-prime 1, use pair sums over {3, 5} for representing even numbers 6, 8, 10 < 2m2 = 12. Definition Set E(k) of all even numbers 2n with 4 < 2n < 2mk , where E(3) is induction base to cover Ek (k > 3) by pair sums of odd primes p < mk . (re: the Goldbach conjecture, to be proven by induction on k). Extending G(2) = {1, 5} yields G(3) = {G(2) + 6a | 0 < a < 5}, containing prime set P (3) = {15 ± 2i , 29} < m3 (i = 1, 2, 3) where 52 is not coprime to 30, so not in G(3). Lemma 9.5 (Induction base k = 3) Let P (3) = P (3) ∪ {3, 5, 31, 37} then: P (3) = G(3), and P (3) + P (3) covers E(3). Proof By complete inspection: Increments 4 in S0 (2) = {2, 6, 10} cause successive Sc with carry increment 6 to interlace, but only for induction base k = 3. Next sum range S0 (3) = G (3) + G (3) = {14, 18, 20, . . . , 52, 54, 58} has incr = 2 except at both ends {14, 18} and {54, 58}. This edge effect is solved by including primes 5 ∈ G(2) and 31, 37 ∈ G(4) with adjacent k ± 1, corresponding to edge carry sums c of 1 and 9 = 2p3 − 1. They yield missing prime sums 16 = 5 + 11, 44 = 13 + 31(= 7 + 37) and 56 = 19 + 37, while 7 ∈ G(3) with {3, 5} provides 6, 8, 10, 12. Hence E(3) = {2n ∈ [6, 60)} is covered by pair sums of primes p < m3 in G(3), extended with neighboring primes 3, 5 and 31, 37. So pair sum set S0 (3), adapted for the interlacing edge-effect, covers adjacent 2n in E(3). Hence interlacing does not occur for k >3, and only even carry sums a + b = 2c suffice for covering successive 2n by unit pair sums, in adjacent and disjoint extension sum intervals S2c (k), while: 2n ∈ E(k + 1) has a unique even carry-sum 0 ≤ 2c < 2pk , with 2n ∈ S2c (k). (9.5) This is to be used as induction base for k > 3, first for unit pair sum sets S2c (k). Definition Set S0 (k) = G(k) + G(k) of pair sums of units is complete if it covers E(k), otherwise it is incomplete. Lemma 9.6 (Induction step for unit pair sums) Using S0 (3) for S0 (3), then for k ≥ 3: Extension sums S2c (k), 0 ≤ 2c < 2pk+1 , partition E(k + 1) iff S0 (k) covers E(k). Proof Extension pair sumsets S2c (k) are disjoint and cover E(k + 1) only if S0 (k) ⊇ E(k), seen as follows. By (9.4) the Ta (k) are disjoint, and if x and y are in distinct extensions Ta (k) and Tb (k), then so are their extensions under any shift s = 2c.mk : x = y ↔ x + s = y + s.
132
9 Additive Structure of Z(.) mod mk (Squarefree) and Goldbach’s Conjecture
For distinct even carrysums 2c < 2c with c − c = d: S2c (k) ∩ S2c (k) = S2c (k) ∩ (S2c (k) + 2d.mk−1 ) = ∅. Their union covers E(k) only if pair sums S0 (k) = G(k) + G(k) cover E(k). Because some 2n missing from S0 (k) implies its translations 2n = 2n + 2c.mk are also missing from all S2c (k) for 2c > 0.
9.4.3 Excluding Composites in G(k), Baseprimes and 1 as Summands In the described extension pair sum procedure, diagonals with constant carry difference a − b = d are parallel to main diagonal a = b (d = 0), see (9.4a) and Table 9.1. Only diagonals with d ≥ 0 suffice because addition is commutative. The two sets of diagonals, of constant sum resp. difference, form an orthogonal coordinate pair that is relevant to prime sum analysis, with a unique extension carrysum 2c for each 2n as essential property (9.5). The regular diagonal pattern is broken by removing composites. After reindexing, the remaining primes grow faster than linear with their index, so pi+j > pi + pj , due to the gaps left by composites. One might expect this to cause some 2n to disappear from P (k) + P (k). But such failure of GC would contradict Theorem 9.1 (GR), to be shown in the next section. First are discussed some details on composites in G(k), non-prime 1, and avoiding base primes as summands except for some small 2n in the induction base E(3) < 2.30. Units group G(k), coprime to baseprimes 2..pk , contains pk+1 as smallest prime, so the smallest composite in G(k) is (pk+1 )2 . Notice G(3) has no composites since (p4 )2 = 49 > 30 = m3 . Furthermore, the units u ∈ G(4) are in interval (7 < u < 210) with smallest prime p5 = 11, hence minimal composite 112 = 121, so all units of G(4) in [11, 112 ) and coprime to 2.3.5.7 = 210 are prime. By inspection all 2n in interval [22..222] are covered by prime pair sums, of which those 2n < 210 involve no carry. The known Bertrand’s Postulate (Chebyshev 1850, simplified by S. Pillai 1944) is useful to prove a complete cover of even naturals: BP (Bertrand’s Postulate) For each n > 1 there is at least one prime between n and 2n. Notice that Pillai’s proof [7] also has an induction base of 2n ≤ 60. In order to guarantee prime summands, consider only pair sums of units u < (pk+1 )2 , the smallest composite in G(k). Successive k yield 2n in overlapping intervals by BP, thus covering all 2n beyond the induction base. Using pk+1 < 2pk (by Bertrands Postulate) the next lemma is readily verified, on the absence of a carry for k > 4. Lemma 9.7 For k ≥ 5 all prime pairsums 2n with 2pk+1 ≤ 2n < 2(pk+1 )2 have upperbound 2(pk+1 )2 < mk , so no carry is produced in such prime pair sums.
9.5 Proving GC via GR(k) by Induction on k
133
At k = 5 with pk+1 = p6 = 13 this primesum upperbound is 2(p6 )2 = 338 < 2310 = m5 . Notice that for initial G1 (2) = {1, 5} mod 6 (Table 9.1) the baseprimes 2 and 3 are not used in pair sum residues G1 (2) + G1 (2) = {2, 6, 10}. Considering 2n > 4 (re Goldbach’s conjecture): non-prime 1 is avoided by 6 = 3 + 3 and 8 = 5 + 3, the only 2n requiring summand 3. And 12 = 5 + 7 and 16 = 5 + 11 are the only extension pair sums < 60 requiring summand 5 in G(3) with carry = 0 (Lemma 9.5). Corollary 9.2 For k >3: Each 2n > pk in E(k) is in an extension sum S2c (k − 1) with carrysum 1 < 2c < 2pk having c > 0 pair sums over extensions Ta (k − 1) of G(k − 1), with carries 0 < a < pk .
9.5 Proving GC via GR(k) by Induction on k “Goldbach for residues” (GR Theorem 9.1) resulted from structure analysis of arithmetic mod mk . With E = {2n} and primeset P it seems GR: G1 + G1 = E mod mk , for all k, is weaker than GC: P + P = E, since GR includes composites and holds only for residues. Clearly GC implies GR, since P + P = E for integers implies equivalence for any modulus, while P ⊆ G1 . Approach: GR → GC is equivalent to not (GC) → not (GR). Prove GC for integers by contradiction to GR, extending residue arithmetic mod mk−1 with carry a < pk as in the Euclidean prime sieve (9.4). If GC would fail for some 2n > 2pk then a contradiction to GR mod mk is derived for some k. Theorem 9.2 (Goldbach) Each 2n > 4 is a sum of two odd primes. Proof Use primesieve (9.4) with prime summands pk+1 ≤ p < (pk+1 )2 in units G(k), and apply induction over k. For k = 3 the primes in P (3) = P (3) ∪ {3, 5, 31, 37} are used, with P (3) + P (3) covering all 4 < 2n < 60 (9.5). If k = 4 the theorem holds by inspection for all 2n in interval [22 = 2p5 , 210 = m4 ], hence in each prime pair sum no carry is produced. Each induction step for k > 4 restricts summands to units p ∈ G(k) in half open interval [pk+1 , (pk+1 )2 ). So these units are all prime, denoted by primeset P (k). By Lemma 9.7 no carry is produced in prime pair sums 2n from 2pk+1 to 2(pk+1 )2 . Furthermore, Bertrands Postulate BP implies overlapping intervals for successive k, covering all 2n beyond the induction base. Now assume GC to fail for some 2n in S (k) = P (k) + P (k), hence S0 (k) containing 2n is incomplete (Lemma 9.6), along with all extensions S0 (k) + 2c.mk , yielding incomplete S0 (k + 1). By prime sieve (9.4) with G1 (k + 1) ≡ G1 (k) mod mk based on carry extension, the missing 2n would not be covered by pair sums mod mi>k either. But this contradicts Theorem 9.1, establishing Goldbach’s Conjecture (GC). Regarding the values of prime summands that suffice to cover all even naturals, notice that in Table 9.1 in order to represent 2n ≥ 2pk only primes p ≥ pk are
134
9 Additive Structure of Z(.) mod mk (Squarefree) and Goldbach’s Conjecture
required in most cases. However, exceptions occur if prime gap pk+1 − pk > 2. Then 2n + 2 requires a prime pk−1 or smaller: the larger the gap the smaller pk−i is required. See for instance (Table 9.1): 2n = 2pk + 2 = 16, 28, 40 for pk = 7, 13, 19 respectively, which require pk−1 as Goldbach summand, due to a gap pk+1 − pk = 4 (versus gap 2 in cases pk = 5, 11, 17).
9.6 Conclusions Balanced analysis of multiplication and addition in relation to each other, with finite square-free moduli 2..pk yields a fruitful analysis of prime sums (Goldbach), similar to prime power moduli mod p k for p-th power sums (Fermat [3], Waring [8]). In both approaches the careful extension of residues with a carry is essential for transferring additive structural results from residues to integers. This residue-and-carry method, as used for proving FLT [3] and Goldbach’s Conjecture, is based on the known unique number representation by residue and carry: using the associative (semigroup) properties of the residue closure combined with an induction proof by carry extension. As such it could well serve as a generic method to solve other hard problems in elementary number theory [6]. In fact, the semigroup Zm (.) of multiplication mod m is formed by the endomorphisms of the additive cyclic group Zm (+) generated by 1. So Zm (.) = endo[Zm (+)] where (.) distributes over (+), suggesting a strong link between these two operations, evident from the derived additive fine structure of Zmk for squarefree modulus mk . A two-dimensional table of prime pair sums revealed additive properties of 2n < 2m3 = 60 as induction base, hard to find otherwise. The product mk of the first k primes as modulus restricts all primes between pk and mk to the group G1 of units. The additive structure of Z(.) mod mk was analysed, and extended to positive integers by induction on k, starting with k = 3 (Z30 ). Units group G1 , and the additive properties of the Boolean lattice BL of idempotents of Zmk (.) play an essential role. The lower semilattice of BL is multiplicative, since the meet glb(a, b) of two idempotents is their product. The additive properties of BL were analysed, regarding the join lub(a,b) in the upper semilattice. Although BL is not closed under (+) mod mk , this yields the next main results: Lemma 9.1: Each complementary pair of idempotents in Zmk (.) sums to 1 mod mk . Corollary 9.1: Congruent max cycles 2∗ ∼ = (2 + h)∗ in G2 ∼ = G1 , with h2 ≡ h = mk /2. Lemma 9.2: Each even [odd] idempotent e2 ≡ e has e + 1 in G1 [in G2 ]. Theorem 9.1: Goldbach for Residues (GRk ): Each residue 2n mod mk is a sum of two units. Section 9.3: Euclidean prime sieve: Unit sums G1 (k) + G1 (k) mod mk → prime sums P (k) + P (k). Theorem 9.2: Goldbach Conjecture GC holds by induction of GRk over k, since failing GC for some 2n contradicts GR for some k.
References
135
References 1. T. Apostol: “Introduction to Analytical Number Theory”, Springer, Berlin, 1976 (Theorem 10.4-6) 2. N. Benschop: “The Semigroup of Multiplication mod pk , an Extension of Fermat’s Small Theorem, and Its Additive Structure”, Semigroups and Applications, 7, Prague, July 1996 3. N. Benschop: “Additive Structure of the Group of Units mod p k , with Core and Carry Concepts for Extension to Integers”, Acta Mathematica Univ. Bratislava, 169 (Nov. 2005). http://pc2.iam.fmph.uniba.sk/amuc/_vol74n2.html 4. G. Birkhoff, T. Bartee: “Modern Applied Algebra”, McGraw-Hill, New York, 1970 5. A. Clifford, G. Preston: “The Algebraic Theory of Semigroups”, AMS Surv. #7 I, 130–135 (1961) 6. S. Schwarz: “The Role of Semigroups in the Elementary Theory of Numbers”, Math. Slovaca 31 (4), 369–395 (1981) 7. K. Chandrasekharan: “Introduction to Analytic Number Theory”, Springer, Berlin, 1968 (Chap. 7, Theorem 4) 8. N. Benschop: “Powersums Representing Residues mod pk , from Fermat to Waring”, Comput. Math. Appl. 39 (7–8), 253–261 (2000)
Chapter 10
Powersums x p Represent Residues mod p k , from Fermat to Waring Ring Zk (+, .) mod p k with prime power modulus (odd prime p) is analysed. Its cyclic group Gk of units has order (p − 1)p k−1 , and all p-th power np residues form a subgroup Fk with |Fk | = |Gk |/p. The subgroup of order p − 1, the core Ak of Gk , extends Fermat’s Small Theorem (FST) to mod p k>1 , consisting of p − 1 residues with np ≡ n mod p k . The concept of carry, e.g. n in FST extension np−1 ≡ n p + 1 mod p 2 , is crucial in expanding residue arithmetic to integers, and to allow analysis of divisors of 0 mod p k . For large enough k ≥ Kp (critical precision Kp < p depends on p), all nonzero pairsums of core residues are shown to be distinct, upto commutation. The known FLT case1 is related to this, and the set Fk + Fk mod p k of p-th power pairsums is shown to cover half of Gk . This yields main result: − each residue mod p k is the sum of at most four p-th power residues.
10.1 Introduction The concept of closure corresponds to a mathematical operation composing two objects into an object of the same kind. Structure analysis is facilitated by knowing a minimal set of generators, to find preserved partitions viz. congruences, that allow factoring the closure. For instance a finite state machine decomposition using preserved (state-) partitions, corresponding to congruences of the sequential closure (semigroup) of its state transformations. A minimal set of generators is characterized by anti closure. Then each composition of two generators produces a nongenerator, thus a new element of the closure. These concepts can fruitfully be used for structure analysis of finite residue arithmetic [4, 5]. For instance positive integer p-th powers are closed under multiplication, but no sum a p + bp yields a p-th power for p >2 (Fermat’s Last Theorem, FLT). Apparently p-th powers form an efficient set of additive generators. Waring (1770) drew attention to the now familiar representation problem: the sum of how many p-th powers suffice to cover all positive integers. Lagrange (1772) and Euler showed that four squares suffice [2]. The general problem is as yet unsolved. Our aim is to show that four p-th power residues mod p k (prime p >2, k large enough) suffice to cover all p k residues under addition. As shown in [3, 9] the analysis of residues a p + bp mod p k is useful here, since for modulus p k (k > 2) the p-th power residues coprime to p form a proper multiplicative subgroup Fk ≡ {np } mod p k of the units group Gk (.) mod p k , with |Fk | = |Gk |/p. The value range Fk + Fk mod p k is studied. (c) 2000 Elsevier. With permission taken from [8]. N.F. Benschop, Associative Digital Network Theory, © Springer Science + Business Media B.V. 2009
137
138
10 Powersums
x p Represent Residues mod p k , from Fermat to Waring
Units group Gk , consisting of all residues coprime to p, is in fact known to be cyclic for all k > 0 [1]. There are p k−1 multiples of p mod p k , so its order p k − p k−1 = (p − 1)p k−1 is a product of two coprime factors, hence we have: Gk ≡ Ak × Bk
is a direct product of subgroups,
with |Ak | = p − 1 and |Bk | = p k−1 .
(10.1)
The extension subgroup Bk consists of all p k−1 residues 1 mod p. And in core subgroup Ak , of order |Ak | = p − 1 (all k > 0), for each n holds np ≡ n mod p k , denoted as np ≡ n. Hence core Ak is the extension of Fermat’s Small Theorem (FST) mod p to mod p k for k >1. By a coset argument the nonzero corepairsums in Ak +Ak , for k large enough, are shown to be all distinct in Gk , apart from commutation (Theorem 10.2). This leads to set Fk + Fk of p-th power pairsums covering almost half of Gk , the maximum possible in a commutative closure, and clearly related to Fermat’s Last Theorem (FLT) about the anti-closure of the sum of two p-th powers. Additive analysis of the roots of 0 mod p 2 , as sums of three p-th power residues, via the generative power of divisors of p ± 1 yields our main result: the sum of at most four p-th power residues mod p k covers all residues, a Waring-for-residues result. Finite semigroup- and ring- analysis beyond groups and fields is essential, due the crucial role of divisors of zero.
10.2 Core Increments as Coset Generators The two component groups of Gk ≡ Ak .Bk are residues mod p k of two monomials: the core function Ak (n) = nqk (qk = |Bk | = p k−1 ) and extension function Bk (n) = n|Ak | = np−1 . Core function A(n) has odd degree with a q-fold zero at n=0, and is monotone increasing for all n. Its first difference dk (n) = Ak (n + 1) − Ak (n) of even degree has a global minimum integer value of 1 at n = 0 and n = −1, and symmetry centered at n = −1/2. Thus integer equality dk (m) = dk (n) for m = n holds only if m + n = −1, called 1-complements. Hence the next definition of a critical precision k = Kp for residues with the same symmetric property is relevant for every odd p, not necessarily prime. Core difference dk (n) is 1 mod p, so it is referred to as core increment dk (n). To simplify notation, the precision index k is sometimes omitted, with ≡ denoting equivalence mod p k , especially since core Ak has order p − 1 independent of k. Define critical precision Kp as the smallest k for which the only equivalences among the core-increments dk (n) mod p k are the above described 1-complement symmetry for n mod p, so these increments are all distinct for n = 1..(p − 1)/2. Notice Kp depends on p, for instance Kp =2 for p ≤ 7, K11 = 3, K13 = 2, and the next Kp = 4 for p = 73. Upperbound Kp < p will be derived in the next section, so no ‘Hensel lift’ [6] occurs. Moreover |Fk |/|Ak | = p k−2 , so A2 = F2 = {np } mod p 2 .
10.2 Core Increments as Coset Generators
139 k−1
Lemma 10.1 Integer core function Ak (n) = np and its increment dk (n) = Ak (n + 1) − Ak (n) both have period p for residues mod p k , with: (a) Odd symmetry Ak (m) ≡ −Ak (n) at complements m + n ≡ 0 mod p (b) Even symmetry dk (m) ≡ dk (n) at 1-complements m + n ≡ −1 mod p (c) Set D2 of distinct increments d2 (n) mod p 2 of F2 = A2 yields: for k >1 there are |Fk + Fk \0| = |D2 |.|Fk | = |D2 |.|Gk |/p non-zero p-th power pairsums mod p k . Proof (a) Core function Ak (n) ≡ nqk mod p k (qk = p k−1 , n ≡ / 0, −1 mod p) has p − 1 distinct residues for each k >0, with (nq )p ≡ nq mod p k , and Ak (n) ≡ n mod p due to FST. Apparently, including Ak (0) ≡ 0 yields: Ak (n + p) ≡ Ak (n) mod p k for each k > 1, with period p in n. And Ak (n) of odd degree q = qk has odd symmetry because: Ak (−n) ≡ (−n)q ≡ −nq ≡ −Ak (n) mod p k . (b) Increment dk (n) ≡ Ak (n+1)−Ak (n) mod p k also has period p since: dk (n+ p) ≡ (n + p + 1)qk − (n + p)qk ≡ (n + 1)qk − nqk ≡ dk (n) mod p k . This yields residues 1 mod p in extension group Bk . It is an even degree polynomial, with leading term qk .nqk −1 , and even symmetry: dk (n − 1) = nqk − (n − 1)qk = −(−n)qk + (−n + 1)qk = dk (−n), so dk (m) = dk (n) mod p k for 1complements: m + n = −1 mod p. (c) Let F be Fk (k > 1): the subgroup of p-th power residues mod p k in units group Gk . Then subgroup closure F.F = F implies F + F = F (F + F ) = F (F − F ), since F + F = F − F due to −1 in F for odd prime p > 2. So non-zero pairsum set F + F \0 is the disjoint union of cosets of F in G, as generated by differences F − F . Due to (10.1): Gk = Ak Bk = Fk Bk , where Ak ⊆ Fk , it suffices to consider only differences 1 mod p, hence in extension group B = Bk , that is: in (F − F ) ∩ B. This amounts to |D2 | ≤ h = (p − 1)/2 distinct increments d2 (n), for n = 1 . . . h due to even symmetry (b), and excluding n=0 involving non-core A2 (0)=0. These |D2 | cosets of Fk in Gk yield: |Fk + Fk \0| = |Fk |.|D2 |, where |Fk | = |Gk |/p = (p − 1).p k−2 and |D2 | ≤ (p − 1)/2. For many primes Kp = 2 so |D2 | = (p − 1)/2, and Fermat’s p-th power residue pairsums cover almost half the units group Gk , for any precision k > 1. But even if Kp > 2, with |D2 | < (p − 1)/2, this suffices to express each residue mod p k as the sum of at most four p-th power residues, as shown in the next section. Theorem 10.1 For a, b ∈ core A mod p k (k ≥ Kp ), all nonzero pairsums a + b mod p k are distinct (apart from commutation): |(A + A)\0| = 12 |A|2 = (p − 1)2 /2. Proof Core Ak mod p k (any k > 1), here denoted by A as subgroup of units group G, satisfies A.A ≡ A so the set of all core pairsums can be factored as A + A ≡ A.(A + A). So nonzero pairsums are a (disjoint) union of cosets of A generated by A + A. By G ≡ AB with B = {n ≡ 1 mod p} there are |B| = p k−1 cosets of A in G. Then intersection D ≡ (A + A) ∩ B of all residues 1 mod p in A + A generate |D| distinct cosets of A in G.
140
10 Powersums
x p Represent Residues mod p k , from Fermat to Waring
Due to −1 in core A we have A ≡ −A so that A + A ≡ A − A. View set A as function values A(n) ≡ n|B| mod p k , with A(n) ≡ n mod p (0 < n < p). Then successive core increments d(n) = A(n + 1) − A(n) form precisely intersection D, yielding all residues 1 mod p in A + A ≡ A − A. Distinct residues d(n) generate distinct cosets, so by definition of Kp there are for k ≥ Kp : |D| = (p − 1)/2 cosets of core A generated by d(n) mod p k .
10.3 Core Extensions: Ak to Fk , and Pairsums mod p k Extension group B mod p k , with |B| = p k−1 has only order p e subgroups. So G ≡ AB has k subgroups X (e) containing core A, called core extensions, of order |X (e) | = (p − 1) p e , with core A = X (0) and F = X (k−2) , G = X (k−1) . Now p + 1 generates B ∈ Bk of order p k−1 (Lemma 8.3) hence: p i + 1 of period p k−i (i < k) in G generate the k − 1 subgroups of B
(10.2)
Let Y (e) ⊆ B, of order p e , then all core extensions are cyclic with product structure: X (e) ≡ A.Y (e) in G(.) with coprime |A| and |Y (e) |. Using (10.2) with k − i = e yields: Y (e) ≡ (p k−e + 1)∗ ≡ {m.p k−e + 1} mod p k
(all m).
(10.2 )
As before, using residues mod p k for any k > 1 : D ≡ (A − A) ∩ B contains the set of core increments. Then Theorem 10.1 on core pairsums A + A is generalized as follows (Lemma 10.2a) to the set X + X of core extension pairsums mod p j (j > 1), with F + F (Fermat sums) for j = k − 2. Extend Fermat’s Small Theorem FST: np−1 ≡ 1 mod p to np−1 ≡ n p + 1 mod p 2 , which defines the FST-carry n of n < p. This yields an efficient core i generation method (b) to compute np mod p i+1 , as well as a proof (c) of critical precision upperbound Kp < p. Lemma 10.2 (Odd prime p) For core increments Dk = (Ak − Ak ) ∩ Bk in Gk = Ak Bk mod p k>1 , and let Xk be any core extension Ak ⊆ Xk ⊆ Fk then: (a) Xk + Xk ≡ Xk Dk : core-increments Dk generate the Xk -cosets in Xk + Xk . i−1 (b) [np−1 ]p ≡ n p i + 1 mod p i+1 , where FST-carry n of n is independent of i, i i−1 and np ≡ [n p i + 1]np mod p i+1 . (c) For k = p: |Dp | = (p − 1)/2 mod p p , so critical precision Kp < p. Proof (a) Write X for Xk(e) then, as in Theorem 10.1: X + X = X − X = (X − X)X. For residues mod p k we seek intersection (X − X) ∩ B of all distinct residues 1 mod p in B that generate the cosets of X in X + X mod p k . By (2, 2 ) core extension X = A.Y = A.{mp k−e + 1}. Discard terms divisible by p (not in B) then: (X + X) ∩ B = (A + A) ∩ B = (A − A) ∩ B = D for each core extension. So A + A and X + X have the same coset generators in Gk , namely the core increment set D = Dk ⊂ Bk .
10.3 Core Extensions: Ak to Fk , and Pairsums mod pk
141
(b) Notice successive cores satisfy by definition Ai+1 ≡ Ai mod p i . In other i words, each p-th power step i → i + 1: [np ]p produces one more significant digit (msd) while fixing the i less significant digits (lsd). Now np−1 ≡ n p + 1 mod p 2 has p-th power [np−1 ]p ≡ n p 2 + 1 mod p 3 , implying lemma part (b) by induction i on i in [np−1 ]p . This yields an efficient core generation method. i Denote integer fi (n) = np for n < p then: i
fi (n) ≡ np ≡ (n.np−1 ) p
i−1
≡ fi−1 (n).[n p i + 1] mod p i+1 ,
(10.3)
so: fi (n) ≡ fi−1 (n) mod p i ,
(10.3 )
and next core msd: fi−1 (n) n p i ≡ n n p i ≡ / 0 mod p i+1 . fk (n) ≡ n mod p (FST) for all k ≥ 0, and 0 < n < p → n ≡ / 0 mod p. (c) In (a) take Xk = Fp and notice that Fp + Fp ≡ Fp − Fp mod p p contains h distinct integer increments e1 (n) = (n + 1)p − np < p p
(10.4)
which are 1 mod p p , hence in Bp . They generate h distinct cosets of core Ap in Gp ≡ Ap Bp mod p p , although they are not core Ap increments. Repeated p-th i i i powers np in constant p-digit precision yield increments ei (n) ≡ (n + 1)p − np mod p p , which for i = p − 1 produce the increments of core Ap mod p p . Distinct increments ei (n) ≡ / ei (m) mod p p remain distinct for i → i + 1, shown as follows. For non-symmetric n, m < p let increments ei satisfy: ei (n) ≡ ei (m) mod p j
for some j < p,
(10.5)
and ei (n) ≡ / ei (m) mod p j +1 .
(10.5 )
Then for i → i + 1 the same holds, since ei+1 (x) = [fi (x + 1)]p − [fi (x)]p where x equals n and m respectively. Because in (10.5, 10.5 ) each of the four fi ( ) terms has form bp j + a mod p j +1 where the resp. a < p j yield (10.5), and the resp. msd’s b < p cause inequivalence (10.5 ). Then: fi+1 ( ) ≡ (bp j + a)p ≡ a p−1 bp j +1 + a p mod p j +2 ≡ a p mod p j +1
(10.6)
which depends only on a, and not on msd bp j of fi (). This preserves equivalence (10.5) mod p j for i → i + 1, and similarly inequivalence (10.5 ) mod p j +1 because, depending only on the respective a mod p j , equivalence at i + 1 would contradict (10.5 ) at i. Cases i < j and i ≥ j behave as follows. For i < j the successive differences ei (n) − ei (m) ≡ yi p j ≡ / 0 mod p j +1
(10.6 )
142
10 Powersums
x p Represent Residues mod p k , from Fermat to Waring
vary with i from 1 to j − 1, and by (10.3 ) the core residues fi ( ) mod p i settle for increasing precision i. So initial inequivalences mod p p (10.4), and more specifically mod p j +1 (10.5), are preserved. And for all i ≥ j the differences (10.6 ) are some constant cp j ≡ / 0 mod p j +1 , again by (10.3 ). Hence by induction base (10.4) and steps (10.5), (10.6): core Ap mod p p has h = (p − 1)/2 distinct increments, so critical precision Kp < p. Already by the initial integer increments e1 (n) < p p for natural n < p, Kp is determined as the minimum precision k for which non-symmetric n, m < p, viz. n + m = p − 1, yield e1 (n) ≡ / e1 (m) mod p k . For instance p = 11 has Kp = 3, and there are h = 5 distinct core increments mod p 3 . In base 11 code: d3 (1..9) = {4a1, 711, 871, 661, 061, 661, 871, 711, 4a1}. So core A3 has the maximal five cosets generated by increments d3 (n). Equivalence d2 (4) ≡ d2 (5) ≡ 61 mod p 2 implies 661 and 061 to be in the same F -coset in G3 . In fact 061.601 = 661 (base 11) with 601 in F mod p 3 , as are all p residues of form {mp 2 + 1} ≡ (p 2 + 1)∗ mod p 3 . As example of Lemma 10.2c, with p = 11 and upto 3-digit precision: {np } = {001, 5a2, 103, 274, 325, 886, 937, aa8, 609, 0aa}, core A3 = {001, 4a2, 103, 974, 525, 586, 137, 9a8, 609, aaa} e1 (4) = 325 − 274 = 061 and e1 (5) = 886 − 325 = 561 with FST-carries: 4p−1 = a1, 5p−1 = 71, 6p−1 = 51 so: e2 (4) = 525 − 974 = 661, 2
2
rule(10.3) yields: 5p − 4p = [701]5p − [a01]4p = 661 e2 (5) = 586 − 525 = 061, 2
2
rule(10.3) yields: 6p − 5p = [501]6p − [701]5p = 061 And second difference e2 (5) − e2 (4) = 061 − 661 = 500 equals e1 (5) − e1 (4) = 561 − 061 = 500 by Lemma 10.1c. With |F | = |G|/p and |Dk | equal to (p − 1)/2 for large enough k < p, the nonzero p-th power pairsums cover nearly half of G. It will be shown that four p-th power residues suffice to cover not only G mod p k , but all residues Z mod p k . In this additive analysis we use: Notation: S+t is the set of all sums of t elements in set S, and S + b stands for all sums s + b with s ∈ S. Extension subgroup B is much less effective as additive generator than F . Notice B ≡ {np +1} so that B +B ≡ {mp +2}, and in general B+i ≡ {np +i} in G, denoted by Ni , the subset of G which is i mod p. They are also the (additive-) translations Ni ≡ B − 1 + i (i < p) of B. Then N1 ≡ B, while only N0 ≡ {n.p} is not in G, and Ni + Nj ≡ Ni+j , corresponding to addition mod p.
10.3 Core Extensions: Ak to Fk , and Pairsums mod pk
143
Implied by 0 ∈ A+2 ≡ A + A, coresums A+i in general satisfy the next inclusions: for all i ≥ 1: A+i ⊆ A+(2+i) ,
and F+i ⊆ F+(2+i) .
Notice that N0 mod p k consists of all multiples mp of p, and their base p code ends on ‘0’, so |N0 | = p k−1 . In fact N0 consists of all divisors of 0, the maximal nilpotent subsemigroup of Z(.) mod p k , the semigroup of residue multiplication. For prime p there are just two idempotents in Z(.) mod p k : 1 in G and 0 in N0 , so G and N0 are complementary in Z, denoted N0 ≡ Z\G. For prime p > 2, consider integer p-th power function F (n) = {np }, with Fk k−1 denoting set F (n) mod p k for all n ≡ / 0 mod p, and core function Ak (n) ≡ np , with core A2 ≡ F2 . Multiples mp (m ≡ / 0 mod p) are not p-th power residues (which are 0 mod p 2 ), thus are not in Fk for any k > 1. But they are sums of three p-th power residues: mp ∈ F+3 mod p k for any k > 1, shown next. In fact FST yields F (n) ≡ n mod p for all n, so F (r) + F (s) + F (t) ≡ r + s + t mod p, which for a sum 0 mod p of positive triple r, s, t implies r + s + t = p. Lemma 10.3 For m ≡ / 0 mod p: mp ∈ F+3 mod p k>1 , hence: A multiple mp mod p k>1 outside Fk is the sum of three p-th power residues in Fk . Proof Analysis mod p 2 suffices, because each mp mod p k>1 is reached upon multiplication by Fk , due to (.) distributing over (+). Core Ak has order p − 1 for any k > 0, and F2 ≡ A2 implies powersums F2 + F2 + F2 mod p 2 to be sums of three core residues. Assume A(r) + A(s) + A(t) ≡ mp ≡ / 0 mod p 2 for some positive r, s, t with r + s + t = p. Such mp ∈ / A2 generates all |A2 .mp| = |A2 | = p − 1 residues in N0 \0 mod p 2 . And for each prime p > 2 there are many such coresums mp with m ≡ / 0 mod p, seen as follows. Any positive triple (r, s, t) with r + s + t = p yields by FST coresum A(r) + A(s) + A(t) ≡ r + s + t ≡ p mod p, thus with coresum mp mod p 2 . If m = 0 then this solves FLT case1 for residues mod p 2 , for instance the cubic roots of 1 mod p 2 for each prime p ≡ 1 mod 6. Non-zero m is the dominant case for any prime p > 2. In fact, normation upon division by one of the three core terms in units group G2 yields one unity core term, say A(t) ≡ 1 mod p 2 hence t = 1. Then r + s = p − 1 yields A(r) + A(s) ≡ mp − 1 mod p 2 , where 0 < m < p. There are 1 ≤ |D2 | ≤ (p − 1)/2 distinct cosets of F2 ≡ A2 in G2 , yielding as many distinct core pairsums mp − 1 mod p 2 in set A2 + A2 . For most primes take r = s equal to h = (p − 1)/2 and t = 1, with core residue A(h) ≡ h ≡ −2−1 mod p. Then 2A(h) + 1 ≡ mp ≡ 0 mod p, with summation indices h + h + 1 = p. For instance p=7 has A(3) ≡ 43 mod 72 (base 7), and 2A(3) + 1 = 16 + 1 = 20. If for some prime p we have in this case m ≡ 0 mod p, then 2A(h) ≡ −1 mod p 2 , hence A(h) ≡ hp ≡ h mod p 2 and thus also A(2) ≡ 2p ≡ 2 mod p 2 . In such
144
10 Powersums
x p Represent Residues mod p k , from Fermat to Waring
rare cases (for primes < 109 only p = 1093 and p = 3511) a choice of other triples r + s + t = p exists for which A(r) + A(s) + A(t) ≡ mp ≡ / 0 mod p 2 , as just shown. p 2 p For instance 2 ≡ 2 mod p for p=1093, but 3 = 936p + 3 mod p 2 so that instead of (h, h, 1) one applies (r, s, 1) where r = (p − 1)/3 and s = (p − 1)2/3. And p = 3511 has 3p ≡ 21p + 3 mod p 2 , while 3|p − 1 allows a similar index triple with coresum mp ≡ / 0 mod p 2 . Lemma 10.3 yields the main additive result for residues in ring Z mod p k : Each residue mod p k is the sum of at most four p-th power residues. With subgroup F ≡ {np } of units group G in semigroup Z(.) mod p k , subsemigroup N0 ≡ {mp} of divisors of zero, and extension group B ≡ N1 ≡ N0 +1 in G, follows: Theorem 10.2 For residues mod p k (k ≥ 2, prime p > 2): Z ≡ N0 ∪ G ≡ F+3 ∪ F+4 . Proof By extension Lemma 10.2 analysis mod p 2 suffices. All non-zero multiples of p are N0 \0 ≡ F+3 , while 0 ∈ F+2 since −1 ∈ F . So F+2 ∪ F+3 covers N0 . Adding an extra term F yields F+3 ∪ F+4 ⊇ N0 + F , which also covers AN0 + A ⊇ A(N0 + 1) ≡ AB ≡ G since 1 ∈ A and A ⊆ F , so all of Z ≡ N0 ∪ G is covered. Remarks: • Case p = 3 is easily verified by complete inspection as follows. Analysis mod p 3 is rarely needed: for instance condition 2p ≡ / 2 mod p 2 holds for all primes 9 p < 10 except for the only known two (‘Wieferich’) primes 1093 and 3511. So mod p 2 analysis suffices for p = 3, while F ≡ A mod p 2 . Now F ≡ {−1, 1} ≡ ±1 so that F + F ≡ {0, ±2}. Adding ±1 yields F+3 ≡ ±{1, 3}, and again F+4 ≡ {0, ±2, ±4}, hence F+3 ∪ F+4 does cover all residues mod 32 . Notice F+3 and F+4 are disjoint (an exception) which necessitates mentioning their union in the theorem. It is conjectured that F+3 ⊆ F+4 for p >6, then Z ≡ F+4 for primes p >6. • For p = 5 again use analysis mod p 2 , and test if F (2A(h) + 1) covers all nonzero m.5 mod 52 . Again F ≡ A mod p 2 , implying A(h) ∈ F . Now core A ≡ F ≡ (25 )∗ ≡ {7, −1, −7, 1} ≡ ±{1, 7}, while h ≡ 2 with A(2) ≡ 7, or in base 5 code: A(2) ≡ 12 and 2A(h) + 1 ≡ 30. So F (2A(h) + 1) ≡ ±{01, 12}30 ≡ ±{30, 10} do cover all four nonzero residues 5m mod 52 .
10.4 Conclusions The application of elementary semigroup concepts to structure analysis of residue arithmetic mod p k is very useful, allowing divisors of zero. Fermat’s inequality and Waring’s representation are both about powersums, thus about additive properties of closures in Z(.) mod p k .
References
145
Fermat’s inequality, viewed as anti-closure, reveals np as a powerful set of additive generators of Z(+). Now Z(.) has idempotent 1, generating only itself, while 1 generates all of Z(+) (Peano). Similarly, expanding 1 to subgroup F ≡ {np } of p-th power residues in Z(.) mod p k , of order |F | = |G|/p, yields a most efficient additive generator with: F+3 ∪ F+4 ≡ Z(+) mod p k for any prime p > 2. This is compatible for p = 2 with the known result of each positive integer being the sum of at most four squares. The concept of critical precision (base p) is very useful for linking integer symmetry properties to residue arithmetic mod p k , and especially quadratic analysis (mod p 3 ) for generative purposes such as primitive roots. For binary arithmetic p = 2: p + 1 = 3 is a semi-primitive root of 1 mod 2k for k ≥ 3, with a useful engineering result as described in Chap. 11, using 2 and 3 as dual base for logarithms in order to simplify multiplier hardware [7].
References 1. T. Apostol: “Introduction to Analytical Number Theory”, Springer, Berlin, 1976 (Theorem 10.4-6) 2. E.T. Bell: “The Development of Mathematics”, McGraw-Hill, New York, 1945 (pp. 304–306). 3. N.F. Benschop: “The Semigroup of Multiplication mod pk , an Extension of Fermat’s Small Theorem, and Its Additive Structure”, Semigroups and Applications, Prague, 1996 4. A. Clifford, G. Preston: “The Algebraic Theory of Semigroups”, AMS Surv. #7 1, 130–135 (1961) 5. S. Schwarz: “The Role of Semigroups in the Elementary Theory of Numbers”, Math. Slovaca 31 (4), 369–395 (1981) 6. G. Hardy, E. Wright: “An Introduction to the Theory of Numbers”, Oxford University Press, Oxford, 1979 (Chap. 8.3, Theorem 123) 7. N. Benschop: Patent US-5923888 (13 July 1999) Logarithmic Multiplier over Dual Bases 2 and 3 8. N. Benschop: “Powersums Representing Residues mod pk , from Fermat to Waring”, Comput. Math. Appl. 39 (7–8), 253–261 (1999) 9. N. Benschop: “Additive Structure of the Group of Units mod pk , with Core and Carry Concepts for Extension to Integers”, Acta Mathematica Univ. Bratislava (Nov. 2005, p. 169). http://pc2.iam.fmph.uniba.sk/amuc/_vol74n2.html
Chapter 11
Log-Arithmetic, with Single and Dual Base The group of units mod p k (prime p > 2) is known to be cyclic for k ≥ 1, corresponding for k = 1 to Fermat’s Small Theorem: np−1 ≡ 1 mod p (n coprime to p). If p = 2 and k > 2 the 2k−1 units (odd residues) require two generators, such as 3 and −1 mod 2k , since 3 is semi-primitive root of 1 mod 2k . So each residue n ≡ ±3i 2j mod 2k with unique non-negative i < 2k−2 , j ≤ k. For engineering purposes this yields efficient log-arithmetic with dual base 2 and 3.
11.1 Log-Arithmetic with Dual Base 2 and 3 Summary: The group of units mod p k (prime p > 2) is known to be cyclic for k ≥ 1, corresponding for k = 1 to Fermat’s Small Theorem: np−1 ≡ 1 mod p (n coprime to p). If p = 2 and k > 2 the 2k−1 units (odd residues) require two generators, such as 3 and −1 mod 2k , since 3 is semi-primitive root of 1 mod 2k . So each residue n ≡ ±3i 2j mod 2k with unique non-negative i < 2k−2 , j ≤ k. For engineering purposes this yields efficient log-arithmetic with dual base 2 and 3. Introduction: Parallel array multipliers [23] are much too powerful for their purpose, seen as follows. Without loss of generality consider a square array. The known parallel n × n bit array multipliers all have a structure containing two main parts: 1. An input part with a 2-dimensional array of n(horiz) + n(vert) bitlines, for the two n-bit input operands x and y, with an AND-gate at each of the n2 bitline crossings (neglecting two’s complement code details for positive and negative numbers). 2. A processing part, which accumulates this pattern of n2 bits to the required 2nbit result, using an array of some n2 Full-Adders (FA). Various types of Adder-array exist, like a normal array of n rows of n FA’s each (for a compact layout and small silicon area), or the known ‘Wallace tree’ [23, p. 167] (with an irregular and larger layout but less delay), or anything between these extremes, trading-off total delay and silicon area. The inefficiency of the usual adder array hardware is easily seen as follows. The adder array can add any n×n bit pattern of n2 bits (there are 2n.n patterns), while for multiplication of two n-bit operands only 22n of these are ever input and processed (each n-bit row or column is either all 0’s or a copy of one operand). So the hardware is used for processing only a very small fraction 2n+n /2n.n of all possible input patterns it could process. Clearly, the hardware is much too powerfull for its purpose, and is used very inefficiently. Some recoding schemes have been applied in the past to improve the efficiency of multipliers. For instance in the known Booth multiplier [23, p. 198] each successive bit-pair of one input operand has value range {0, 1, 2, 3}, where 3 is recoded as 4 − 1. The N.F. Benschop, Associative Digital Network Theory, © Springer Science + Business Media B.V. 2009
147
148
11 Log-Arithmetic, with Single and Dual Base
−1 causes a subtraction of the other operand, while ‘4’, as positive carry into the next bit-pair position, implies an addition there. The result is an effective reduction of the logic depth in the add/subtract array, and a corresponding speed-up, at the cost of a more complex recoding of one operand, and extra subtract hardware. A similar recoding scheme, but now for both operands, and based on a deeper algebraic property of the powers of 3 in the semigroup of binary multiplication Z(.) mod 2k , is proposed next.
11.1.1 Proposed New Binary Number Code A better structure might be found by using the algebraic properties of the closed system (semigroup) of binary multiplication mod 2k : associative a(bc) = (ab)c, commutative ab = ba, and the iterative sub-structures or iteration class a ∗ = {a i } of all powers of any number a. Especially a = 3, which generates the maximum possible iteration class of order 2k−2 , shown next. Using this 3∗ property makes multipliers much more efficient [22]. For k ≥ 3 bits the powers of 3 generate half of the odd residues. In other words, in binary coded residues: 3 is a semi-primitive root of unity. A new binary number code based on this property simplifies binary multiplication, and in fact translates it to addition, using base 3 logarithm for odd residues. First consider residues mod p k for prime p > 2, and then take p = 2 as special case. Write Cn or C[n] for a cyclic group of order n. Lemma 11.1 For prime p > 2, the cyclic subgroup B = (p + 1)∗ mod p k has order p k−1 . Proof The group of units G of all n with ni ≡ 1 mod p k for some i > 0 (excluding the p k−1 multiples of p), is known to be cyclic. Its order p k − p k−1 = (p − 1)p k−1 has two relative prime factors, so G ≡ A × B is a direct product of two cycles of order p − 1 and p k−1 respectively. Here B ≡ (p + 1)∗ since (p + 1)p ≡ p 2 +1 m mod p 3 , and by induction (p + 1)p ≡ p m+1 + 1 mod p m+2 . The period of p + 1 [the smallest x with (p + 1)x ≡ 1 mod p k ] implies m + 1 = k, so m = k − 1 with period p k−1 . No smaller x yields 1 mod p k since |B| has only divisors p s . Binary arithmetic: (binary 3∗ property) For p = 2 we have p + 1 = 3, and it is readily verified that 3 does not generate −1 mod 2k if k ≥ 3, since (2 + 1)2 > 23 (in binary code 32 = 1001), while (p + 1)2 = p 2 + 2p + 1 < p 3 for all p > 2. The carry in binary code is the cause of this phenomenon. In fact units group B ≡ C2 C[2k−2 ] is not cyclic, with C2 ≡ {−1, 1}. Then |3∗ | = 2k−2 , with 3 generating half of the odd residues mod 2k ; the other half are their complements. So each residue n ≡ ±3i .2j mod 2k , with i < 2k−2 and j < k (n ≡ 0 iff j = k).
11.1 Log-Arithmetic with Dual Base 2 and 3
149
11.1.2 Example For instance mod 32 (k = 5) the cycle 3∗ ≡ {3, 9, −5, −15, −13, −7, 11, 1} has period 2k−2 = 8, while the remaining 8 odd residues are their complements, with a two-component decomposition G ≡ C2 C8 ≡ {−1, 1} × 3∗ for all 16 odd residues, which allows component-wise multiplication. The 5-bit binary codes of 3i are m shown in the next table, as well as for p > 2 the lower significant digits of (p + 1)p in p-ary code. The logic structure of the few least significant bits of 3i is rather simple, as boolean functions of the k − 2 bits of exponent i, but the functions for higher order bits quickly increase in complexity due to propagated carries.
11.1.3 Application to Multipliers Apparently each residue n ≡ ±3i .2j mod 2k (k > 2) for a unique pair (i, j ) of exponents, with 0 ≤ i < 2k−2 and 0 ≤ j < k, with n = 0 iff j = k. This 2.3-star number code reduces multiplication to addition of exponent-pairs, because: (3i 2j ).(3r 2s ) ≡ 3i+r 2j +s , and the 1-bit signs add (mod 2). The multiplier structure is summarized in Table 11.1 and Fig. 11.1: the product sign is the XOR or the operand signs, the exponents of 3 add mod 2k−2 , those of 2 add with saturation at k. The input precision k must be taken equal to the desired output precision. For instance, for an 8 × 8 bit multiplier with 16-bit output, odd input operands are encoded as index i in 3i mod 216 . Addition is difficult in this code, so application is suggested for environments restricted to multiplication mod 2k . For general application, further research is required to find the additive structure of the units group mod p k , especially for p = 2.
m
Table 11.1 Powers 3i (mod 25 ), and (p + 1)p in p-ary code i (bin) 3^i (dec) | p>2 (p+1)^i i 1. 00011 3 |-------------+---2. 01001 9 | 11 1 3. 11011 27 = -5 | ..101 p 4. 10001 17 = -15 | ....1001 p^2 5. 10011 19 = -13 |.....10001 p^3 6. 11001 25 = -7 |....100001 p^4 7. 01011 11 8. 00001 1 Note: 3^even == 1 (mod 8), 3^odd == 3 (mod 8) | | --> two bits fixed: 0.2^2, 1.2^0 so |3^*| = 2^k /4
150
11 Log-Arithmetic, with Single and Dual Base
Operands Product p= where: | | |
a = sign(a) 3^i.2^j b = sign(b) 3^r.2^s a.b = sign(p) 3^t.2^u sign(p)= XOR[sign(a),sign(b)] t= i+r mod 2^k-2 u= j+s < k (saturate at k: ’overflow’)
Fig. 11.1 Multiplier structure
Fig. 11.2 Example multiplier mod 32 = 25 , with code ±3t .2u (t < 23 , u ≤ 5)
11.1.4 Signed Magnitude Binary Code over Bases 2 and 3 The proposed new number code is a signed magnitude code, well suited for multiplication, and it uses two bases: 2 and 3. As shown (Fig. 11.1), each k-digit binary coded residue n (mod 2k ) is the unique product of a power 2j with j ≤ k (even part of n) and an odd residue (odd part of n), which is a signed power ±3i (mod 2k ) with i < 2k−2 . Exponent pair (i, j ) and sign s uniquely encode each nonzero residue from −(2k − 1) to 2k − 1, while the zero residue 0 requires j = k, represented by an extra zero-bit z. To represent all 2k k-bit binary numbers n (integers), a 4-component code n = [z, s, t, u] is proposed, with the next interpretation: z: one zero bit, with z = 0 if n = 0 and z = 1 if n = 0. s: one sign bit, with s = 0 if n > 0 and s = 1 if n < 0. t: k − 2 bits for the exponent t of odd part 3t . u: k bits for the exponent u of even part 2u . And optionally an overflow bit: v = 1 whenever ua + ub requires > k bits. The product code of two coded numbers a = [za , sa , ta , ua ] and b = [zb , sb , tb , ub ] follows by adding in binary code, by known means, the odd and even code parts t and u respectively, and adding the signs sa + sb mod 2 (XOR), while multiplying the two zero bits za .zb (AND). Overflow bit v = 1 if the even part overflows. For instance Fig. 11.2 employs ‘ripple-carry’ binary addition hardware, with a full-adder cell FA per bit position. Here t, ta , tb , u, ua , ub each consist of 3 bits (of weights 20 , 21 , 22 ), and the optional overflow bit v depending on u.
11.1 Log-Arithmetic with Dual Base 2 and 3
151
11.1.5 Addition in Log Code: ‘Odd’ Arithmetic (Base 2 and 3)
Although multiplication and division in log code are simplified to addition and subtraction (of base exponents), the add and subtract operations are much more complex than in normal binary code. The essence of addition is finding the code for the successor, using the identity: a + b = (a/b + 1)b.
(11.1)
Quotient q = a/b is obtained in log code by a simple operation (subtraction of exponents), but the code of successor q + 1 is more difficult to obtain. As shown in the next section on single base 2 log-arithmetic, addition in log-code requires a lookup table storing a sampled log curve, and interpolation in order to reduce the memory needed for the desired arithmetic precision (number of operand bits). Such memory increases exponentially with precision. A similar approach is applied for addition in dual base (2 and 3) log code, using a partial linear relation between a residue mod 2k and its log code. Consider odd x ≡ 3n mod 2k , with non-neg. code log3 (x) = n < 2k−2 , and its odd successor x + 2 ≡ 3s with log code s. For even precision k = 2h the following linear extension yields for odd x: (2h + 1)i ≡ i2h + 1 mod 2k −→ x + i2h ≡ x(1 + 2h )i/x ,
hence:
log(x + i2h ) = log(x) + i[log(1 + 2h )/x] = log(x) + id(x).
(11.2)
This allows to compute all log3 (odd) with a moderate amount of memory. Store the √ first 2h−1 = |3∗ | log codes of properly signed odd residues x = 2j + 1 (negative if 5 or 7 mod 8), and compute the remaining logs by (11.2) as shown mod 28 in the next table, with |3∗ | = 64 and log3 (2h + 1) ≡ log3 (17) ≡ 52 ≡ −12 mod 64. Left table (a) lists row wise 3n mod 28 for n = 1 . . . 64, and the right table has in place [i, j ] the log3 code of odd residue 16i + 2j + 1 mod 28 , times −1 if not in 3∗ (viz. 5 and 7 mod 8, at underlined positions). For instance at [i, j ] = [1, 7] entry 24 (mod 64) = log3 (−[16.1 + 2.7 + 1]) = log3 (−31) corresponds to 324 ≡ −31 mod 256 in table (a) at place 24 = (row 2, col 8). Thus some simple computation can replace the (large) log-tables. For additive arithmetic the converse or anti-log of relation (11.2) would allow an efficient translation back and forth between normal binary code and log3 code. The d(j ) increments ±{4, 12, 20, 28} correspond to four column pairs of linear increasing log codes that are {1, 0, 2, 3} mod 4 respectively, useful for establishing the anti-log function: logcode(odd) → bincode(odd).
152
11 Log-Arithmetic, with Single and Dual Base
3^n mod 256 (k=8), h= k/2 =4.
Log_3(+/-[16i+2j+1]) [1]------>[j]------>[8] 3 9 27 81 -13 -39-117 -95 [0] 1 11 46 2 39 5 12 52 ~~~~~ ~~~~~ -29 -87 -5 -15 -45 121 107 65 [1] 61 47 26 22 3 9 24 40 | ~~~~~ ~~~== -61 73 -37-111 -77 25 75 -31 | 57 19 6 42 31 13 36 28 | ~~~~~ ~~~~~ -93 -23 -69 49-109 -71 43-127 | 53 55 50 62 59 17 48 16 | ~~~~~ ~~~~~ -125-119-101-47 115 89 11 33 | 49 27 30 18 23 21 60 4 [i] ~~~~~ ~~~~~ 99 41 123 113 83 -7 -21 -63 | 45 63 10 38 51 25 8 56 | ~~~~~ ~~~~~ 67 -55 91 >17< 51-103 -53 97 | 41 35 54 58 15 29 20 44 v ~~~~~ ~~~~~ 35 105 59 -79 19 57 -85 1 [7] 37 7 34 14 43 33 32 32 ~~~~~ ~~~~~ (a) | d[j]= -4 -20 +28 +12 | | -28 +20 +4 -12 | / Linear relation between rows: [i,j] = [0,j] + i.d[j] mod 64
A similar structure holds for other even precisions 2h. At the cost of losing one (least significant) bit of precision, only odd residues mod 22h can be used for log-arithmetic. The sum of two odds is even, readily rounded off in the normal binary code domain to one of its odd neighbors, with corresponding log3 code given by (11.2), yielding dual base (2, 3) odd arithmetic. Relation (11.2) between the two domains, for additive purposes, is essentially multiplicative (of half precision h = k/2). So for the combination of additive and multiplicative operations there seems to be no gain in efficiency of log3 code over the normal binary code, considering also the extra memory of 2h words for the logcodes log3 (2j + 1) and increments d(j ). However, in the log domain not only multiplication but also division and taking the square root are trivial operations, which does yield advantages in complicated adaptive DSP algorithms dominated by signal scaling and root-mean-square functions, as also evident in the next section. The basic US-patent involved is Ref. [22].
11.2 European Logarithmic Microprocessor ELM 1 Summary: Under European ESPRIT research project HSLA2 (High Speed LogArithmetic) [13] a 32 bit VLSI microprocessor based on the binary logarithmic 1 (c)
IEEE Tr. Computers, with permission taken from [21].
2 With:
J.N. Coleman, C.I. Softley (Univ.Newcastle/ECE), J. Kadlec, R. Matousek (UTIA Prague).
11.2 European Logarithmic Microprocessor ELM
153
number system (LNS) was developed [21]. Following a phase-1 ESPRIT feasibility study lead by J.N. Coleman, it was designed at Philips Research Labs (Eindhoven, NL) by Chris Softley and produced at Philips Semiconductors (Nijmegen NL, in 0.18 μm CMOS, 13 mm2 , 150 mW at 150 MHz).3 Applications [18] and a printed circuit board were developed at U-Newcastle, UC-Dublin and UTIA-Prague. The latter produced an FPGA version [20], synthesized from the same VHDL source as the chip—among others for verification purposes, resulting in first-time-right silicon of the VLSI device at Philips. A real number is represented as a fixed-point logarithm, so multiplication and division are translated to add/subtract operations proceeding in minimal time (single clock cycle) with no rounding error. LNS offers an overall advantage over floatingpoint if its more complicated addition and subtraction are qua speed and accuracy comparable to floating-point (FLP) arithmetic. They require interpolation of the nonlinear logarithmic function, which until now was not feasible for 32-bit precision, being too slow and/or too inaccurate due to excessive memory requirements. A procedure is presented for fast and accurate additions and subtractions, so these operations are competitive with their floating-point equivalents. Some realistic application studies [19] show that the average performance of LNS indeed exceeds FLP in terms of both speed and accuracy, especially adaptive filters where rootmean-square (rms) calculations dominate. This architecture has single clock-cycle multiply/divide/sqrt operations, 3-cycle addition and 3- or 4-cycle subtraction.
11.2.1 Introduction: Log-Arithmetic with Single Base 2 Algorithmic complexity is now exploding in almost all areas of advanced computation and a great many applications are becoming bounded by the limits currently imposed by floating-point execution. Examples include real-time applications such as the large class of RLS-based algorithms and subspace methods which will be required in broadcasting and cellular telephony, Kalman filtering and Riccati-like equations used in advanced real-time control, and graphics systems. Ways are urgently sought to bypass this limitation by improving the speed at which the basic arithmetic operations can be performed and, in early 1999, a European ESPRIT project was launched with this objective. The project partners designed and produced (2002) a microprocessor in which real numbers and their associated arithmetic are implemented in a logarithmic number system (LNS) which competes favorably with existing FLP units, both qua performance and qua dissipation. An LNS number x is represented as the fixed-point value i = log2 |x|, with a special code for x = 0, and an additional bit for the sign of x. Let i = log2 |x| and j = log2 |y|, and without loss of generality assume i ≥ j . Then LNS arithmetic involves the next basic computations: log2 (x + y) = i + log2 (1 + 2j −i ), 3 Layout
foto and specs at http://zs.utia.cas.cz/projects/hsla/elm.pdf.
(11.3)
154
11 Log-Arithmetic, with Single and Dual Base
log2 (x − y) = i + log2 (1 − 2j −i ),
(11.4)
log2 (x × y) = i + j, log2 (x/y) = i − j, √ log2 ( x) = i/2. By suitable choice of position for the binary point, this LNS can have a range and precision comparable to an FLP system of equal wordlength. The dominant advantage of LNS is that multiplication and division are performed much faster than in FLP, as they require only one fixed-point addition or subtraction, while the square root is a mere left shift. These operations are also more accurate, returning an exact result where FLP has potentially a half-bit rounding error. If LNS addition and subtraction are performed with speed and accuracy at least equivalent to FLP, then the performance of LNS would significantly exceed that of FLP. These operations require the evaluation of a nonlinear function F = log2 (1 ± 2j −i ) as illustrated in Fig. 11.3. For practical purposes, this function can only be stored in a lookup table. And for standard 32-bit precision it is not possible to store the entire range of values, so an interpolation must be performed. The function is irrational and hence subject to a half-bit rounding error, the interpolation procedure tends to introduce extra errors, making the entire process too time consuming and requiring too much memory. Designs for LNS addition operations have therefore thus far been slower or less accurate than FLP, or restricted to only short wordlengths. No designs to date appear to offer both the speed and accuracy of FLP, with practical table sizes at 32-bit precision. An efficient design of a 32-bit microprocessor is presented, solving these problems. Section 11.2.6 describes an original algorithm for addition and subtraction, with equivalent accuracy to FLP, yet with a feasible amount of memory by analysing and exploiting the structure of errors. It is shown in Sect. 11.2.9 that a VLSI implementation of these algorithms will have speed comparable to a 32-bit FLP unit.
Fig. 11.3 LNS add and subtract functions
11.2 European Logarithmic Microprocessor ELM
155
Hence the LNS device, with its fast multiplication and division operations, considerably gains in performance over a 32-bit FLP unit. Section 11.2.4 gives the results of some systematic simulations to compare the accuracy of the two systems, and some large-scale case studies follow in Sect. 11.2.5.
11.2.2 Log-Arithmetic Algorithms, an Overview The use of 16-bit LNS arithmetic was originally proposed as an alternative to 16bit fixed-point by Kingsbury and Rayner in 1971 [1]. Simulated LNS arithmetic demonstrated that the greater dynamic range of this system yielded a very significant improvement in the response of a digital filter. Attention turned some years later to the better roundoff error characteristics of LNS when compared to FLP, and clear improvements in noise-to-signal ratio were demonstrated in a filter [2] and FFT [3]. Implementation work began with a 1975 paper which suggested a 12-bit device [4], while a 1988 proposal extended this to 20 bits [5]. Both designs were direct implementations of (11.3) and (11.4), with a lookup table covering all possible values (omitting those which quantize to zero) of F (r = j − i). Clearly, table sizes increase exponentially with the wordlength, which limits the practical utility of this approach to about 20 bits. A 1991 design [6] extended the wordlength to 28 bits by implementing the lookup table for values of r only at intervals of , where r = −n − δ. Intervening values were obtained by interpolation using a Taylor series expansion This design used only the first-order term, requiring the additional storage of a table of derivatives D(r) and introducing a multiplication into the critical speed path. The scheme also exposed a further problem intrinsic to LNS arithmetic: the difficulty of interpolating F (r) for subtractions in the region −1 < r < 0, where F (r), D(r), D (r) → −∞ (see Fig. 11.3). To maintain accuracy despite a rapidly changing derivative one must, for r → 0, implement a large number of successively smaller intervals. Such large memory, with its irregular organization, is cumbersome to design and complicates the VLSI floorplanning. Although the accuracy achieved by [6] was not reported, it would have been limited by the rounding error in the function, plus any additional error introduced by interpolation. A separate proposal [7] involved the use of a higher-order polynomial interpolator, with a novel scheme for interleaving the stored values so as to reduce the overall memory requirement. A design for a 32-bit unit with a 287 kbit lookup table was presented, and its addition accuracy shown by simulation to be within FLP limits. A variant had a smaller table with larger errors. The critical speed path included a ROM, two multipliers, three barrel shifters, and five carry-propagate adders/subtractors. The lower accuracy variant [8] was fabricated, with a latency of 158 ns in add and subtract operations, and 13 ns for multiply and divide. Some novel arithmetic transforms possibly simplifying the addition and subtraction algebra are given in [9]. This work also includes a review of recent practical
156
11 Log-Arithmetic, with Single and Dual Base
applications of LNS arithmetic, in the USA and Japan. Areas cited include image processing and Digital Signal Processing (DSP) applications, graphics, and aircraft controls. Fujitsu use the technique in their microprocessors, while [10] discusses denormal LNS representation. The present aim is to develop a 32-bit adder/subtractor with speed and accuracy comparable to that of an FLP system. The starting point was a first-order Taylor series approximation, with a critical delay path containing a ROM, a multiplier, and two carry propagate adders. This is at the limit of what can be implemented without exceeding the delay of an FLP addition. This induced two problems. Firstly, as referred to above, the difficulty of interpolating the subtraction function in the region −1 < r < 0. The algorithm [11] transforms such a subtraction into one for which r < −1, with an extra time delay of only one ROM stage, a carry-propagate adder, and a carry-save stage. Secondly, at 32-bits precision a first order Taylor interpolation yields far too high an error to meet the desired accuracy without recourse to a very large lookup table. An alternative technique for function evaluation without interpolation uses bipartite tables [12]. With this method, a table access with n address bits is replaced by two simultaneous accesses, each with approximately (2/3)n address bits. However, the required n = 28 bits would still imply an unacceptably large table size. The new algorithm addresses the interpolation and memory size problem [13]. Using a crude first-order approximation, the error is evaluated and immediately added to the result, with a delay of only one extra carry save stage. Moreover, the addition and subtraction curves are quite similar. Much of the error correction circuitry is shared by both operations, yielding a substantial decrease in size, as shown later. The ELM device described here implements 32-bit arithmetic. However, a major trend in the industry is the use of application specific IC (ASIC) designs with custom data paths, often with many arithmetic processors of reduced precision, say 20 bits LNS units, which is sufficient for such important applications as digital audio and video. For such ‘embedded’ purposes the ALU will be made available in a range of precisions (‘soft-core’). As illustration a 20-bit scheme with its simulation data is presented, having a speed and accuracy competitive with state of the art FLP units.
11.2.3 Data Format, Range and Precision The single precision IEEE standard represents FLP with a sign, 8-bit biased exponent, and 23-bit mantissa. The latter has an implied binary point immediately to its left and a hidden ‘1’ to the left of the point. Extreme exponent values (0 and 255) are used for special cases, so this format holds signed values in the range 1.0 × 2−126 to 1.111 . . . × 2127 , approximately 1.2E–38 to 3.4E+38. With one sign bit ‘S’ the 32-bit FLP format is: [S, 8 bit Exponent, 23 bit Mantissa]
11.2 European Logarithmic Microprocessor ELM
157
In the equivalent LNS representation used here throughout, the integer and fraction parts form a coherent two’s complement fixed-point value in range −128 to about +128. The real numbers represented are signed and in range 2−128 to 2+128 , that is 2.9E–39 to 3.4E+38. One special value is used to represent the real number zero, so the 32-bit LNS format is: [S, 8 bit Integer, 23 bit Fraction] The 20-bit LNS format has also 8 bit integers, but only 11 fraction bits: [S, 8 bit Integer, 11 bit Fraction], comparable to 16-bit FLP as used on commercial DSP devices [14].
11.2.4 Measurement of Accuracy Let number A˜ have an FLP nearest approximation A = 2C × F , with exponent C and mantissa F . Hence the error equals e = A˜ − A. Throughout the range of f -bit mantissae the errors are taken relative to least significant bit LSB of weight 2−f , which varies with exponent C of A: emax rel = max(A˜ − A)/(2C × 2−f ),
and likewise emin rel , |e|max rel .
Although erel is widely used in the literature, it is of limited mathematical value because the errors are expressed only in terms of the order-of-magnitude of the exact value, determined by C, which varies at relatively large intervals throughout the range of A. For mathematical purposes, it is more useful to relate the error to the exact value itself. A result may still be expressed in terms of 2−f since the normalization for varying C is effectively done already. It may be verified that this procedure yields results similar to, although slightly lower than erel . emax rel arith = max[(A˜ − A)/A]/2−f and similarly emin rel arith , |e|max rel arith . Average values are then: eav rel arith =
n [(A˜ i − Ai )/Ai ]/(2−f × n),
similarly |e|av rel arith .
i=1
In the equivalent LNS (with also f -bit fraction) it may be assumed that both logarithms forming the inputs to an operation are exact. Each result I˜ returned by the implementation is an approximation to the corresponding exact logarithm I , hence with error elog = I˜ − I , and emax rel log = max(I˜ − I )/2−f . Similarly emin rel log ,
|e|max rel log ,
eav rel log ,
|e|av rel log .
Since the user is not concerned with the logarithm per se, but rather with the value that it represents, it is also possible to quote this error as to allow direct comparison
158
11 Log-Arithmetic, with Single and Dual Base
with the error returned by FLP. The expression is: ˜
max(I −I ) emax − 1]/2−f . rel = [2
Notice this is equivalent to emax rel arith . The corresponding terms |e|min rel arith ,
emax rel arith ,
|e|av rel arith
and
eav rel arith
are similarly equivalent. So direct comparison can be made between the two number systems by exponentiating an LNS result to its FLP representation. For f = 23, comparing FLP with LNS add/subtract yield respectively: emax rel = 0.5,
emax rel log = 0.5,
emin rel = −0.5,
|e|av rel log = 0.25,
emax rel arith ≈ 0.5,
emax rel arith = 0.3464,
emin rel arith ≈ −0.5,
emin rel arith = −0.3464,
eav rel arith = 0,
eav rel arith = 0,
|e|av rel arith = 0.1733,
|e|av rel arith = 0.1733.
In LNS multiply/divide are error-free, so all values are 0, while for add/subtract the next well known theorem holds (stated without proof): Theorem 11.1 If add/subtract operations (11.3) and (11.4) yield errors within a given emax rel log over all negative values of j for i = 0, then they yield the same emax rel log over all values of j and for all i. An implementation is thus fully verified if it is verified over this subset.
11.2.5 Conventional LNS Addition and Subtraction To minimize storage of function F (r) in Fig. 11.3 the value of is progressively increased as the function becomes more linear with decreasing r. An intermediate value of r in the n-th interval is then correctly expressed as: r = −δ
for n = 0, and r =
n−1 (−n ) − δ
for n > 0.
0
In a typical system, the range of r is partitioned at each power of 2, and F (r) is implemented with a small table of equal size in each segment, so is doubled at each next power of 2. To simplify notation, this variation of is denoted as r = −n−δ. However, in the programmed simulations the correct treatment of is maintained, so that results can be regarded to represent a practical implementation.
11.2 European Logarithmic Microprocessor ELM
159
Fig. 11.4 LNS implementation—error correction components in dotted lines
Together with each value of F (r) is stored its derivative D(r). For an intermediate value of r the function is then obtained by interpolation: F (−n − δ) ≈ F (−n) − δD(−n). A conventional implementation is shown outside the dotted lines in Fig. 11.4. Following the initial subtraction to obtain r, the latter is partitioned, effectively dividing by . The high-order bits represent n for accessing the F and D tables, while the low-order bits represent δ. Then F (−n) is added to product δ(−n) to obtain an approximation to F (r), which is added to i to yield the result. The interpolation error is shown in the inset of Fig. 11.3: (n, δ) = F (−n) − δD(−n) − F (−n − δ). For each n an increase with δ occurs, to a maximum of: E(n) ≈ F (−n) − D(−n) − F (−n − ). An example of the errors arising during additions using this interpolation method is shown in the upper curve of Fig. 11.5. These simulations were based on a
160
11 Log-Arithmetic, with Single and Dual Base
Fig. 11.5 Error in 40-b add operations
40-bit LNS, with 8-bit integer part and 32-bit fraction. The nonzero range of r was partitioned as described into seven segments with subranges [0, −1] [−1, −2] [−2, −4] . . . [−32, −64] where each segment is divided into a fixed number of intervals. Additions were simulated for all values of j for i = 0 and the results are compared with accurate values obtained from 80-bit FLP arithmetic as reference. The graph in Fig. 11.5 shows the maximum value of ||, anywhere in the range of r, in terms of the LSB, thus |e|max rel log . By Theorem 11.1 these results are applicable to all combinations of operands. The simulation was repeated, varying the number of intervals in each segment from 128 to 4,096. For 128-interval segments, equals 225 LSB (225 /232 = 2−7 ) within the first segment at the RHS of F (r) and it doubles at each power of 2. As the number of intervals per segment is doubled, is halved. When the number of intervals per segment doubles, the max. error divides by 4.
11.2.6 New Error Correction Algorithm A means to correct the error is presented. It is based on the observation that for a given δ the ratio P (n, δ) = (n, δ)/E(n) is roughly constant for all n. Now store in a table P the error at successive points throughout , expressed as a proportion of the maximum error E in that interval. Together with F and its derivative D, also store for each interval its maximum error E. Then for any (n, δ) the error is approximately (n, δ) = E(n)P (c, δ) for some constant c. This error estimate is added to the result of the interpolation, thus correcting the error.
11.2 European Logarithmic Microprocessor ELM
161
Fig. 11.6 Error components α and vs. n, δ
This scheme has the major practical advantage that the lookups of E(n) and P (c, δ) can be performed at the same time as those of F (n) and D(n). So their product can be evaluated in parallel to the multiplication in the interpolation. A carrysave addition stage for the final interpolation addition allows to include error estimate with minimal extra delay of a few gates. The extra hardware is shown within the dotted lines in Fig. 11.4. The error elog in the final corrected result is: elog = E(n)P (c, δ) − (n, δ) = E(n)P (c, δ) − E(n)P (n, δ) (c,δ) written as: elog = α(n, δ)(n, δ) where α(n, δ) = PP (n,δ) − 1. The factor α(n, δ) of the final elog represents the approximation P (c, δ) taken for P (n, δ). In a practical implementation, the bounds of αδ include another source of error to be described in the next paragraph, which can best be determined and verified numerically. First the behavior of α and will be illustrated by an example. Figure 11.6 shows plots of their maximum magnitudes in individual intervals of n = 1, as function of n. Plots are given for two values of δ with small offset γ = 29 LSB from each extreme of , so δ = γ and δ = − γ . The value of was increased at successive powers of 2 throughout range r (resulting in discontinuities) with 512-word tables in each segment. The remaining small discontinuities appear because, although the terms are fairly evenly distributed about zero, the maximum magnitude is plotted. With respect to both controlling variables n and δ the two sources of error α and are anti-correlated. Hence elog = α is relatively small throughout. A more substantial source of error is the fact that, for practical values of , it is not feasible to store P for all values of δ. Instead, the P table is implemented at subintervals within , with only high-order bits of δ used for addressing P . The simulations described in Sect. 11.2.8, to which Theorem 11.1 applies, were repeated using the correction algorithm with a P table of varying size. The results are shown in the lower two curves in Fig. 11.5, which indicate that for small numbers of intervals per segment, the maximum error is halved as the P table is doubled in size. With 512-word F , D and E tables, a P table of 4k words will reduce |e|max rel log by over 3 orders of magnitude: from 5.022 to 3.9, so it will
162
11 Log-Arithmetic, with Single and Dual Base
Fig. 11.7 Storage requirements for 32-bit LNS device
leave two bits in error. However, the algorithm is unable to make an exact correction and, even with a large number of segments per interval, a small error of about 2 remains. The error can be minimized by empirical choice of the best value of c. By calculating the P table from around the middle of the range of r , the best fit can be obtained. For the results shown in Fig. 11.5 the optimal value is c = −4. For c = 0, with 512 words for each of F , D, E and 4k words for table P , the error in the example above rises from 3.9 to 5.2. The extra error correction tables P and E increase the overall storage requirement. For the range of values shown in Fig. 11.5, these effects are illustrated in Fig. 11.7. For the purpose of this calculation the lookup tables F , D and P are assumed 32-bit wide and the E table 16-bit, except in the 128-interval configuration where the larger errors would require a 32-bit E table. For the example illustrated above (512 intervals per segment, P = 4K) the total storage is roughly doubled from 7,168 words (229,376 bits) for the F and D tables without error correction, to 14,848 words (417,792 bits) for the tables F , D, E, P . In practice, these values are reduced somewhat because the tables would be implemented with the minimum necessary number of bits per segment, gradually reducing through the range of r. This is calculated in detail for a particular implementation, after fixing the table sizes. A number of simplifications are possible which substantially reduce the complexity and delay time of an implementation. In the add/subtract unit, the two multipliers can be realized as parallel arrays. Both operands have fractional parts and their results therefore have twice the required number of fractional bits. Rather than rounding the results, the low-order input bits can be truncated, which has a negligible effect on accuracy, but it reduces greatly the number of multiplier cells. Secondly, the final carry-propagate stage within both multipliers can be omitted, and separate sum and carry vectors passed to an enlarged tree of carry-save adders [15]. This saves most of the carry propagate addition time. The reported simulations take these optimizations into account. Finally, in order to avoid signed multipliers, the algebra can be rearranged such that tables D, E and P contain only positive values. Similarly, r and hence δ have always positive values. This 40-bit design may be used as the basis for a highly accurate 32-bit LNS implementation with one sign bit, 8-bit integer part, and 23-bit fraction, with sub-
11.2 European Logarithmic Microprocessor ELM
163
Table 11.2 Errors in 32-bit high-accuracy LNS addition operation |e|max rel log
|e|av rel log
emax rel
emin rel ar
eav rel ar
|e|av rel ar
0.5046
0.2509
0.3489
−0.3498
+0.0066
0.1739
stantially less error than FLP. The F, D and E tables have 512 words and P has 4k words. The incoming 32-bit operands are expanded to 40 bits by extra zeros, and the 40-bit result is rounded back to 32 bits with a rounder incorporated into the final adder. Essentially, the 9 extra internal bits are used as guard bits. After rounding, the observed |e|max rel log ≈ 4 in the 40-bit implementation is vastly reduced due to the error correction scheme. Using Theorem 11.1, the error simulation results are as in Table 11.2. For more details of the adder design see [13].
11.2.7 Error Correction for Subtraction A separate P table can be computed for the subtraction function and used as in the addition algorithm just described. A detailed working-out of a high-accuracy version of such a subtractor was given in [13]. Since the publication of the latter, however, it became apparent that the P function possesses the further useful property that its values for addition and subtraction, while not identical, are sufficiently close that a satisfactory level of accuracy can be obtained by using one table for both operations. Since the subtraction operation is the more error-prone, it seems reasonable to compute a P table for subtraction and to use this table also for additions. A substantial saving in memory space is thereby possible. Interpolation is difficult for subtractions in the region −1 < r < 0. The rangeshifter algorithm obviates such subtractions by transforming i and j into new values for which r < −1. For details see [11, 13]. It has a delay of one ROM access, a carrypropagate adder, and a carry-save stage. It is not necessary to deploy the range shifter throughout the entire range −1 < r < 0, which can result in large savings in table size. The two ROMs in the unit, the F 1 and F 2 tables, are large since their address bits must equal the addressable range covered by the range shifter. By reducing its application bit-by-bit, these table sizes reduce by powers of 2 at the expense of extra segments in the tables F , D and E. Simulations determine how near to r = 0 the interpolator can be taken for a given accuracy. Simple calculations show the breakeven point between the two sets of table sizes.
11.2.8 Adder/Subtractor Design and Evaluation The objective was to produce 32-bit and 20-bit versions of an LNS ALU having the same or better accuracy as FLP of the same wordlength. A number of simplifications from the initial design presented in the previous section reduces the ROM size while
164
11 Log-Arithmetic, with Single and Dual Base
Table 11.3 Storage for 32-bit and 20-bit LNS addition and subtraction Lookup table
32-bit proc.
Bits
20-bit proc.
Bits
F, D, E Add
256 words × 6
80,384
32 words × 6
4,328
F, D, E Sub
256 words × 6
84,480
32 words × 6
4,928
P
1 kword
27,648
32 words
480
F1
2 kwords
63,488
32 words
576
F2
2 kwords
65,536
32 words
608
Total
321,536
14,912
Table 11.4 Errors in 32-bit and 20-bit LNS addition and subtraction Error
32-b Add
32-b Sub
20-b Add
20-b Sub
|e|max rel log
0.6556
0.7144
0.6493
0.6551
|e|av rel log
0.2563
0.2563
0.2583
0.2575
emax rel arith
+0.4544
+0.4414
+0.4501
+0.3570
emin rel arith
−0.4047
−0.4952
−0.3545
−0.4541
eav rel arith
+0.0457
−0.0455
+0.0592
−0.0581
0.1777
0.1776
0.1790
0.1785
|e|av rel arith
still keeping a maximum error better than FLP. The number of guard bits has been reduced from 9 to 4, which reduces the size of all the tables commensurately. At 32bits the F , D and E tables are reduced to 256 words per segment and the P table to 1,024 words. At this reduced level of precision, the final segment (−32.. − 64) is not required, so the number of segments is also reduced by one. The subtractor range-shifter is used over range −0.5 < r < 0, requiring 2k word F1 and F2 tables. A detailed storage breakdown for the 32 and 20-bit variants is shown in Table 11.3. The necessary number of bits per word reduces with decreasing r. The total of 322 kbits lookup ROM tables for the 32-bit variant costs only 1.2 mm2 , which is 9% of the chip area (in 0.18 μm CMOS). Simulations were carried out for addition and subtraction following Theorem 11.1. It must be noted, however, that when the range shifter is invoked, the subtraction is not done in accordance with (11.4) since the operands i and j are transformed into new values. Hence Theorem 11.1 does not apply within this restricted range. Simulating a subtraction for all combinations of i and j yielding −0.5 < r < 0 is not practical, so operation was simulated for all j values over a limited subset of i, including values around each power of 2 and random values in between. For the accuracy of 32- and 20-bit systems see Table 11.4. The scheme maintains emax rel arith within the FLP limit of 0.5 lsb. Values of |e|av rel arith are also comparable to FLP, although a small bias does persist which is not present in FLP, seen in the small nonzero values of eav rel arith . However, this
11.2 European Logarithmic Microprocessor ELM
165
bias is equal and opposite in add and subtract operations, so it is reduced in signed arithmetic, or in code using add and subtract in roughly equal proportions. This arrangement was taken for the design of the microprocessor, and all simulations are based on this scheme.
11.2.9 Architecture and Performance This is an implementation of the 32-bit scheme as described. It offers addition, subtraction, multiplication, and division operations on LNS format operands. There are two data paths, one for add/subtract and one for multiply/divide, as in Fig. 11.8. The two operands are input to three units: 1. Magnitude compare difference 2. Zero, sign, control 3. Multiply/Divide. The magnitude comparator outputs i, j, r and detects equality. It passes the result of (j ≤ i) on operand magnitudes to the zero/sign/control unit. Following the comparator, add/subtract operations are completed in two specialized circuit blocks. Additions go straight to the add/subtract unit, which interpolates the result using a Taylor expansion with the described error correction algorithm. In the case of subtractions the data follows one of two paths. The operands are processed by the range shifter if −0.5 < r < 0, modifying their values as described earlier, while for r ≤ −0.5 the range shifter is bypassed. The possibly range shifted operands are then put into the adder/subtractor.
Fig. 11.8 The LNS ALU architecture
166
11 Log-Arithmetic, with Single and Dual Base
Table 11.5 Delay times (ns) of VLSI devices
Add
Sub
Mpy
Div
Sqrt
FLP
28
28
22
–
–
FXP
4
4
32
–
–
7
7
7
LNS
21
21
(28∗ )
The zero/sign/control logic can detect a zero operand, and it is supplied by the magnitude comparator with information (j ≤ i) about the relative magnitude of the operands. If at least one operand is zero, the result is zero, and in case of equal operands, it outputs one of the operands. So the two operands and a zero are available to the final multiplexor, set by the control logic. Meanwhile, the sign logic determines the sign of the result by the normal procedures for sign-magnitude arithmetic.
11.2.10 VLSI Implementation An LNS microprocessor with two 32-bit ALU’s was designed at Philips Research Labs (Eindhoven, The Netherlands) as part of European ESPRIT project HSLA (High Speed Log-Arithmetic) [13, 17, 21], and processed in a 0.18 μm CMOS process with six-level metal (17 m wiring), using standard-cell logic (67 k cells) from a proprietary cell library, and special ROM and RAM modules. The design flow, starting from a VHDL functional description, used the Cadence(T M) toolset as applied within the Philips Electronics company for simulations and to produce the layout. Layout foto and specs are at http://zs.utia.cas.cz/projects/hsla/elm.pdf Typical delays through the worst-case speed paths are given in Table 11.5. The times quoted are for the routed design, and includes 2.8 ns access time for the asynchronous ROMs used as lookup tables. The increased delay for LNS subtraction (*) holds if the range shifter is used. Division and square-root for FLP and FXP have larger delays, depending on the iterative approximation algorithm used. The LNS square-root function requires only a one-bit right shift with rounding (a fixed-point add), so it completes in a single clock cycle, just as a multiplication or division. Some chip statistics are listed in Table 11.6. Dissipation depends on clock frequency and application, ranging from 1..5 mW/MHz. For comparison with FLP a commercially available DSP processor, the TMS320C6711 with 32-bit FLP unit [14] was taken (150 MHz, also in 0.18 μm CMOS), described briefly below. Typical throughput of the ELM is 45 MFLOP/s (at 0.33 W dissipation) thus some 135 MFLOP/s per Watt, compared to about 21 MFLOP/s at 0.73 W for the TMS device, hence some 30 MFLOP/s per Watt dissipation. Thus more than twice the performance at less than half the dissipation.
11.2 European Logarithmic Microprocessor ELM
167
Table 11.6 ELM chip data: 13 mm2 , 0.18 μ CMOS, 1.8 V supply, 150 MHz Module:
Prog RAM
Data RAM
ROM
ALU (2×)
bits
71 k
71 k
616 k
32b data
area mm2
0.95
0.95
1.1
1.1 (2×)
delay ns
1.4
1.4
2.8
Core
Total
9.7
3.2 × 4.1 7 (1 cycle)
dissip mW pins
150 . . . 700 115 data
38 power
CPGA 181
11.2.11 The ELM: Some More Architectural Details The ELM is fabricated in 0.18 μ CMOS technology, and designed for 166 MHz operation. Recently it run at 152 MHz. It is a scalar 32 bit device with two (nonpipelined) LNS ALU’s operating in parallel. Its instruction set is based on the register-memory principle. Caches are 71 kbit each (2 k words of 32 + 3 bit), of 2-way set-associative type. The instruction code cache is read-only by the CPU, the data cache is write-back with LRU (least recently used) replacement. Caches and ALUs can process 19 Gigabits/sec, with a max. throughput of 600 MFLOP/s. The processor has 16 general registers, half the number of the TMS-320C6711 (Texas Instruments DSP microprocessor) described briefly in Sect. 11.2.13. Although the ELM is a non-pipelined device with scalar instruction issue, vector operations are accomplished simply by arranging the data into consecutive locations and processing several items at once in an array of parallel functional units. For all integer and logarithmic operations except logarithmic add and subtract there are four parallel units with a latency of one cycle each. The adds and subtracts have two parallel units and take three, or exceptionally four cycles. Data conversion from normal binary code to log-code, and back, make use of the extensive lookup table which the ELM employs for its add/subtract functions. They are performed quickly in real-time, and for normal DSP applications take less then some 10% of its performance. To support the requirement for four memory accesses per instruction, an 8-kbyte level-1 data cache is available with a 128-bit pathway to the processor. Reads may proceed at the rate of one per cycle, whereas writes take two cycles. The processormemory bandwidth is thus 128 bits/cycle for loads and 64 bits/cycle for stores, the same as that of the C6711. An 8-kbyte level-1 instruction cache is also present. Unlike the C6711 there is no level-2 cache, but the level-1 caches on the ELM are twice the size. The programming interface available at the moment is assembly language. A development suite includes a relocating assembler and linkage editor. Programming at this level is somewhat easier than on the C6711, however, for two reasons. First the register-memory architecture reduces the number of instructions required, and relieves the programmer of the responsibility for getting much of the data into place.
168
11 Log-Arithmetic, with Single and Dual Base
Second, the pipeline is fully interlocked. Thus the programmer need not be concerned with scheduling the pipeline, and can write the program in a more intuitive way by keeping in mind the logic without regard to the scheduling. – Performance: A normal programming procedure is to launch two logarithmic additions in one cycle, and then to process four multiplies in the remaining two cycles before the add completes. The maximum logarithmic execution rate in this device is thus two adds and four multiplies in three cycles. In multiply/accumulate (MAC) code it would realize a maximum of 1.33 operations/cycle, and in a sumof-products 2 ops/cycle. In scalar sequences a multiply followed by an add would execute in 4 cycles, a throughput of 0.5 ops/cycle. It is evident from the above that the pipelined C6711 can be expected to offer around twice the performance of the ELM on extremely regular long vector code, whereas this situation will be reversed and the ELM will have about twice the performance in scalar code. In less regular or short vector sequences, e.g. in the processing of triangular matrices, the ELM is also likely to be at an advantage. In any code involving a significant proportion of divide or square-root operations the ELM will offer a very significant improvement. The ELM also needs to maintain deterministic pipeline operation, so like the C6711 it will automatically disable interrupts in the 4 cycles between a branch issue and its completion. However, this has little effect in practice because it is very unusual, given the scalar nature of the design, for a loop to be coded so tightly that it runs in less than 4 cycles. A second consideration is that of accuracy. It was shown in [1] that the LNS offers around a twofold reduction in processing noise compared with floating point. This equates to one bit, or 6dB, and results from the fact that in floating point all operations are liable to a rounding error whereas in the LNS the errors are only incurred during additions and subtractions, all other operations being error-free.
11.2.12 Accuracy Comparisons LNS vs. FLP The objective was to compare the error produced by the 32-bit FLP system with that of the 32-bit LNS. A version of the simulator was prepared in which operations were represented as procedures, to be called from a mainline program executing an algorithm, as in Fig. 11.9. Two further copies of each algorithm were written to operate on the intrinsic (Pentium) 32-bit and 80-bit FLP data types, respectively. In each trial, the 80-bit FLP algorithm was regarded as yielding the standard result. Each algorithm performed the same operation on consecutive items of input data taken from a large, randomly generated file of 80-bit data. The variables in the file were allowed to range between set limits and each algorithm was evaluated with variations in this range. In generating the file, a random positive fraction between 0 and 1 was multiplied by a random power of 10 within the permitted range. The latter was centered on 100 , thus for a range of 104 a multiplier in the range 10−2 . . . 10+2 would be used. For signed data the result was multiplied randomly by +1 or −1.
11.2 European Logarithmic Microprocessor ELM
169
Fig. 11.9 LNS add and subtract error simulations
Since 32-bit logarithmic and 32-bit FLP values do not quantize identically, these effects were eliminated by preceding each simulation with a quantization phase. The procedure for LNS took the 80-bit random input, quantized it to the nearest 32bit logarithmic resp. single FLP value, and converted the latter back to 80-bit FLP representation. The LNS/32-bit FLP value was used as input to the 32-bit implementation under test, while the 80-bit value was input to its 80-bit counterpart. In many cases, therefore, the two systems were not taking identical input data, but were taking the nearest available values to the original data within their own representation. In each case, the 80-bit algorithm returned an accurate result for the quantization used and, from this, the error yielded by the 32-bit system was calculated. Values of |e|av rel arith were calculated for both implementations over the entire result file. Using tens of thousands of random operands to compute many combinations of operations (sum, difference, sum-of-products) it was verified (see error curves in [17]) that the objective of designing a logarithmic addition algorithm with substantially the same, if not smaller, errors as FLP is achieved. The results suggest that LNS offers a broadly two-fold improvement in accuracy over FLP, which is to be expected given a roughly equal mixture of adds and multiplies. The adds have a half-bit rounding error, but multiplies have no error. The benefits to be gained by using LNS will vary, depending on the add/subtract ratio to multiply/divide operations and the sign and of the operands. Of course, when rms calculations dominate, as in adaptive filters, the 1-clockcycle square and squareroot operations give the LNS ALU a great advantage. For extensive case studies of various practical applications, see the full version of the present paper [17], as well as [18] and [19].
170
11 Log-Arithmetic, with Single and Dual Base
11.2.13 The TMS-320C6711 For comparison with a floating-point device, the Texas Instruments TMS320C6711 was chosen (this subsection is with permission taken from [19]). This is regarded as a world leader in state of the art DSP devices. Like the ELM, it is fabricated in 0.18 μ CMOS technology, and has 150 MHz clock frequency. The device has parallel pipelined functional units, super-scalar execution based on a VLIW principle (very large instruction width), and register-register (load-store) type of instruction set. Its processing capability is arranged into two sub-processors or ‘sides’, each with 16 general registers and four functional units. Broadly, the L unit performs floating and fixed point addition, the M unit floating and fixed point multiply, S reciprocal approximation and miscellaneous functions, and D double-word loads. The L and M units are pipelined, each taking four clock cycles to complete a floating point operation. Divides and square-roots are programmed with a software iteration and require about 30 and 40 cycles respectively. The long instruction word is common to both sides and can accommodate and issue 8 instructions—one to each unit—per cycle. Each side uses data primarily from its own register file, although cross-accessing between the two is permitted. Each side can perform one 64-bit load or one 32-bit store per cycle. A 4-kbyte level-1 cache is common to both sides, and is supported by a 256-kbyte level-2 cache. The processor-memory bandwidth is thus 128 bits/cycle for loads and 64 bits/cycle for stores. A 4-kbyte level-1 instruction cache is also present. The programming task is facilitated by an ANSI C compiler that detects parallelism in the source program and generates parallel code. Unlike those of many other VLIW devices, however, this compiler goes further and determines the timing patterns associated with a sequence of instructions, after which it schedules the pipeline itself. Hence there is a reduced level of hardware support for hazard detection and resolution. In particular the pipeline will not interlock if a program attempts to use an item of data before it is available. For example, if a program requests an input operand from a register which is itself waiting to be updated by the output of a pipelined functional unit, then the current value of that register will be issued and used in error. Although an assembler is available, programming in assembly language is more akin to microprogramming. The programmer must calculate the pipeline state at each cycle and arrange the data-flow manually. As the instruction issue pipeline is also several stages long, branch instructions must be specified some cycles before they are executed, and the programmer must be aware of the state of the machine both at the time a conditional branch is issued and at the time it completes. Although analysis tools are available, programming, particularly of loops where data for several iterations may be active at different stages of the pipeline at once, is a difficult task. Loop constructions have to be preceded by a prologue which brings the pipeline into a state equivalent to that at the end of the loop kernel, so as to allow
11.2 European Logarithmic Microprocessor ELM
171
a seamless transition into the kernel itself. An epilogue similarly winds down the terminating iterations at the end. The maximum vector floating point execution rate on this device is two adds and two multiplies per cycle. On multiply-accumulate kernels its absolute maximum is 4 ops/cycle, and in sum-of-products code 3 ops/cycle. These figures will only be achieved under best-case conditions with relatively long vectors and where the memory bandwidth is adequate. In purely scalar sequences, a multiply followed by an add would execute in 8 cycles, giving a throughput of 0.25 ops/cycle. The C6711 pipeline is interruptible, but because of the need to maintain deterministic operation at all times it cannot be interrupted between issue and completion of a branch instruction. This can have a serious effect on loop performance, because branch instructions have a 5-cycle latency so the loop must be longer than 5 cycles in order to guarantee acceptance of the interrupt. As it is often necessary to code a tight loop in less than 5 cycles, such loops are generally accepted as being non-interruptible.
11.2.14 Conclusion A lookup table size reduction of several orders of magnitude is possible, based on a special property of the logarithmic addition and subtraction functions. After a linear Taylor interpolation, the shapes of error curves within each interval are sufficiently similar throughout the range to obtain a good approximation of the curve by scaling from an error template taken from anyone single interval. Moreover, calculation of the interpolation error can be performed in parallel to the interpolation itself, speeding up the process. The error is corrected (approximately can cancelled) by accumulating this term, with a negligible extra delay of only one carry-save stage. Formally, the scheme computes an infinite series, but terms from the cubic onward are progressively less accurate. The inaccuracies are minimized by selectively scaling the regions where they are at their largest. Hitherto, LNS arithmetic devices had offered either better speed or better accuracy than FLP, but not both. Alternatively, they were restricted to short wordlengths. The presented approach demonstrates a design of an LNS arithmetic unit of practical wordlength (32-bit) which performs with much better speed and accuracy than the equivalent FLP. The 32-bit LNS ALU comprises 322 k bits of ROM, and a 20-bit version requires only 11 k bits of lookup table. In both versions, the adder and subtractor has worst-case accuracy within FLP limits of below 0.5 lsb, and a delay (32-bit version) comparable to FLP, between 6 and 7 ns per multiply or divide (≈ 150 MHz clock), and three times this delay per addition or subtraction. Large-scale DSP filter application studies suggest that, by reducing the rounding error in multiply and divide operations, LNS offers improvements in accuracy of some 0.5–2.5 bits. An 32-bit LNS ALU relieves the designer of worries about data precision, thus reducing design time at system level. Moreover, complex and realtime DSP algorithms
172
11 Log-Arithmetic, with Single and Dual Base
are more bounded by instruction execution time. The single clock cycle mpy/div/sqrt and 3-cycle add/subtract help to overcome this limitation. Application areas which benefit most from LNS are those with less regular processing patterns, e.g. in highly scalar code or triangular matrix processing. And applications where multiplications, sums-of-products, or division and square-root operations dominate. These criteria appear to point to more advanced digital adaptive filtering algorithms, and also to graphics applications. In the latter area, an emerging field is physical modeling, in which the graphics device accurately models the response of some physical system, e.g. to generate realistic lighting effects. Such models make extensive use of square-root operations, and are a natural candidate for implementation on the ELM.
Acknowledgments This work is supported by the ESPRIT Long-Term Research program HSLA, grants 23544 (phase-1) and 33544 (phase-). Further details at the project website http://www.ncl.ac.uk/eece/elm. Contact J.N. Coleman at http://www.ncl.ac.uk/eece/research/project/926.
References 1. N.G. Kingsbury, P.J. Rayner: “Digital Filtering Using Logarithmic Arithmetic”, Electron. Lett. 7, 56–58 (1971) 2. T. Kurokawa, J.A. Payne, S.C. Lee: “Error Analysis of Recursive Digital Filters Implemented with Logarithmic Number Systems”, IEEE Trans. ASSP 28, 706–715 (1980) 3. E.E. Swartzlander, D.V. Chandra, H.T. Nagle, S.A. Starks: “Sign/Logarithm Arithmetic for FFT Implementation”, IEEE Trans. Comput. TC-32, 526–534 (1983) and comments TC-35, 482–484 (1986) 4. E.E. Swartzlander, A.G. Alexopoulos: “The Sign/Logarithm Number System”, IEEE Trans. Comput. TC-24, 1238–1242 (1975) 5. F.J. Taylor, R. Gill, J. Joseph, J. Radke: “A 20 Bit Logarithmic Number System Processor”, IEEE Trans. Comput. TC-37, 190–200 (1988) 6. L.K. Yu, D.M. Lewis: “A 30-b Integrated Logarithmic Number System Processor”, IEEE JSSC 26, 1433–1440 (1991) 7. D.M. Lewis: “Interleaved Memory Function Interpolators with Application to an Accurate LNS Arithmetic Unit”, IEEE Trans. Comput. TC-43, 974–982 (1994) 8. D.M. Lewis: “114 MFLOPS Logarithmic Number System Arithmetic Unit for DSP Applications”, IEEE JSSC 30, 1547–1553 (1995) 9. M. Arnold, T. Bailey, J. Cowles, M. Winkel: “Arithmetic Co-Transformations in Real and Complex Logarithmic Number Systems”, IEEE Trans. Comput. TC-47, 777–786 (1998) 10. M.G. Arnold et al.: “Applying Features of IEEE 754 to Sign/Logarithm Arithmetic”, IEEE Trans. Comput. TC-41, 1040–1050 (1992) 11. J.N. Coleman: “Simplification of Table Structure in Logarithmic Arithmetic”, Electron. Lett. 31, 1905–1906 (1995) (Erratum p. 2103 (1996))
References
173
12. M. Schulte, J. Stine: “Symmetric Bipartite Tables for Accurate Function Approximation”, Proceedings of the 13th Symposium on Computer Arithmetic, 1997 13. J.N. Coleman, E.I. Chester: “A 32-Bit Logarithmic Arithmetic Unit and Its Performance Compared to Floating-Point”, 14th Symposium on Computer Arithmetic (1999). 14. Texas Instruments: “TMS320C6711 Floating Point DSP” (1997). http://focus.ti.com/paramsearch/docs/parametricsearch.tsp?family=dsp§ionId=2&tabId= 135&familyId=327 15. E.E. Swartzlander: “Merged Arithmetic”, IEEE Trans. Comput. TC-29, 946–950 (1980) 16. W.H. Press: “Numerical Recipes in Pascal”, Cambridge University Press, Cambridge, 1989 17. J.N. Coleman, E.I. Chester, C.I. Softley, J. Kadlec: “Arithmetic on the European Logarithmic Microprocessor”, IEEE Trans. Comput. TC-49 (7), 702–715 (2000). 18. F. Albu et al.: “The Gauss-Seidel Fast Affine Projection Algorithm”, IEEE Workshop Signal Processing, Systems Design and Implementation (SIPS), 109–114, CA, USA, 2002 19. J.N. Coleman et al.: “The European Logarithmic Microprocessor—a QR RLS application”, IEEE 35th Asilomar Conference on Signals, Systems and Computers, 155–159, CA, USA, 2001 20. J. Kadlec, A. Hermanek, Ch. Softley, R. Matousek, M. Licko: “32-bit Logarithmic ALU for Handel-C-2.1 and Celoxica DK1”, UTIA Prague: Inst. Info-Th. and Automation (dpt. Signal Proc.). http://napier.ncl.ac.uk/elm/Docs/Lns2CelRev2.pdf 21. J. Coleman, C. Softley, J. Kadlec, R. Matousek, Z. Pohl, A. Hermanek, N. Benschop: “The European Logarithmic Microprocessor”, IEEE Trans. Comput. TC-57 (4), 532–546 (2008). 22. N.F. Benschop: Patent US-5923888 “Multiplier for the Multiplication of at Least two Figures in an Original Format” (1999). See also http://de.arxiv.org/abs/math.GM/0105029 23. K. Hwang: “Computer Arithmetic”, (p. 164), Wiley, New York, 1979
References Akers 1978. K. Akers: “Binary Decision Diagrams”, IEEE Comput. C-27, 509–516 (1978) Aleks 1996. I. Aleksander: “Impossible Minds”, Imperial College Press, London, 1996 Apost 1976. T. Apostol: “Introduction to Analytical Number Theory”, Springer, Berlin, 1976 (Theorem 10.4-6) Bell 1945. E.T. Bell: “The Development of Mathematics”, McGraw-Hill, New York, 1945 Bensch 1987. N.F. Benschop: “On State Machine Decomposition and the Five Primitives of Sequential Logic”, International Workshop on Logic Synthesis, MCNC, USA, 1987 Bensch 1990. N.F. Benschop: “Structure of Constant Rank State Machines”, IFIP Workshop: Logic and Architecture Synthesis, 167–176, Paris, 1990 Bensch 1996. N.F. Benschop: “The Semigroup Z(.) mod pk , an Extension of Fermat’s Small Theorem, and Its Additive Structure”, Semigroups and Applications, Prague, 1996 Patent 1999. N.F. Benschop: Patent US-5923888: “Multiplier for the Multiplication of at Least Two Figures in an Original Format” (1999). See also http://de.arxiv.org/abs/math. GM/0105029 Bensch 2000. N.F. Benschop: “Powersums Representing Residues mod pk , from Fermat to Waring”, Comput. Math. Appl. 39, 253–261 (2000) Bensch 2001. N.F. Benschop: “Symmetric Boolean Synthesis with Phase Assignment”, Information Theory Symposium, U-Twente, Enschede, NL, May 2001 Bensch 2005. N.F. Benschop: “Additive Structure of the Group of Units mod p k , with Core and Carry Concepts for Extension to Integers” (incl. direct proof FLT) Acta Math. Univ. Bratislava 72(2), 169–184 (2005). http://pc2.iam.fmph.uniba.sk/amuc/_ vol74n2.html B-B 1970. G. Birkhoff, T. Bartee: “Modern Applied Algebra”, McGraw-Hill, New York, 1970 Boole 1854. G. Boole: “An Investigation of the Laws of Thought”, Dover, New York, 1958 Brayton 1984. R. Brayton, G. Hachtel, C. McMullen, A. Sangiovanni-Vincentelli: “Logic Minimization Algorithms for VLSI Synthesis”, Kluwer, Dordrecht, 1984 Bryant 1986. R. Bryant: “Graph-Based Algorithms for Boolean Function Manipulation”, IEEE Comput. C-35, 677–691 (1986) Chandr 1968. K. Chandrasekharan: “Introduction to Analytic Number Theory”, Springer, Berlin, 1968 (Chap. 7, Theorem 4) C-P 1961. A. Clifford, G. Preston: “The Algebraic Theory of Semigroups”, AMS Surv. #7, 1 130–135 (1961) Cole 2000. J.N. Coleman, E.I. Chester, C.I. Softley, J. Kadlec: “Arithmetic on the European Logarithmic Microprocessor”, IEEE Trans. Comput. TC-49(7), 702–715 (2000) Cole 2001. J.N. Coleman, et al.: “The European Logarithmic Microprocessor—a QR RLS Application”, IEEE 35th Asilomar Conference on Signals, Systems and Computers, 155–159, CA, USA, 2001 Cole 2008. J.N. Coleman, C.I. Softley, J. Kadlec, R. Matousek, Z. Pohl, A. Hermanek, N.F. Benschop: “The European Logarithmic Microprocessor”, IEEE Trans. Comput. 57(4), 532–546 (2008) Albu 2002. F. Albu, et al.: “The Gauss-Seidel Fast Affine Projection Algorithm”, IEEE Workshop on Signal Processing, Systems Design and Implementation (SIPS), 109–114, CA, USA, 2002 Esprit 1999. Esprit Project 33544 HSLA (1999–2002), main contractor Univ-Newcastle (dpt.ECE) UK. Project (ELM) homepage http://napier.ncl.ac.uk/HSLA/. Prague (FPGA) http://www.utia.cas.cz/ZS/home.php?ids=hsla Kadlec 2001. J. Kadlec, A. Hermanek, Ch. Softley, R. Matousek, M. Licko: “32-Bit Logarithmic ALU for Handel-C-2.1 and Celoxica DK1”, UTIA Prague: Inst. Info-Th. and Automation (dpt. Signal Proc.) 2001. http://napier.ncl.ac.uk/elm/ Docs/Lns2CelRev2.pdf N.F. Benschop, Associative Digital Network Theory, © Springer Science + Business Media B.V. 2009
175
176
References
Courtney 2000. T. Courtney, et al.: “Multiplexer Based Reconfiguration for Virtex Multipliers”, Field Progress Logic and Applications, FPL2000, 749–758, Villach, Austria, 2000 Eves 1983a. H. Eves: “Great Moments in Mathematics (after 1650)”, AMS Dolciani Series, Math. Assoc. of America, 1983 Eves 1983b. H. Eves: “Great Moments in Mathematics (before 1650)”, AMS Dolciani Series, Math. Assoc. of America,1953 Eijndh 1994. J. van Eijndhoven: “CMOS Cell Generation for Logic Synthesis”, ASICON’94, 75–78, W.Y. Yuan (ed.), Beijing, 1994 Gauss 1801. C.F. Gauss: “Disquisitiones arithmeticae”, Thesis (U-Göttingen), 1801. http:// www.bookrags.com/Carl_Friedrich_Gauss Ginzb 1968. A. Ginzburg: “Algebraic Theory of Automata”, Academic Press, New York, 1968 Hartm 1970. J. Hartmanis, E. Stearns: “Algebraic Structure of Sequential Machines”, McGrawHill, Englewood Cliffs, 1970 HL-M 2000. L. Heinrich-Litan, P. Molitor: “Least Upper Bounds for the Size of OBDDs by Symmetry Principles”, IEEE Comput. C-49, 360–368 (2000) Kleih 2001. R. Kleihorst, et al.: “Experiments with Fault Tolerant I C Design Using Error Correcting Codes”, International Online Testing Workshop, Sicily, 2001 K-R 1965. K.B. Krohn, J.L. Rhodes: “Algebraic Theory of Machines, Part I”, Trans. AMS 116, 450–464 (1965) McGeer 1993. P. McGeer, J. Sanghavi, R. Brayton, A. Sangiovanni-Vincentelli: “EspressoSignature: a New Exact Minimizer for Logic Functions”, IEEE Trans. VLSI Syst., 1(4) 432–440 (1993) Mealy 1955. G.H. Mealy: “A Method for Synthesizing Sequential Circuits”, Bell Syst. Techn. J., 1045–1079 (1955) Morr 1961. E. Morrison: “Charles Babbage and his Calculating Engines”, Dover, New York, 1961 Muurl 2000. G. Muurling: “Fault Tolerance in I C Design Using Error Correcting Codes”, MSc Thesis, TU-Delft, NL, 2000 Muurl 2000’. G. Muurling et al.: “Error Correction for Combinational Logic Circuits”, 21st Symposium on Info-Theory, 25–31, Wassenaar, NL, 2000 Polya 1954. G. Polya: “Mathematics and Plausible Reasoning” (2 vols.), Princeton University Press, Princeton, 1954 Robins 1982. D.J. Robinson: “A Course in the Theory of Groups”, Graduate Texts in Mathematics, vol. 80, Springer, New York, 1982 Shannon 1938. C.E. Shannon: “Symbolic Analysis of Relay Circuits”, Trans. AIEE 57, 713–723 (1938) Susch 1928. A. Suschkewitsch: “Über die endlichen Gruppen ohne das Gesetz der eindeutigen Umkehrbarkeit”, Math. Ann. 99 30–50 (1928) Schwarz 1981. S. Schwarz: “The Role of Semigroups in the Elementary Theory of Numbers”, Math. Slovaca 31(4) 369–395 (1981) Tellegen 1948. B.D. Tellegen: “The Synthesis of Passive Resistanceless Four-Poles that May Violate the Reciprocity Relation”, Philips Res. Rep. 3, 321–337 (1948) Agrawal 1982. V. Agrawal, S. Seth, P. Agrawal: “Fault Coverage Requirement in Production Testing of LSI Circuits”, IEEE JSSC SC-17, 57–61 (1982) v.Neu 1956. J. von Neumann: “Probabilistic Logics and The Synthesis of Reliable Organisms from Unreliable Components”, Princeton University Press, Princeton, 1956 Evans 1999. W. Evans and L. Schulman: “Signal Propagation and Noisy Circuits”, IEEE Trans. Inf. Theory, 45, 2367–2373 (1999) Pippen 1988. N. Pippenger: “Reliable Computation by Formulas in the Presence of Noise”, IEEE Trans. Inf. Theory, 34, 194–197 (1988) Pradh 1980. D. Pradhan, J. Stiffler: “Error-Correcting Codes and Self-Checking Circuits”, Computer, 27–37 (1980) Nic 1999. M. Nicolaidis: “Time Redundancy Based Soft-Error Tolerance to Rescue Nanometer Technologies”, Proc. IEEE, 86–94 (1999)
References
177
F-M 1999. M. Favalli, C. Metra: “Bus Crosstalk Fault-Detection Capabilities of Error Detection Codes for On-Line Testing”, IEEE Trans. VLSI Syst. 7, 392–396 (1999) MFR 1998. C. Metra, M. Favalli, B. Ricco: “Signal Coding Technique and CMOS Gates for Strongly Fault-Secure Combinatorial Function Blocks”, Proc. IEEE, 174–182 (1998) Lin-C 1983. S. Lin, D. Costello: Error Control Coding: Fundamentals and Applications”, Prentice-Hall, London, 1983 McW-S 1983. F. MacWilliams, N. Sloane: “The Theory of Error-Correcting Codes”, NorthHolland Mathematical Library, vol. 16, North-Holland, Amsterdam (2nd edn.), 1983 Gray 2000. K. Gray: “Adding Error-Correcting Circuitry to ASIC Memory”, IEEE Spectrum, 37, 55–60 (2000) BFT 1986. M. Blaum, P. Farrell, H.v. Tilborg: “A Class of Burst Error Correcting Array Codes”, IEEE Trans. Inf. Theory, IT-32, 836–839 (1986) WBKV 1997. A. van der Werf, W. Brüls, R. Kleihorst, E. Waterlander, M. Verstraelen, T. Friedrich: “I.McIC—A Single-Chip MPEG2 Video Encoder for Storage”, IEEE JSSC 32, 1817–1823 (1997) HAKM 2000. J. Hsieh, A.v.d. Avoird, R. Kleihorst, T. Meng: “Transpose Switch Matrix Memory for Motion JPEG Video Compression on Single Chip Digital CMOS Camcorder”, ICIP 2000, Vancouver, Canada, 2000 MKBVS 2000. G. Muurling, R. Kleihorst, N. Benschop, R. van der Vleuten, J. Simonis: “Error Correction for Combinational Logic Circuits”, Proceedings of the 21th Symposium on Information Theory (Benelux), 25–31, Wassenaar, The Netherlands, May 2000 NK 2004. A.K. Nieuwland, R.K. Kleihorst: “IC Cost Reduction by Applying Embedded Fault Tolerance for Soft Errors”, J. Electron. Test. Theory Appl., 20(5), 533–542 (2004). http://portal.acm.org/citation.cfm?id=1024106
Index
analog, 4 anti-log, 151 aperiodic, 17 arithmetic model, 40 arithmetization, 69 assignment, 34 associative, 6, 9 associative closure, 4 asymmetry of time, 23
band, 23 basic semigroup, 19 Boole, 4 Boolean Function, 69 bridge, 72 bus, 84
carry, 1, 129 carry extension, 11 cascade, 5 cell library, 69 commutative, 9, 19 complementary, 10, 125 components, 5 concatenation, 10 congruence, 10 conjecture, 119, 144 consistency, 10 context-free, 10 crossing node, 79
diagonal connection, 79 dichotomy, 8 differential equations, 4 digital networks, 11 dimension, 19 direct product, 11 disjoint product, 70 division, 152
dynamic behavior, 4
edge effect, 131 equivalence, 4 equivalent, 15 equivalent divisors, 103 error correction, 84, 86 execution rate, 168, 171 extension function, 80
FPGA, 70 FPMUX, 70 full semigroup, 54 function, 9
Gauss, 4 generator, 19 global analysis, 69 Grassmann, 4 greedy algorithm, 69
Hamilton, 4 Hamming codes, 87 Hamming distance, 85 homogeneous, 8, 53
ideal, 32 idempotent, 6, 9, 18 image, 10 inner node, 79 interlace, 131 internal state, 11 invariant structure, 65 iteration, 9, 17 iteration class, 6 iterative, 63
N.F. Benschop, Associative Digital Network Theory, © Springer Science + Business Media B.V. 2009
179
180
join, 125
kernel, 53
leading, 5 left congruence, 10 Linear Networks, 4 link, 72, 76 LNS 20-bit format, 157 LNS 32-bit format, 157 local analysis, 69 log3 code, 151 logic gate, 77 loopfree, 48
majority voting, 87 maximal crossing function, 79 maxit component, 63 meet, 19, 125 metal layer, 72 minimal semigroup, 19 monotone, 17, 19 motivation, 3
natural decomposition, 5 network, 5 nilpotent, 34
odd arithmetic, 152 ordering, 4 orthogonal, 10, 12 orthogrid, 70 orthogrid plot, 70
p-subgroups, 45 partition, 8 pcio equivalence, 77 periodic, 17, 19 phase, 69 phase assignment, 69 planar, 69 planar boolean function, 76
Index
planar crossing, 79 planar node, 71 polarity, 69 primeset, 100 product codes, 87 projection, 10
rank spectrum, 69 redundant circuit, 87 reflexive, 4 register transfer logic, 84 relations, 4 right congruence, 10 right preserved, 10 RTL, 84
self-aligned, 72 semigroup, 4, 9, 15 sequential circuits, 11 sequential closure, 15 sequential logic, 11 similarity transform, 65 software crisis, 3 spectral product, 74 square root, 152 state machine, 15 structure, 4 successor, 151 Sylow components, 45 symmetric, 69 synthesis, 11 system, 9
T-cells, 69 tail, 19 trailing, 5 transitive, 4
via, 72