generated from TinyTapeout/tt09-verilog-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad824c2
commit 7be90ff
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module processing_element( | ||
input wire clk, | ||
input wire rst, | ||
input wire [15:0] data_in_2, | ||
input wire [15:0] data_in_1, | ||
output wire [31:0] data_out | ||
); | ||
|
||
reg [31:0] acc ; | ||
|
||
always @(posedge clk or posedge rst) begin | ||
|
||
if (rst) begin | ||
acc <= 32'b0; | ||
data_out <= 32'b0; | ||
end else begin | ||
acc <= acc + $signed(data_in_1) + $signed(data_in_2); | ||
data_out <= acc; | ||
end | ||
end | ||
|
||
|
||
|
||
|
||
endmodule |