Added: 2 years ago
From: Myke1576
Views: 1,693
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (3)

Sign In or Sign Up now to post a comment!
  • 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.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more