rockgird
Junior Member level 3
lfsr verilog
hii,
i m writin a code for a 1-bit LFSR. but it isn't workin.
this is my code
module LFSR ( out ,clk );
input clk ;
wire clk ;
output out ;
wire out ;
reg Q1='b1;
wire Q2='b1, Q3='b1;
wire i='b0;
task dff;
output Q;
input D;
begin
assign Q = D;
end
endtask
always @(posedge clk)
begin
while(i<1)
begin
assign Q1=((Q2&(~Q3))|((~Q2)&Q3));
dff (Q2,Q1);
dff (Q3,Q2);
dff (Q1,Q3);
end;
end
endmodule
this is the error i m gettin
# Compile...
# Pass 1. Scanning modules hierarchy.
# Pass 2. Processing instantiations.
# Pass 3. Processing behavioral statements.
# Error: VCP2808 LFSR.v : (53, 14): Q OUTPUT/INOUT argument in dff task must be connected to a valid left-hand side of procedural assignment: Q2.
# Error: VCP2808 LFSR.v : (54, 14): Q OUTPUT/INOUT argument in dff task must be connected to a valid left-hand side of procedural assignment: Q3.
# Error: VCP2000 LFSR.v : (56, 5): Syntax error. Unexpected token: ;. Expected tokens: '#' , '(' , '{' , 'assign' , 'begin' ... .
# Compile failure 3 Errors 0 Warnings Analysis time : 1.
# done
block diagram is attached
ps:- I m usin Active HDL 6.3 for this person.
thanx in anticipation.
hii,
i m writin a code for a 1-bit LFSR. but it isn't workin.
this is my code
module LFSR ( out ,clk );
input clk ;
wire clk ;
output out ;
wire out ;
reg Q1='b1;
wire Q2='b1, Q3='b1;
wire i='b0;
task dff;
output Q;
input D;
begin
assign Q = D;
end
endtask
always @(posedge clk)
begin
while(i<1)
begin
assign Q1=((Q2&(~Q3))|((~Q2)&Q3));
dff (Q2,Q1);
dff (Q3,Q2);
dff (Q1,Q3);
end;
end
endmodule
this is the error i m gettin
# Compile...
# Pass 1. Scanning modules hierarchy.
# Pass 2. Processing instantiations.
# Pass 3. Processing behavioral statements.
# Error: VCP2808 LFSR.v : (53, 14): Q OUTPUT/INOUT argument in dff task must be connected to a valid left-hand side of procedural assignment: Q2.
# Error: VCP2808 LFSR.v : (54, 14): Q OUTPUT/INOUT argument in dff task must be connected to a valid left-hand side of procedural assignment: Q3.
# Error: VCP2000 LFSR.v : (56, 5): Syntax error. Unexpected token: ;. Expected tokens: '#' , '(' , '{' , 'assign' , 'begin' ... .
# Compile failure 3 Errors 0 Warnings Analysis time : 1
# done
block diagram is attached
ps:- I m usin Active HDL 6.3 for this person.
thanx in anticipation.