名称:M序列发生器周期32设计Verilog代码ISE仿真
软件:ISE
语言:Verilog
代码功能:M序列发生器周期32
FPGA代码Verilog/VHDL代码资源下载:www.hdlcode.com
演示视频:
设计文档:
1.工程文件
2.程序代码
3.程序编译
4.Testbench(测试文件)
5.仿真波形
部分代码展示:
module m_xulie ( clk, rst, seq_o, seq_p ); //input input clk; input rst; //seq_oput output seq_o;//最终输出 output seq_p; /***********************************************************************/ reg [ 4:0 ]rShift=5'b00001;//5位移位寄存器 reg[4:0] seq_p_cnt=5'd0; reg seq_p_reg=0; reg rseq_o=0; always @( posedge clk or posedge rst ) if( rst == 1 )begin //初始化 rShift <= 5'b00001; //初始化 rseq_o <= 1'b0; end else begin rShift <= { feedback,rShift[ 4:1 ] }; //移位运算 rseq_o <= rShift[ 0 ]; end /************************************************************************/ wire feedback = rShift[ 0 ]^rShift[ 3 ];//a4=a3异或a0 assign seq_o= rseq_o; //计数31(0~30),产生周期信号 always @( posedge clk or posedge rst ) if( rst == 1 )begin seq_p_cnt<=5'd0; seq_p_reg<=0; end
点击链接获取代码文件:http://www.hdlcode.com/index.php?m=home&c=View&a=index&aid=1141
阅读全文
646