Manuv16589
Member level 1
hi there,
I am writing parallel adder using task. But i am getting error in code.The code is as follows
The error is "ERROR:HDLCompilers:159 - "demo.v" line 35: Illegal argument passed to port 4 (output) of task 'faddr' ". what is this error? Please solve this problem. Thanks in advance.
I am writing parallel adder using task. But i am getting error in code.The code is as follows
Code:
module demo(x,y, cin, s,cout);
parameter N=3;
input [N:0]x,y;
input cin;
output [N:0]s;
output cout;
reg cout;
reg [N:0]s;
reg [N+1:0]c;
integer i;
always@(x,y,cin)
begin
c[0]=cin;
for(i=0;i<=N;i=i+1)
faddr(c[i+1],s[i],x[i],y[i],c[i]);
cout<=c[N+1];
end
task faddr;
input a,b,cin;
output s,cout;
begin
s=a^b^cin;
cout=(a&b)|(b&cin)|(cin&a);
end
endtask
endmodule
The error is "ERROR:HDLCompilers:159 - "demo.v" line 35: Illegal argument passed to port 4 (output) of task 'faddr' ". what is this error? Please solve this problem. Thanks in advance.
Last edited by a moderator: