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