mirror of
https://github.com/MPSU/APS.git
synced 2025-09-16 01:30:10 +00:00
Перевод Verilog-кода на SystemVerilog
This commit is contained in:
25
Other/vector_abs/vector_abs.sv
Normal file
25
Other/vector_abs/vector_abs.sv
Normal file
@@ -0,0 +1,25 @@
|
||||
module vector_abs(
|
||||
input logic [31:0] x,
|
||||
input logic [31:0] y,
|
||||
output logic [31:0] abs
|
||||
);
|
||||
|
||||
|
||||
logic [31:0] min;
|
||||
logic [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
|
Reference in New Issue
Block a user