13
INFORMATION AND CONTROL 12, 193-205 (1968) Algebraic Theory of Flip-Flop Sequence Generators W. O. ALLTOP AND A. V. PtL&TT Naval Weapons Center, China Lake, California 93555 AND R." C. BURTON* Mathematics Department, Brigham Young University, Provo, Utah 8]t601 The problem of constructing linear shift registers with a minimum number of adders has provoked interesting research on the theory of trinomials over the field with two elements. Each adder which can be eliminated significantly increases the speed at which the se- quence can be generated, and linear shift registers corresponding to trinomials have only one adder. In this paper we describe a class of sequence generators employing J-K flip-flops in place of the usual delay elements, and which require no adders or additional gating. J-K flip-flops operate at a speed comparable to that of delay ele- ments. If n is the number of flip-flops, then for n = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 17, and 18 a sequence of period 2~ - 1 can be generated. This sequence is linear and has the well-known randomness and corre- lation properties. A table in the final section of this paper gives the periodic structure for all n _-< 19. 1. INTRODUCTION A J-K flip-flop, as described by Phister (1958, pp. 128-129), is a device with both storage and logical capability. We will represent the flip-flop in circuit diagrams as shown in Fig. 1, where the two-tuple (Qt, R t) gives the "contents" of the flip-flop at time t, and is always either (0, 1) or (1, 0). The flip-flops are connected together in any of four ways, as shown in Fig. l(a)-(d). There is also a clock connection to the flip-flops which we have not ShOWn. * Part of this work was done while the author was at the Naval Weapons Center, China Lake, California during the summer of 1967. 193

Algebraic Theory of Flip-Flop Sequence Generators · 2016. 12. 23. · INFORMATION AND CONTROL 12, 193-205 (1968) Algebraic Theory of Flip-Flop Sequence Generators W. O. ALLTOP AND

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Algebraic Theory of Flip-Flop Sequence Generators · 2016. 12. 23. · INFORMATION AND CONTROL 12, 193-205 (1968) Algebraic Theory of Flip-Flop Sequence Generators W. O. ALLTOP AND

INFORMATION AND CONTROL 12, 193-205 (1968)

Algebraic Theory of Flip-Flop Sequence Generators

W . O. ALLTOP AND A. V. PtL&TT

Naval Weapons Center, China Lake, California 93555

AND

R." C. BURTON*

Mathematics Department, Brigham Young University, Provo, Utah 8]t601

The problem of constructing linear shift registers with a minimum number of adders has provoked interesting research on the theory of trinomials over the field with two elements. Each adder which can be eliminated significantly increases the speed at which the se- quence can be generated, and linear shift registers corresponding to trinomials have only one adder. In this paper we describe a class of sequence generators employing J-K flip-flops in place of the usual delay elements, and which require no adders or additional gating. J-K flip-flops operate at a speed comparable to that of delay ele- ments. If n is the number of flip-flops, then for n = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 17, and 18 a sequence of period 2 ~ - 1 can be generated. This sequence is linear and has the well-known randomness and corre- lation properties. A table in the final section of this paper gives the periodic structure for all n _-< 19.

1. INTRODUCTION

A J - K flip-flop, as descr ibed b y P h i s t e r (1958, pp. 128-129) , is a device w i th b o t h s to rage a n d logical capab i l i t y . W e will r ep resen t t he fl ip-flop in c i rcui t d i ag rams as shown in Fig. 1, where the t w o - t u p l e (Qt, R t) gives t he "contents" of the flip-flop a t t ime t, a n d is a lways e i the r (0, 1) or (1, 0) . T h e fl ip-flops are connec ted toge the r in any of four ways , as shown in Fig . l ( a ) - ( d ) .

T h e r e is also a clock connec t ion to the fl ip-flops wh ich we have no t ShOWn.

* Part of this work was done while the author was at the Naval Weapons Center, China Lake, California during the summer of 1967.

193

Page 2: Algebraic Theory of Flip-Flop Sequence Generators · 2016. 12. 23. · INFORMATION AND CONTROL 12, 193-205 (1968) Algebraic Theory of Flip-Flop Sequence Generators W. O. ALLTOP AND

194 ALLTOP~ PRATT~ AND BURTON

(e) Shift connection (b) Add-Q connection (c) Shi f t -and- . . . . . . complement

FIG. 1. J - K flip-flops.

(d) Add -ond - complement - O

