-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMultAdd.v
More file actions
40 lines (35 loc) · 836 Bytes
/
Copy pathMultAdd.v
File metadata and controls
40 lines (35 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 29.10.2024 12:03:00
// Design Name:
// Module Name: MultAdd
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module pe
#(parameter WIDTH=16,
FRAC_BIT=10)
(
input wire [WIDTH-1:0] a_in,
input wire [WIDTH-1:0] b,
input wire [WIDTH-1:0] y_in,
output wire [WIDTH-1:0] a_out,
output wire [WIDTH-1:0] y_out
);
wire [WIDTH*2-1:0] ab;
assign ab=a_in*b;
assign y_out = ab[WIDTH+FRAC_BIT-1:FRAC_BIT] + y_in;
assign a_out = a_in;
endmodule