module HELPdecoder(din,dout);
input [1:0] din;
output [7:0] dout;
function [7:0] helpdec;
input [1:0] x;
begin
case (x)
2'b00 : helpdec = 8'b01101110;
2'b01 : helpdec = 8'b10011110;
2'b10 : helpdec = 8'b00011100;
2'b11 : helpdec = 8'b11001110;
endcase
end
endfunction
assign dout = helpdec(din);
endmodule
dout[7]
dout[6]
・
・
dout[0]
din[1]
din[0]
ここがfunction文
function 戻り値ビット幅 ファンクション名
function [7:0] helpdec
endfunction
で閉じる
ここに
タスク
ファンクション内宣言
ファンクションの詳細
(ステートメント)
を記載する