`timescale 1ns/1ns module function_mod( input [3:0]a, input [3:0]b, output [3:0]c, output [3:0]d ); assign c=reverse(a); assign d=reverse(b); function [3:0] reverse; input[3:0] data; begin reverse[0]=data[3]; reverse[1]=data[2]; reverse[2]=data[1]; reverse[3]=data[0]; end endfunction endmodule