When connected as in Fig. 1, the contents of the second flip-flop at time t + 1 are as follows.

Shift Connection:

Add-Q Connection:

Q~+I ___ Q1t.

R~ +~ = R1 ~.

Q~+~ = Q1 t + Q2 t, where the + is addition rood 2,

R~ +1 = R1 t + R 2 t+ 1.

Shift-and-Complement Connection:

Ot+~ = 0 1 ' + 1,

R~ +i = Ri t + 1.

Add-and-Complement-Q Connection:

Q~+I = Q1 t + Q2t + 1,

R~ +1 = R1 t + R2 t.

In Fig. 2 we show a sequence generator made up of J - K flip-flops. We will call such a device a toggle register. Since R j t is always the com- lJleihent of Q jr, the state at time t of a register with n flip-flops is uniquely specified by the n-tuple (Q1 t . . . Qnt). The register of Fig. 2 divides the s~ate sp~ce of all binary 4-tuples into four disjoint cycles or orbits, as st~0~Va in: Fig. 3.

T h a t ~his situation is typical is shown by TI~EORE~ 1. Let n be the number of flip-flops, and u be the number of

cdiinections which are either add-Q connections or add-and-complement-Q connections. I f 0 < u < n, the states are partitioned into disjoint orbits whose lengths and number depend only on u and n.

This theorem, which covers the values of u for which long orbits can be obtained, is proved in Section 2. I t shows that the order in which the

Page 3: Algebraic Theory of Flip-Flop Sequence Generators · 2016. 12. 23. · INFORMATION AND CONTROL 12, 193-205 (1968) Algebraic Theory of Flip-Flop Sequence Generators W. O. ALLTOP AND

TOGGLE REGISTERS 195

FIG. 2. A Toggle register.

' • 0 0

o 1 0 1

0 0 1 1

o 0 1 0

1 0 1 o

0 1 I 0

Orbit 1

/•0 1 0 0

1 1 0

1 1 1 1

1 1 0 0

0 ~ 2

o

1 1 0 1 1

1 1 0

Orbit 3 FIG. 3. State orbits of the toggle register of Fig. 2.

0 ol

L :

Orbit 4

connections appear is immaterial as far as the lengths and number of orbits is concerned. Moreover, it is possible to replace add-and-com- plement-Q connections by add-Q connections, and to replace shift-and- complement connections by shift connections. If this is done, the toggle register is linear, and the theory or autonomous linear sequential circuits applies. The algebraic theory of such circuits was completely given by Elspas (1959) and Crowell (1962). On pp. 53-54 of his fundamental paper Elspas already considers the effect of replacing delay elements by trigger flip-flops.

The theory of linear autonomous circuits is closely connected with that of linear shift registers and difference equations as given by Golomb ( 1955 ) and Zierler (1959). We have

THEORE~ 2. Suppose 0 < U < n and the toggle register is taken to :be linear. Then the sequences { Q/}t~=o (i.e., the individual columns of the state orbits) all satisfy the difference equation corresponding to the poly- nomial x"-~(1 + x)" + 1.

A proof is given in Section 2, and the cases where u = 0 and u = n are considered. The case where u = 0 and there are an Odd number :of shift-and-complement connections is mathematically interesting in that the toggle register is then essentially affine and cannot be linearized. A reader whose interests are entirely practical may turn directly to Section 3.

Page 4: Algebraic Theory of Flip-Flop Sequence Generators · 2016. 12. 23. · INFORMATION AND CONTROL 12, 193-205 (1968) Algebraic Theory of Flip-Flop Sequence Generators W. O. ALLTOP AND

196 ALLTOP, PRAT% AND BURTON

2. REDUCTION TO THE LINEAR CASE

The s ta te vectors Of the t o g g l e register of Fig, 2 are easily seen to sat isfy the affine recursion relat ion

/ flt-i-tt, r~t-blf%t-I-11-tt-t-l ~ 0 1 ~ Z l ~ 2 ~ 3 ,~4 / = (QI*Q~'Q3'Q4*) 0 1 -5 (1 0 0 1).

For general toggle register we have the affine recursion relat ion

8t-}-i = s ,T -F c, t = 0, 1, 2, . . . ,

where s, = (Q1 t . . . Q t). Here c = (cl . - - c~), where cj = 1 if the con- nect ion into the j t h flip-flop is a sh i f t -and-complement or an add-and- complement -Q connect ion and c~ = 0 otherwise; and

0 0 0] h2 1 0 ".. 0

