PRBS (Pseudo random binary sequence)
module prbs(a,clk,clr);
output [3:0] a;
input clk,clr;
reg [3:0] tmp;
always @(posedge clk or posedge clr)
begin
if(clr)
begin
tmp = 4'b1111;
end
else
begin
tmp = { tmp[0]^tmp[1],tmp[3],tmp[2],tmp[1]};
end
end
assign a=tmp;
endmodule
module prbs(a,clk,clr);
output [3:0] a;
input clk,clr;
reg [3:0] tmp;
always @(posedge clk or posedge clr)
begin
if(clr)
begin
tmp = 4'b1111;
end
else
begin
tmp = { tmp[0]^tmp[1],tmp[3],tmp[2],tmp[1]};
end
end
assign a=tmp;
endmodule

No comments:
Post a Comment