> SR -> SR -> SR -> SR -> Output | | | - > spinLFSR() 15 ''' L = len ( init ) # length of the shift register # convert string to SR0 = ) for i in range ( L )] # initial state SR = SR0 # copy initial state # print SR, taps for clk in range ( 1, 2 ** L ): # FB = 0 for i in taps : FB ^= SR # compute the feedback bit SR = ( + SR ) # shift right print SR if SR = SR0 : return clk def findtaps ( L = 4 ): '''Find tap positions that generate a maximum period in an LFSR of length L. LFSR.py # LFSR.py DMQ '''Modeling a Linear Feedback Shift Register (LFSR)As in Stinson p.24, except bits shift to right and the stages are numberedstarting at 0.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |