module comparator(a,b,y);
input a,b;
output [2:0] y;
function [2:0] mycomp;
input a,b;
begin
if (a<b) mycomp=3'b001;
if (a==b) mycomp=3'b010;
if (a>b) mycomp=3'b100;
end
endfunction
assign y=mycomp(a,b);
endmodule
実引数と仮引数を同じにするとどうなるか?
a,bは関数mycompの中だけで有効
(本当はいろいろある)
[結論]
a,bとa,bは区別される