最初的想法是使用LFSR生成一个随机数。到目前为止,我已经使用c#开发了一种LFSR方法。一旦函数被调用,它总是返回相同的值。 为了在每次运行程序时收集不同的随机数,我必须进行哪些更改?int lfsr1() int start_state = 5; /* Any nonzero start state will work. */ int bit; /
我的意思是,我不需要返回LFSR的最后一位作为输出位,而是返回LFSR的任何一点(例如第二位或第三位)。我真的很难回答这个问题。有人能给出一些如何实现的提示吗?#include < stdint.h >unsigned period = 0; unsigned lsb = lfsr & 1;the last bit but i need to take any bit the number of which is specified as