1
0
mirror of https://github.com/myhdl/myhdl.git synced 2024-12-14 07:44:38 +08:00

lfsr shift implementation

This commit is contained in:
Jan Decaluwe 2011-05-20 21:07:24 +02:00
parent 654b7cd869
commit 68f6a53ae8

View File

@ -8,8 +8,9 @@ def lfsr24(lfsr, enable, clock, reset):
lfsr.next = 1
else:
if enable:
# lfsr.next[24:1] = lfsr[23:0]
lfsr.next = lfsr[23:0] << 1
lfsr.next[0] = lfsr[23] ^ lfsr[22] ^ lfsr[21] ^ lfsr[16]
lfsr.next[24:1] = lfsr[23:0]
return logic