n位乘加器(先乘后加)
设计n位乘加器(先乘后加)Design a n-bit multiplier (firstly multiply and then add)
-
module MAC_N
-
#(
-
parameter N = 16
-
)
-
(
-
input [N - 1: 0 ] A,
-
input [N - 1: 0 ] B,
-
input [N - 1: 0 ] C,
-
output [2*N - 1 : 0] R
-
);
-
assign R = A * B + C;
-
endmodule