Files
APS/Other/vector_abs/vector_abs.v
Andrei Solodovnikov f4c0960704 Initial commit
2023-09-07 17:06:55 +03:00

26 lines
322 B
Verilog

module vector_abs(
input [31:0] x,
input [31:0] y,
output[31:0] abs
);
wire [31:0] min;
wire [31:0] min_half;
max_min max_min_unit(
.a(x),
.b(y),
.max(max),
.min(min)
);
half_divider div_unit(
.numerator(min),
.quotient(min_half)
);
assign abs = max + min_half;
endmodule