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.
first pass inputs in order and then outputs...not the other way around...you have passed y for s, and not b;
the argument order for your case should be x,y,c and then s,c[i+1]...