URL
https://opencores.org/ocsvn/cic_core_2/cic_core_2/trunk
Go to most recent revision |
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
7 |
Juzujka |
`timescale 1ns / 1ns
|
2 |
|
|
module integrator
|
3 |
|
|
/*********************************************************************************************/
|
4 |
|
|
#(parameter DATA_WIDTH_INP = 8 , DATA_WIDTH_OUT = 9)
|
5 |
|
|
/*********************************************************************************************/
|
6 |
|
|
(
|
7 |
|
|
input clk,
|
8 |
|
|
input reset_n,
|
9 |
|
|
input clear,
|
10 |
|
|
input wire signed [DATA_WIDTH_INP - 1:0] inp_samp_data,
|
11 |
|
|
input inp_samp_str,
|
12 |
|
|
output reg signed [DATA_WIDTH_OUT - 1:0] out_samp_data
|
13 |
|
|
);
|
14 |
|
|
/*********************************************************************************************/
|
15 |
|
|
wire signed [DATA_WIDTH_OUT - 1:0] sum;
|
16 |
|
|
assign #4 sum = out_samp_data + inp_samp_data; // delay for 18x18 multiplier of Cyclone V SE is 3.4 ns
|
17 |
|
|
always @(posedge clk or negedge reset_n)
|
18 |
|
|
begin
|
19 |
|
|
if (!reset_n) out_samp_data <= '0;
|
20 |
|
|
else if (clear) out_samp_data <= '0;
|
21 |
|
|
else if (inp_samp_str) out_samp_data <= sum;
|
22 |
|
|
end
|
23 |
|
|
/*********************************************************************************************/
|
24 |
|
|
endmodule
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.