Sasi Cm
Junior Member level 1
Code:
module lfsr(out,i,clk,data);
output [9:0] out;
output [500:0]data;
input clk;
integer i;
reg [9:0] out=10'b1x11x0x101;
wire linear_feedback1;
wire linear_feedback2;
assign linear_feedback1 =(out[3]^out[2]);
assign linear_feedback2 =(out[5]^out[1]);
always @(posedge clk)
begin
out <= {out[8],out[7],out[6],out[5],linear_feedback1,out[3],out[2],out[1],out[0], out[4]};
end
always @(posedge clk)
begin
for(i=0;i<=500;i=i+1)
begin
data[i]=out;
end
end
end
endmodule
i need to store the output of the lfsr continuously in a register.
like this.....if the lfsr output is [3:0]m=1011 0111 1110 1101.....
i have to store it continuously in a register like [15:0]n=1011011111101101....
the above coding store the initial value only.
Last edited by a moderator: