module abs8_func (
input signed [7:0] a,
output [7:0] abs
);
// ---------- Write function here----------
function [7:0]abs8;
input signed [7:0] num;
begin
if(num<0) abs8 = -num;
else if (num == -8'sd128) abs8 = num;
else abs8 = num;
end
endfunction
// Function called here
assign abs = abs8(a);
endmodule