I 0 0 t33 1 " . . 0 • .

0 0 0 0 . . . 1 1 0 0 0 " . - tn~

where tij = 1 if the connect ion into the j t h flip-flop is an add-Q connec- t ion o r an add-and :complemen t -Q connection. Such a ma t r ix m a y be cal led :a toggle mat r ix .

T h e ma t r ix T is singular if and only if each tij = 1, in which case the r ank is n - 1 and every row (co lumn) is the s u m of the o ther n - 1 rows (co lumns) . I f I is the n X n iden t i ty mat r ix , t hen T - - I is s ingular if and only if each t3j = 0, in which case T - - I looks jus t like T wi th each tit = 1.

I f A is a n y m a t r i x and c is any n- tuple , we define the affine t rans- fo rma t ion a~., b y the equa t ion

sc~.~ = sA + c.

Our recursion relat ion then becomes

~+1 8~+ 1 : 8tO~T, v = 800~T, c •

N o t e t h a t

O~A,cOLB, d ~ (XAB,cB.~d

Page 5: Algebraic Theory of Flip-Flop Sequence Generators · 2016. 12. 23. · INFORMATION AND CONTROL 12, 193-205 (1968) Algebraic Theory of Flip-Flop Sequence Generators W. O. ALLTOP AND

T O G G L E R E G I S T E R S 197

--1 and tha t aA,c exists if and only if A -1 exists, in which case

--1 O~A, c ~ O~A--1 ,__cA- -L .

I f -1 a~,c exists, then a~,~ is nonsingular and is an element of the affine group [cf. Birkhoff and 5/IacLane (1953), pp. 252-253].

In the equation st+~ = s tA -t- c, if c = 0, we have a linear recursion relation. Suppose there exists a nonsingular affine t ransformation ~,,y

--1 such tha t aB ,yOLT ,cOIB ,y = OLA, 0 . Then ar,c is conjugate to the linear trans- formation aA,0, and if we transform by as,y all the vectors in the state diagram of the linear recursion relation corresponding to a~,0, we ob- tain the state diagram of the toggle register defined by ar ,c . This is easily seen (and well-known) since the equations

S t + l = 8tOlA,O and s~+laB,v = ( S t O l B , y ) O ~ T , c

each imply the other. The equation

--1 OIB,yOlT,cO!B,y ~ O~A, 0

m a y be writ ten

O~BTB--I,(yT.{_c__y)B--1 --~ OLA, 0 ,

which is equivalent to the two equations

B T B -1 = A and ( y T - t - c - - y ) B -1 = O.

The second of these equations has a solution if and 0nly if y ( T -- I ) = c. Such a y always exists if T - I is nonsingular. I f T - I is singular, then y exists if and only if c belongs to the row space of T -- I , i.e., if and only if the vector c has an even number of components equal to 1. (We m a y describe y by saying tha t it is a fixed s tate vector of the toggle register, since y ( T - I ) = c can be writ ten y = y T

c - y~ ,o .) I f the second equation is satisfied, the first equation m a y always be

satisfied by taking A = T and B = I , whence ar,c is conjugate to ~r,0 • Moreover, staz,~ = st W y.

I f m A ( x ) denotes the min imum polynomial of a matr ix A, it is easy to show from the form of the toggle matr ix T tha t

mr (x ) = x n - ~ ( x -{- 1) n + 1,

where u is the number of tjj equal to unity. One also shows tha t all of

Page 6: Algebraic Theory of Flip-Flop Sequence Generators · 2016. 12. 23. · INFORMATION AND CONTROL 12, 193-205 (1968) Algebraic Theory of Flip-Flop Sequence Generators W. O. ALLTOP AND

198 ALLTOP, PRATT, AND BURTON

the other invariant factors of T are equal to 1 [cf. Albert (1956), pp. 78-88]. We illustrate the computation for the case n = 4.

I x -t- tll 1 0 0 x[ -- T = 0 x -b &2 1 0 1

0 0 x + t33 1 | 1 0 0 x + t44 J

V 1 0 O x + h l 1 N x + t22 1 0 0

[ 0 x-~- t 3 8 1 O ~ 0 0 x -~ t44 1

o o o 1 x + t~2 1 0 (x + t~)

0 x + t33 1 0 0 0 x-t- t44 1

[ l o o o o 1 1 o I I (x + t~)

x -~- t~3 1 0 0 x + t44 1

Note that the 3 X 3 matrix in the lower right-hand corner at stage 4 has the same form as the entire 4 X 4 matrix at stage 2. Repeating the last two steps of the above reduction two more times we obtain

[,oOO o 7 1 0 0

x I - T , ~ O ° 0 1 0 J ' 0 0 l + H ( x + t j j )

the desired result, since 1 + I I ( x + tji) = 1 + x'-"(x + 1) ~. If T -- I is singular and c has an odd number of l's, (i.e., if u = 0

and there are an odd number of shift-and-complement connections) we have seen that ar,~ is not conjugate to any linear transformation a~.0 on the space of n-tuples. However, we may realize ar,c by an (n ~- 1) × (n -f- 1) matrix

F'm

L - -

Page 7: Algebraic Theory of Flip-Flop Sequence Generators · 2016. 12. 23. · INFORMATION AND CONTROL 12, 193-205 (1968) Algebraic Theory of Flip-Flop Sequence Generators W. O. ALLTOP AND

TOGGLE REGISTERS 199

where 0 is a column vector of n O's, provided that to each n-tuple s we let correspond the (n ~- 1)-tuple (s, 1). Then we have

Fur ther details on this correspondence are given by Birkhoff and Mac- Lane (1953, pp. 252-253). By an argument similar to tha t given for T, we see that

mv(x) = (x -~ 1 ) . ( x ~ d- 1)

and all of the other invariant factors of U are equal to 1. The elementary divisors of T and U are the prime power factors of

mr (x ) and my(x), since the other invariant factors are equal to 1 [el. 5~acDuffee (1943)].

3. THE STATE STRUCTURE

B y using Table I, which gives the faetorization of the polynomials x~-~(x + 1) ~ d- 1 for 2 _-_ n -<_ 19 and 0 < u _-_ n, the state diagram of any toggle register with no more than 19 flip-flops is easily obtained. The method of doing this is expounded by Elspas (1959) and in Chapter 5 of Gill (1966).

We will consider a couple of examples to illustrate the use of the table. Lett ing n = 7 and u = 3 we find the entry

7 (361),

3 127.

The numbers in parenthesis are octal numbers which when translated into binary give the coefficients of an irreducible polynomial over the field of integers modulo 2, e.g.,

(361) = 011110001 = x ~ d- x 6 d- x 5 d- x 4 + 1 = x4(x -[- 1) 3 + 1.

Wri t ten beneath each irreducible polynomial is its period. The period of (361) is 127 = 27 -- 1, which shows that the state diagram consists of one big orbit of 127 7-tuples and a trivial orbit of only One 7-tuple (which is (0000000) if the toggle register is linearized.) If the register is linear- ized, the sequences { Q/} t~-_o all satisfy the difference equation

Q~+7 t+6 r)t+4

which corresponds to the polynomial x"-u(x "-I- 1) u d- 1. The sequences

Page 8: Algebraic Theory of Flip-Flop Sequence Generators · 2016. 12. 23. · INFORMATION AND CONTROL 12, 193-205 (1968) Algebraic Theory of Flip-Flop Sequence Generators W. O. ALLTOP AND

200 ALLTOP, PRATT~ AND BURTON

÷

O

v

Page 9: Algebraic Theory of Flip-Flop Sequence Generators · 2016. 12. 23. · INFORMATION AND CONTROL 12, 193-205 (1968) Algebraic Theory of Flip-Flop Sequence Generators W. O. ALLTOP AND

TOGGLE REGISTERS 201

v

v v

v ~ v v ~ v v

Page 10: Algebraic Theory of Flip-Flop Sequence Generators · 2016. 12. 23. · INFORMATION AND CONTROL 12, 193-205 (1968) Algebraic Theory of Flip-Flop Sequence Generators W. O. ALLTOP AND

202 ALLTOP~ PRATT~ AND :BURTON

L

<

v

v

Page 11: Algebraic Theory of Flip-Flop Sequence Generators · 2016. 12. 23. · INFORMATION AND CONTROL 12, 193-205 (1968) Algebraic Theory of Flip-Flop Sequence Generators W. O. ALLTOP AND

TOGGLE REGISTERS 203

Page 12: Algebraic Theory of Flip-Flop Sequence Generators · 2016. 12. 23. · INFORMATION AND CONTROL 12, 193-205 (1968) Algebraic Theory of Flip-Flop Sequence Generators W. O. ALLTOP AND

~0~ ALLTOP, PRATT, AND BURTON

are periodic with period 2" - 1 (except in the case of the null sequence) and have very desirable randomness and autocorrelation properties as discussed by Zierler (1959), Baumert (1964), and Golomb (1967).

Suppose we take n = 8. Then x~-~(x -{- 1) ~ + 1 is not an irreducible polynomial of period 2 ~ - 1 for any u. Letting u = 3 we have

8 (13) (67),

3 7 31,

and the longest orbit is of length 217 = 1.c.m. [7, 31] since x'~-~(x ~ 1) u ~ 1 has no repeated factors. ( I t can be shown that x~-U(x + 1) ~ -~ 1 has repeated factors only when it is a perfect square.)

If 0 < u < n, and if the initial state vector is chosen to be (Q1 °, t Q2O,..., Q0) = (1, o, . . . , 0), then the sequence {Q,}t=o always has

maximal period for the given u and n. This can be shown by adopting an argument of Robinson's (1963).

If u = n, the state space is divided into disjoint "bushes" rather than disjoint orbits. The factorization of x~=~(x -~ 1) ~ -~ 1 may be used to determine the number and structure of the bushes; cf. Crowell (1962) and Gill (1966, Chap. 5).

If u = 0, the table gives the polynomial mr(x) = x ~ -]- 1 and its factorization. This is the proper polynomial to use if the toggle register has an even number of shift-and-complement connections. If the toggle register has an odd number of shift-and-complement connections, the relevant polynomial is mv(x) = (x -~ 1)(x ~ -t- 1) whose factorization can be obtained from that of mr(x) and whose maximal period is 2n.

In computing Table I, extensive use was made of the table of 5~[arsh (1957) of irreducible polynomials of degree -<_19 and their periods. Peterson (1961) provides a published table of polynomials of degree _-_ 16 as well as material related to this paper, particularly in Chapter 7.

In a recent paper, t tarlow and Coates (1967) have laid a foundation for the study of general sequential machines which utilize flip-flops.

RECEIVEn : February 26, 1968

REFERENCES

ALbeRT, A. A. (1956), "Fundamental Concepts of Higher Algebra." University of Chicago Press, Chicago.

BAUMERT, L. D. (1964), Generation of specified sequences. In "Digital Communi- cation with Space Applications," (S. W. Golomb, Ed.). Prentice-Hall, Engle- wood Cliffs, New Jersey.

Page 13: Algebraic Theory of Flip-Flop Sequence Generators · 2016. 12. 23. · INFORMATION AND CONTROL 12, 193-205 (1968) Algebraic Theory of Flip-Flop Sequence Generators W. O. ALLTOP AND

TOGGLE REGISTERS 205

BIRKHOFF, G., AND M.~-cL.~_NI':, S. (1953). "A Survey of Modern Algebra," 2nd ed., Macmillan, New York.

CROW~'~LL, It. H. (1962), Graphs of linear transformations over finite fields. J. Soc. Indust. Appl. Math. 10, 103-112.

ELSPAS, B. (1959), The theory of autonomous linear sequential networks. IRE Trans. Circuit Theory CT-6, 4~60.

G~L~, A. (1966), "Linear Sequential Circuits." McGraw-Hill, New York. GOLOMB, S. W. (1955), Sequences with Randomness Properties, Terminal Prog-

ress I~eport under Contract Req. No. 639498. Glenn L. Martin Co., Baltimore. GOLOMS, S. W. (1967), "Shift Register Sequences." Holden-Day, San Francisco. HARLOW, C., AND COATES, C. L. (1967), On the structure of realizations using

flip-flop memory elements. Inform. Control 10,159-174. MAcDuFFE~, C. C. (1943), "Vectors and Matrices." Mathematical Association

of America, Menasha, Wisconsin. M.~Rstt, I{,. W. (1957) "Table of Irreducible Polynomials over GF(2) through De-

gree 19," distributed by Office of Technical Services, Commerce Department, Washington, D. C.

P|~:TF~RSON, W. W. (1961), "Error-Correcting Codes." MIT Press, Cambridge, and Wiley, New York.

P]FIISTER, M., JR. (1958), "Logical Design of DigitaI Computers." Wiley, New York.

ROBINSON, D. W. (1963), The Fibonacci matrix modulo m. Fibonacci Quart. 1, 29-36.

ZIERLER, N. (1959), Linear recurring sequences. J. Soc. Indust. Appl. Math. 7, 31-48.