myke may i know the verilog code of lfsr ?as i am currently working on project on whcich i have to genrate the pseudo random number ......kindly can u help me
@MsTammna I have never worked with verilog but what you do is take sample bits from a number and feed them back into the LSB via the XOR operation. Every cycle, you shift the numbers to the left with the << operation. For the random number, take some bits from some places (near the LSB or MSB doesn't matter) and convert the binary to decimal. To get a new number, you shift and feed info into the storage number some number of times and read the output after converting the binary to decimal again.
@Myke1576 To avoid getting the same sequence of numbers from start up, seed the storage number with something like the current time in ms. I think that's all you would need for random number generation. It may look like a lot in text but it's really simple. Look up "Linear feedback shift register" on wikipedia for more info.
myke may i know the verilog code of lfsr ?as i am currently working on project on whcich i have to genrate the pseudo random number ......kindly can u help me
MsTammna 1 year ago
@MsTammna I have never worked with verilog but what you do is take sample bits from a number and feed them back into the LSB via the XOR operation. Every cycle, you shift the numbers to the left with the << operation. For the random number, take some bits from some places (near the LSB or MSB doesn't matter) and convert the binary to decimal. To get a new number, you shift and feed info into the storage number some number of times and read the output after converting the binary to decimal again.
Myke1576 1 year ago
@Myke1576 To avoid getting the same sequence of numbers from start up, seed the storage number with something like the current time in ms. I think that's all you would need for random number generation. It may look like a lot in text but it's really simple. Look up "Linear feedback shift register" on wikipedia for more info.
Myke1576 1 year ago