-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathlfsr-taps.py
83 lines (74 loc) · 1.28 KB
/
lfsr-taps.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/python
import math
count=5
print "bits #Elements #HEX_VAL Taps"
for i in [
[5,4,3,2], \
[6,5,3,2], \
[7,6,5,4], \
[8,6,5,4], \
[9,8,6,5], \
[10,9,7,6], \
[11,10,9,7], \
[12,11,8,6], \
[13,12,10,9], \
[14,13,11,9], \
[15,14,13,11],\
[16,14,13,11],\
[17,16,15,14],\
[18,17,16,13],\
[19,18,17,14],\
[20,19,16,14],\
[21,20,19,16],\
[22,19,18,17],\
[23,22,20,18],\
[24,23,21,20],\
[25,24,23,22],\
[26,25,24,20],\
[27,26,25,22],\
[28,27,24,22],\
[29,28,27,25],\
[30,29,26,24],\
[31,30,29,28],\
[32,30,26,25],\
#[33,32,29,27],\
#[34,31,30,26],\
#[35,34,28,27],\
#[36,35,29,28],\
#[37,36,33,31],\
#[38,37,33,32],\
#[39,38,35,32],\
#[40,37,36,35],\
#[41,40,39,38],\
#[42,40,37,35],\
#[43,42,38,37],\
#[44,42,39,38],\
#[45,44,42,41],\
#[46,40,39,38],\
#[47,46,43,42],\
#[48,44,41,39],\
#[49,45,44,43],\
#[50,48,47,46],\
#[51,50,48,45],\
#[52,51,49,46],\
#[53,52,51,47],\
#[54,51,48,46],\
#[55,54,53,49],\
#[56,54,52,49],\
#[57,55,54,52],\
#[58,57,53,52],\
#[59,57,55,52],\
#[60,58,56,55],\
#[61,60,59,56],\
#[62,59,57,56],\
#[63,62,59,58],\
#[64,63,61,60],\
#[65,64,62,61],\
#[66,60,58,57],\
#[67,66,65,62],\
]:
val=0
for j in i:
val+=int(math.pow(2,j-1))
print "%5d"%count + " " + "%11d"%int(math.pow(2,count)) + " " + format(val, '#10X')+ " " + str(i)
count+=1