linShRep[
        n_Integer]  := 
Module[{y,  
          outlist  =  {}}, 
For[i = 0, 
          i < n, i++, 
outlist  =  
            Append[outlist, Last[x]]; 
y  =  
            Mod[a . x, 2]; 
x  =  
            RotateRight[x]; 
x[[1]]  =  
            y
]; 
Return[
          outlist]
]

linShRep::usage  =  "Generate a linear feedback shift register \
sequence.\n
1. Set up the coefficient array a consisting of 0s and 1s.\n
2. Set up the initial state of the shift register as an array x\n
   of the same length consisting of 0s and 1s.\n
3. Call linShRep with the desired number n of output Bits."

(*--------Example application----------------------------------------------*)

a  =  {0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}

x  =  {0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1}

z  =  linShRep[1024]

DensityPlot[z[[32*i + j]], {j, 1, 32},  {i, 0, 31},  
      PlotPoints  ->  32]

Export["C:\Temp\LinShift.eps", %]