1,一位模二加法法则:加减法等同于异或,没有进位。

2,将移位寄存器的某几级作为抽头进行模二加法后作为反馈输入,就构成了有反馈的动态移位寄存器。此方法产生的序列是有周期的。

3,假设移位寄存器的级数为n则m序列的周期是2^n-1,(排除全零的情况),也即是说m序列是一种特殊的动态移位寄存器,一般把m序列称为伪随机序列。

4,要想得到m序列需要找到m序列的本原多项式,根据本原多项式得到伪随机序列,本原多项式fx的特点:

5,一般情况下本原多项式可以通过查表得到,得到本原多项式后需要根据本原多项式编写程序得到m序列。

一篇介绍lfsr的英文

This tutorial will teach you how to use LFSRs, why other tutorials on the subject are so confusing, and how you can go about understanding the underlying mathematics if you really want to know.

First, a glossary.

Linear Feedback Shift Register (LFSR):

An n-bit shift register which pseudo-randomly scrolls between 2n-1 values, but does it very quickly because there is minimal combinational logic involved.
Once it reaches its final state, it will traverse the sequence exactly as before.
It has many applications you should already be familiar with if you’re reading this.

Primitive polynomial:
(very basically) A polynomial of degree n that has the form: 1 + … + xn, where (…) are zero or more terms with a coefficient of 1.
xn and 1 are always present.
For each degree, there can be many different primitive polynomials.
These polynomials also must satisfy other mathematical conditions, if you’re really interested see http://mathworld.wolfram.com/PrimitivePolynomial.htmlor google it.
One important property to note is that their reciprocals also form primitive polynomials (that is, they come in pairs). Example: 1 + x3 + x4 is Degree 4, its reciprocal is 1 + x + x4 (10011 and 11001), and both are primitive.

Taps:
Lines that run from the output of one register within the LFSR into XOR gates that determine input to another register within the LFSR.
These are chosen based on the primitive polynomial.

Type 1 or External LFSRs:
One way of implementing LFSRs; all XOR gates are fed sequentially into one another and end up as the input to the least (or most, either is correct) significant bit of the LFSR.
Simply put, the XORs are external from the shift register.

Type 2 or Internal LFSRs:
Another LFSR implementation; XOR gates feed into different registers within the LFSR, and are not sequential.
Simply put, the XORs are inside the shift register.

Other tutorials on this subject are confusing because they only address one type of implementation, don’t explain how they got the taps, or they show the implementation of an LFSR and then in a table show the taps corresponding to a different primitive polynomial of the same degree.
Keep all of this in mind if you look elsewhere.

Consider a simple 3-bit LFSR.
The only primitive polynomials for degree 3 are 1 + x2 + x3 and 1 + x + x3 (they are reciprocals of each other, 1011 and 1101).
Since we have two primitive polynomials, and we have two different implementation strategies, we therefore have four unique ways of implementing the LFSR.
In fact, each of these implementations can differ according to which register is the most significant bit (either way will have 2n-1 states, but with different sequences).

A and B illustrate a Type 1 / External LFSR.

C and D illustrate a Type 2 / Internal LFSR.

A and C illustrate the implementation of 1 + x2 + x3
B and D illustrate the implementation of 1 + x + x3

Since xn and 1 are always present in primitive polynomials, you can think of them as being used as the output of the shift register and the input of the shift register, respectively.

For an n-bit LFSR, you need to discover a primitive polynomial associated with it to implement it.
Tap tables on the internet will list taps as such:

N = 3, Taps at 0, 1, 3 (this corresponds to 1 + x + x3)

This tutorial uses the 0 and 3 as taps because they correspond to the powers of x in the primitive polynomial.
Sometimes Tap tables will omit the 0 and 3, since they must be present.
Other times, they may use 0 to mean the output of the least significant register (so for N = 3, their taps would be listed as "0, 2" instead of "1, 3").
They usually only list the taps associated with one primitive polynomial, but more than one exists.
All of this explains why different tap tables will sometimes show you different numbers!

Here’s another pair of examples, for n = 8 and using the primitive polynomial 1 + x2 + x3 + x4 + x8:

Internal:


External:

Warning!
The images above show the Reset line used incorrectly.
The registers should be seeded to a non-zero value; all-zeroes is called the lock-up state and will not change.
Therefore, at least one register must be preset.
Your choice in seed value determines the order of states, and ultimately the value at the 2n-1 state.
Note that it is also possible to design LFSRs to have an all-ones lock-up state instead, but this will not be discussed here for brevity.
Special thanks to all those who have pointed out this omission.

Here is a good tap table provided by Scott R. Gravenhorst! In this link, the taps listed omit "0." Again, keep in mind that other polynomials do exist.

Good luck!

Images blatantly stolen fromhttp://www.ee.ualberta.ca/~elliott/ee552/studentAppNotes/1999f/Drivers_Ed/lfsr.html and http://www.edacafe.com/books/ASIC/Book/CH14/CH14.7.php

