首页 > 其他 > 详细

HDLbits——Lfsr5

时间:2021-09-06 04:58:46      阅读:16      评论:0      收藏:0      [点我收藏+]

Build this LFSR. The reset should reset the LFSR to 1

技术分享图片


module top_module(
    input clk,
    input reset,    // Active-high synchronous reset to 5‘h1
    output reg [4:0]  q
); 

always @(posedge clk) begin
    if(reset==1‘b1)begin
        q <= 5‘h1;
    end
    else begin
        q <= {0^q[0],q[4],q[3]^q[0],q[2:1]};
    end
end

endmodule

测试波形
技术分享图片

原理图
技术分享图片

技术分享图片

技术分享图片

HDLbits——Lfsr5

原文:https://www.cnblogs.com/waqdgstd/p/15226727.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!