HDLbits——Lfsr5

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

HDLbits——Lfsr5


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

原理图
HDLbits——Lfsr5

HDLbits——Lfsr5

HDLbits——Lfsr5

HDLbits——Lfsr5

上一篇:Photoshop 调出外景照片偏灰的红色调


下一篇:photoshop快速把舞动的美女移到水花四溅的玻璃瓶中