fpga产生伪随机序列的更多相关文章

  1. Xilinx FPGA高速串行收发器简介

    1 Overview 与传统的并行实现方法相比,基于串行I/O的设计具有很多优势,包括:器件引脚数较少.降低了板空间要求.印刷电路板(PCB)层数较少.可以轻松实现PCB设计.连接器较小.电磁干扰降低 ...

  2. DPSK通信系统的FPGA实现

    之前接触过一些FPGA的相关知识,借着实现一个简单的DPSK系统,顺便复习和记录一下Verilog HDL的简单使用方法.准备直接用一张图展现DPSK的调制解调原理,再按照模块介绍Verilog的实现 ...

  3. FPGA与simulink联合实时环路系列——实验三 按键key

    实验三 按键key 实验内容 在FPGA的实验中,经常涉及到按键的使用,按键是必不可少的人机交互的器件之一,在这些实验中,有时将按键的键值读取显示到数码管.LCD或者是通过串口传送到PC的串口助手上进 ...

  4. FPGA与simulink联合实时环路系列——实验二LED

    实验二LED 实验内容 在实验一的基础上,将simulink产生的测试信号输出到FPGA开发板上的LED灯进行显示,这里要在生成的硬件模型上进行修改,将传送到FPGA的信号输出到8个LED灯上,并且对 ...

  5. FPGA优化之高扇出

    Fanout即扇出,模块直接调用的下级模块的个数,如果这个数值过大的话,在FPGA直接表现为net delay较大,不利于时序收敛.因此,在写代码时应尽量避免高扇出的情况.但是,在某些特殊情况下,受到 ...

  6. 关于 FPGA 内部信号扇入扇出

    扇入.扇出系数 扇入系数是指门电路允许的输入端数目.一般门电路的扇入系数为1—5,最多不超过8.扇出系数是指一个门的输出端所驱动同类型门的个数,或称负载能力.一般门电路的扇出系数为8,驱动器的扇出系数 ...

  7. FPGA Timing笔记

    很多FPGA工程师都会遇到timing的问题,如何让FPGA跑到更快的处理频率是永久话题.决定FPGA的timing关键是什么?如何才能跑到更快的频率呢? A. 第一步需要了解FPGA的timing路 ...

  8. FPGA的引脚VCCINT 、VCCIO VCCA

    首先是看到FPGA在配置的时候有三种不同的电VCCINT .VCCIO VCCA,于是就查了下有什么不同: FPGA一般会有许多引脚,那它们都有什么用呢? VCCINT为施加于 FPGA 内核逻辑的电 ...

  9. FPGA与simulink联合实时环路系列——实验一 测试

    实验一 测试 实验内容 在simulink创建测试模块,通过测试模块产生信号,再传送到FPGA,FPGA读出后再将信号无处理传送回simulink进行显示.由此来测试整个硬件在环的功能是否正常,并且熟 ...

随机推荐

  1. Nginx 301与302配置

    说明 1.首先看一个完整代码示例,关于nginx 301 302跳转的. 301跳转设置: server { listen 80; server_name 123.com; rewrite ^/(.* ...

  2. 机器学习中的numpy库

            日常学习中总是遇到数据需要处理等问题,这时候我们就可以借助numpy这个工具来做一些有意思的事. 1.生成随机数的几种方式 x=np.random.random(12) ###生成12 ...

  3. 平衡搜索树--红黑树 RBTree

    红黑树是一棵二叉搜索树,它在每个节点上增加了一个存储位来表示节点的颜色,可以是Red或Black. 通过对任何一条从根到叶子节点简单路径上的颜色来约束树的高度,红黑树保证最长路径不超过最短路径的两倍, ...

  4. [mongodb] MMAPv1 Storage Engine

    MMAPv1 是mongodb 在3.2以前默认的存储引擎,在3.2 之后默认的存储引擎为WiredTiger,MMAPv1存储引擎基于内存映射文件,它擅长高容量的插入,读取和更新. Journal ...

  5. Gnostice PDFtoolkit VCL的安装

    Installation and Uninstallation For New Users Close all open applications including the IDE. Run the ...

  6. quartz(6)--集群

    Quartz应用能被集群,是水平集群还是垂直集群取决于你自己的需要.集群提供以下好处: · 伸缩性 · 高可用性 · 负载均衡 目前,Quartz只能借助关系数据库和JDBC作业存储支持集群. qua ...

  7. scala学习手记30 - 闭包

    首先要弄白闭包的概念. 教材中的说法是:闭包是一种特殊的函数值,闭包中封闭或绑定了在另一个作用域或上下文中定义的变量.这里说闭包是一种特殊的函数值. 维基百科中的说法是:在计算机科学中,闭包(英语:C ...

  8. 用JS判断IE版本的代码

    方法一: 复制代码代码如下: <script language="javascript"> function getIE() { if(navigator.appNam ...

  9. php超级全局变量和魔术变量

    php超级全局变量和魔术变量 一.总结 一句话总结: 1.两者的书写形式非常不一样,超级全局变量是$_大写变量名 的形式,魔术变量是 __大写变量名的形式__ 2.两者的应用范围不一样,超级全局变量是 ...

  10. ubuntu16.04 运行elasticfusion

    环境:Ubuntu16.04 64bit    Kinect V1 XBOX 360 1.安装OpenNI2并试运行 https://fredfire1.wordpress.com/2016/09/2 ...