{VERSION 2 3 "SUN SPARC SOLARIS" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 75 "This defines a shift regis ter. Note that the formula goes into the c4 cell." }}{PARA 0 "" 0 "" {TEXT -1 50 "The other cells are shifted one step to the right." }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "f:=(c4,c3,c2,c1)->((c3+c1 mod 2),c4 ,c3,c2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 59 "This is how we get th e next state after the state (1,0,0,0)" }{TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "f(1,0,0,0);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 92 "% stands for the previous result. (Only on release 5. On release 4 or 3, use \" instead of %)" }}{PARA 0 "" 0 "" {TEXT -1 52 "So f(%) is the next state after the previous result." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "f(\");" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 66 "(f@@2) \+ is Maple's notation for applying a function twice in a row." }{TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "(f@@2)(1,0,0,0);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 64 "Now we execute a loop printing out all the states in succession." }{TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "c:=(1,0,0,0);\nfor i from 0 to 10 do\n c:=f(c) od; " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 26 "A nonlinear shift register" } {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "f:=(c4,c3,c2,c1)->( ( (c4+1)*c3 + (c3+1)*c2+c1 mod 2),c4,c3,c2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "c:=(1,0,0,0);\nfor i from 0 to 20 do\n c:=f(c ) od;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 339 "runshift:=proc(f,m)\n loc al x,ans,c0,c;\n if nargs > 2 then \n c0:=args[3];\n else\n \+ c0:=[1,0$(m-1)];\n fi;\n ans:=[c0];\n for x from 1 to 2^m do \n c:=[f(c0) mod 2,op(c0[1..(m-1)])];\n if member(c, ans ) then break fi;\n ans:=[op(ans),c];\n c0:=c;\n od;\n \+ ans:=[op(ans),c];\n RETURN(evalm(ans))\nend:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "m:=13;\nrunshift( c->(c[m-1]+c[m]), m):\nrowd im(\");" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "runshift( c-> (c [1]+1)*c[2]+(c[2]+1)*c[3]+c[4], 4);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "m:=5;\nrunshift( c->(c[1]*c[3]+c[5]), m,[1,1,1,1,0]); \nrowdim(\");" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}} {MARK "0 2 0" 31 }{VIEWOPTS 1 1 0 1 1 1803 }