Algebraic theory of flip-flop sequence generators

Algebraic theory of flip-flop sequence generators

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, Ch...

455KB Sizes 0 Downloads 57 Views

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 sequence 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 elements. 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 correlation 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 d e s c r i b e d b y P h i s t e r (1958, pp. 128-129), is a device w i t h b o t h s t o r a g e a n d logical c a p a b i l i t y . W e will r e p r e s e n t t h e flip-flop i n c i r c u i t d i a g r a m s as s h o w n in Fig. 1, w h e r e t h e t w o - t u p l e (Qt, R t) gives t h e "contents" of t h e flip-flop a t t i m e t, a n d is a l w a y s e i t h e r (0, 1) or (1, 0). T h e flip-flops a r e c o n n e c t e d t o g e t h e r in a n y of f o u r w a y s , as s h o w n in Fig. l ( a ) - ( d ) . T h e r e is also a clock c o n n e c t i o n to t h e flip-flops w h i c h we h a v e n o 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

194

ALLTOP~ PRATT~ AND BURTON

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

(d) A d d - o n d complement - O

FIG. 1. J - K flip-flops.

When connected as in Fig. 1, the contents of the second flip-flop at time t + 1 are as follows. Q~+I ___ Q1t. Shift Connection: R~ +~ = R1 ~.

Add-Q Connection: Q~+~ = Q1t + Q2t, where the + is addition rood 2,

R~+1 = R1t + 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 comlJleihent 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. It shows that the order in which the

195

TOGGLE REGISTERS

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 100 110 1111 1100

0~2

o

1 1

1 0 1 1 1 0

0 ol L

Orbit 3

:

Orbit 4

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

connections appear is immaterial as far as the lengths and number of orbits is concerned. Moreover, it is possible to replace add-and-complement-Q connections by add-Q connections, and to replace shift-andcomplement 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 polynomial 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.

196

ALLTOP, PRAT% AND BURTON 2. REDUCTION TO THE LINEAR CASE

T h e state vectors Of t h e t o g g l e register of Fig, 2 are easily seen to satisfy the affine recursion relation 0 0

/ flt-i-tt, r~t-blf%t-I-11-tt-t-l ~

~Zl

~2

~3

,~4

/ =

(QI*Q~'Q3'Q4*)

1 1

-5 (1

0

0

1).

F o r general toggle register we h a v e the affine recursion relation 8t-}-i

=

s,T

-F

c,

t

=

0, 1, 2, . . . ,

where s, = (Q1 t . . . Q t). H e r e c = (cl . - - c~), where cj = 1 if the connection into the j t h flip-flop is a shift-and-complement or an add-andcomplement-Q connection a n d c~ = 0 otherwise; and

0 0

0]

h2

1

0

"..

0

I 0 •

0

t33

1

"..

0 .

0 1

0 0

0 0

0 0

... ".-

1 tn~

where tij = 1 if the connection into t h e j t h flip-flop is an add-Q connection o r an a d d - a n d : c o m p l e m e n t - Q connection. Such a m a t r i x m a y be called :a toggle matrix. T h e m a t r i x T is singular if and only if each tij = 1, in which case the r a n k is n - 1 a n d e v e r y row ( c o l u m n ) is the s u m of the other n - 1 rows (columns). I f I is the n X n i d e n t i t y matrix, t h e n T - - I is singular if and only if each t3j = 0, in which case T -- I looks just like T with each tit = 1. I f A is a n y m a t r i x and c is a n y n-tuple, we define t h e affine transf o r m a t i o n a~., b y the equation sc~.~

=

sA + c.

O u r recursion relation then becomes 8~+ 1 :

8tO~T, v =

~+1 800~T, c

Note that O~A,cOLB,d ~

(XAB,cB.~d



TOGGLE

197

REGISTERS

--1

and t h a 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 a~,c -1 exists, then a~,~ is nonsingular and is an element of the affine

group [cf. Birkhoff and 5/IacLane (1953), pp. 252-253]. I n the equation st+~ = s t A -t- c, if c = 0, we have a linear recursion relation. Suppose there exists a nonsingular affine transformation ~,,y --1 such t h a t a B , y O L T , c O I B , y = OLA, 0 . T h e n ar,c is conjugate to the linear transformation aA,0, and if we transform b y as,y all the vectors in the state diagram of the linear recursion relation corresponding to a~,0, we obtain the state diagram of the toggle register defined b y ar,c. This is easily seen ( a n d well-known) since the equations St+l

=

8tOlA,O

and

s~+laB,v

=

(StOlB,y)O~T,c

each imply the other. The equation --1 OIB,yOlT,cO!B,y

~

O~A, 0

m a y be written O~BTB--I,(yT.{_c__y)B--1

--~ OLA, 0 ,

which is equivalent to the two equations B T B -1 = A

and

(yT-t-

c--

y ) B -1 = O.

T h e second of these equations has a solution if a n d 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 n u m b e r of components equal to 1. (We m a y describe y b y saying t h a t it is a fixed state vector of the toggle register, since y ( T - I ) = c can be written y = y T c - y ~ , o .) I f the second equation is satisfied, the first equation m a y always be satisfied b y 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 m i n i m u m polynomial of a matrix A, it is easy to show from the form of the toggle matrix T t h a t m r ( x ) = x n - ~ ( x -{- 1) n + 1, where u is the number of tjj equal to unity. One also shows t h a t all of

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.

x[ -- T =

I x -t- tll

N

0

x -b &2

1

0

1

0

0

0

x + t33

1

1

0

0

x + t44

V1

x + t22 [0 0

0

0

O

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

1 |

J

x+hl 1 0 O 1

~

o

o

x + t~2

1

0

0

x + t33

1

0

0

0

x-t- t44

1

[loo

o

o

1

(x + t~)

o 1

1

o

I I (x + t~)

x -~- t~3 0

1 x + t44

0 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 1 0 xI-

T,~O °

0

1

0

0

o0

7

0

J'

l+H(x+tjj)

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 m a y realize ar,c by an (n ~- 1) × (n -f- 1) matrix F'm L--

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

Further details on this correspondence are given by Birkhoff and MacLane (1953, pp. 252-253). B y an argument similar to that 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 m r ( 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 t h a n 19 flip-flops is easily obtained. The method of doing this is expounded b y Elspas (1959) and in Chapter 5 of Gill (1966). We will consider a couple of examples to illustrate the use of the table. Letting 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. Written 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 linearized, the sequences {Q/} t~-_oall 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

200

ALLTOP, PRATT~ AND BURTON

÷ v

O

TOGGLE REGISTERS

201

v

v

v

~

v

v

~

v

v

v

202

ALLTOP~ PRATT~ AND :BURTON

v

L <

v

TOGGLE REGISTERS

203

~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, ttarlow 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 Communication with Space Applications," (S. W. Golomb, Ed.). Prentice-Hall, Englewood Cliffs, New Jersey.

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. I R E 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 Progress 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 Degree 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.