module absolute_value #(parameter DATA_WIDTH=32)(
      
//========== INPUT ==========

        input  wire signed [DATA_WIDTH - 1 : 0]  data_in,
            
        
//========== OUTPUT ==========
        output wire  signed [DATA_WIDTH - 1 : 0] data_out
        
//========== IN/OUT ==========
);
    wire signed [DATA_WIDTH - 1 : 0]    data_sign_ext, data_tmp;
    wire signed [DATA_WIDTH - 1 : 0]    abs_value;
    
    assign data_sign_ext = {(DATA_WIDTH){data_in[DATA_WIDTH - 1]}};
    assign data_tmp      = data_in ^ data_sign_ext;
    assign abs_value     = data_tmp - data_sign_ext;
    
    assign data_out = abs_value;
    
endmodule