lior2000
Newbie level 2
- Joined
- Feb 19, 2013
- Messages
- 2
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,302
hello
i'm new with verilog and i want to design fobonazzi code that work recorsively.
i try to use this code at modelsim:
module fib(number, value);
input number;
output value;
wire number;
reg value;
reg v1;
reg v2;
if(number < 2)
value = number;
else
begin
fib f1 (number-1,v1);
fib f2 (number-2,v2);
value = (v1+v2);
end
endmodule
but it can't compile with this errores:
# ** Error: I:/project/fib/fib.v(12): near "=": syntax error, unexpected '=', expecting IDENTIFIER or TYPE_IDENTIFIER
# ** Error: I:/project/fib/fib.v(17): near "=": syntax error, unexpected '=', expecting IDENTIFIER or TYPE_IDENTIFIER
how to fix it? it's very importent to me and little urge.
i don't know enough about verilog and i'm trying to study so pls explain me as much as you can.
lior
i'm new with verilog and i want to design fobonazzi code that work recorsively.
i try to use this code at modelsim:
module fib(number, value);
input number;
output value;
wire number;
reg value;
reg v1;
reg v2;
if(number < 2)
value = number;
else
begin
fib f1 (number-1,v1);
fib f2 (number-2,v2);
value = (v1+v2);
end
endmodule
but it can't compile with this errores:
# ** Error: I:/project/fib/fib.v(12): near "=": syntax error, unexpected '=', expecting IDENTIFIER or TYPE_IDENTIFIER
# ** Error: I:/project/fib/fib.v(17): near "=": syntax error, unexpected '=', expecting IDENTIFIER or TYPE_IDENTIFIER
how to fix it? it's very importent to me and little urge.
i don't know enough about verilog and i'm trying to study so pls explain me as much as you can.
lior