OpenCores
URL https://opencores.org/ocsvn/simple_fm_receiver/simple_fm_receiver/trunk

Subversion Repositories simple_fm_receiver

[/] [simple_fm_receiver/] [trunk/] [source/] [fir.vhdl] - Blame information for rev 12

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 arif_endro
-- $Id: fir.vhdl,v 1.2 2005-02-21 06:36:55 arif_endro Exp $
2 2 arif_endro
-------------------------------------------------------------------------------
3
-- Title       : FIR Low pass filter
4
-- Project     : FM Receiver 
5
-------------------------------------------------------------------------------
6
-- File        : fir.vhdl
7
-- Author      : "Arif E. Nugroho" <arif_endro@yahoo.com>
8
-- Created     : 2004/10/30
9 12 arif_endro
-- Last update : 
10
-- Simulators  : 
11 2 arif_endro
-- Synthesizers: 
12
-- Target      : 
13
-------------------------------------------------------------------------------
14
-- Description : FIR low pass filter
15
-------------------------------------------------------------------------------
16 12 arif_endro
-- Copyright (C) 2004 Arif E. Nugroho
17 2 arif_endro
-- This VHDL design file is an open design; you can redistribute it and/or
18
-- modify it and/or implement it after contacting the author
19
-------------------------------------------------------------------------------
20 12 arif_endro
-------------------------------------------------------------------------------
21
-- 
22
--      THIS SOURCE FILE MAY BE USED AND DISTRIBUTED WITHOUT RESTRICTION
23
-- PROVIDED THAT THIS COPYRIGHT STATEMENT IS NOT REMOVED FROM THE FILE AND THAT
24
-- ANY DERIVATIVE WORK CONTAINS THE ORIGINAL COPYRIGHT NOTICE AND THE
25
-- ASSOCIATED DISCLAIMER.
26
-- 
27
-------------------------------------------------------------------------------
28
-- 
29
--      THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
30
-- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
31
-- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
32
-- EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
34
-- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
35
-- OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
36
-- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
37
-- OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
38
-- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39
-- 
40
-------------------------------------------------------------------------------
41 2 arif_endro
 
42
library IEEE;
43
use IEEE.STD_LOGIC_1164.ALL;
44
use IEEE.STD_LOGIC_arith.ALL;
45
 
46
entity fir is
47
  port(
48
  clock  : in  bit;
49
  clear  : in  bit;
50
  fir_in : in  bit_vector (11 downto 0); -- <12,4,t>
51
  dmout  : out bit_vector (11 downto 0)  -- <12,4,t>
52
  );
53
end fir;
54
 
55
architecture structural of fir is
56
  component adder_15bit
57
  port (
58
  addend_15bit   : in  bit_vector (14 downto 0);
59
  augend_15bit   : in  bit_vector (14 downto 0);
60
  adder15_output : out bit_vector (15 downto 0)
61
  );
62
  end component;
63
  component adder_14bit
64
  port (
65
  addend_14bit   : in  bit_vector (13 downto 0);
66
  augend_14bit   : in  bit_vector (13 downto 0);
67
  adder14_output : out bit_vector (14 downto 0)
68
  );
69
  end component;
70
  component adder_13bit
71
  port (
72
  addend_13bit   : in  bit_vector (12 downto 0);
73
  augend_13bit   : in  bit_vector (12 downto 0);
74
  adder13_output : out bit_vector (13 downto 0)
75
  );
76
  end component;
77
  component adder_12bit
78
  port (
79
  addend_12bit   : in  bit_vector (11 downto 0);
80
  augend_12bit   : in  bit_vector (11 downto 0);
81
  adder12_output : out bit_vector (12 downto 0)
82
  );
83
  end component;
84
 
85
  signal  fir_out        : bit_vector (11 downto 0);
86
  signal  fir_in_01      : bit_vector (11 downto 0);
87
  signal  fir_in_02      : bit_vector (11 downto 0);
88
  signal  fir_in_03      : bit_vector (11 downto 0);
89
  signal  fir_in_04      : bit_vector (11 downto 0);
90
  signal  fir_in_05      : bit_vector (11 downto 0);
91
  signal  fir_in_06      : bit_vector (11 downto 0);
92
  signal  fir_in_07      : bit_vector (11 downto 0);
93
  signal  fir_in_08      : bit_vector (11 downto 0);
94
  signal  fir_in_09      : bit_vector (11 downto 0);
95
  signal  fir_in_10      : bit_vector (11 downto 0);
96
  signal  fir_in_11      : bit_vector (11 downto 0);
97
  signal  fir_in_12      : bit_vector (11 downto 0);
98
  signal  fir_in_13      : bit_vector (11 downto 0);
99
  signal  fir_in_14      : bit_vector (11 downto 0);
100
  signal  fir_in_15      : bit_vector (11 downto 0);
101
  signal  fir_in_16      : bit_vector (11 downto 0);
102
  signal  result_adder01 : bit_vector (12 downto 0);
103
  signal  result_adder02 : bit_vector (12 downto 0);
104
  signal  result_adder03 : bit_vector (12 downto 0);
105
  signal  result_adder04 : bit_vector (12 downto 0);
106
  signal  result_adder05 : bit_vector (12 downto 0);
107
  signal  result_adder06 : bit_vector (12 downto 0);
108
  signal  result_adder07 : bit_vector (12 downto 0);
109
  signal  result_adder08 : bit_vector (12 downto 0);
110
  signal  result_adder09 : bit_vector (13 downto 0);
111
  signal  result_adder10 : bit_vector (13 downto 0);
112
  signal  result_adder11 : bit_vector (13 downto 0);
113
  signal  result_adder12 : bit_vector (13 downto 0);
114
  signal  result_adder13 : bit_vector (14 downto 0);
115
  signal  result_adder14 : bit_vector (14 downto 0);
116
  signal  result_adder15 : bit_vector (15 downto 0);
117
 
118
 
119
begin
120
  fir_in_01  <= fir_in;
121
 
122
adder01 : adder_12bit
123
  port map (
124
  addend_12bit(11 downto 0)   => fir_in_01,
125
  augend_12bit(11 downto 0)   => fir_in_02,
126
  adder12_output              => result_adder01
127
  );
128
 
129
adder02 : adder_12bit
130
  port map (
131
  addend_12bit(11 downto 0)   => fir_in_03,
132
  augend_12bit(11 downto 0)   => fir_in_04,
133
  adder12_output              => result_adder02
134
  );
135
 
136
adder03 : adder_12bit
137
  port map (
138
  addend_12bit(11 downto 0)   => fir_in_05,
139
  augend_12bit(11 downto 0)   => fir_in_06,
140
  adder12_output              => result_adder03
141
  );
142
 
143
adder04 : adder_12bit
144
  port map (
145
  addend_12bit(11 downto 0)   => fir_in_07,
146
  augend_12bit(11 downto 0)   => fir_in_08,
147
  adder12_output              => result_adder04
148
  );
149
 
150
adder05 : adder_12bit
151
  port map (
152
  addend_12bit(11 downto 0)   => fir_in_09,
153
  augend_12bit(11 downto 0)   => fir_in_10,
154
  adder12_output              => result_adder05
155
  );
156
 
157
adder06 : adder_12bit
158
  port map (
159
  addend_12bit(11 downto 0)   => fir_in_11,
160
  augend_12bit(11 downto 0)   => fir_in_12,
161
  adder12_output              => result_adder06
162
  );
163
 
164
adder07 : adder_12bit
165
  port map (
166
  addend_12bit(11 downto 0)   => fir_in_13,
167
  augend_12bit(11 downto 0)   => fir_in_14,
168
  adder12_output              => result_adder07
169
  );
170
 
171
adder08 : adder_12bit
172
  port map (
173
  addend_12bit(11 downto 0)   => fir_in_15,
174
  augend_12bit(11 downto 0)   => fir_in_16,
175
  adder12_output              => result_adder08
176
  );
177
 
178
adder09 : adder_13bit
179
  port map (
180
  addend_13bit(12 downto 0)   => result_adder01,
181
  augend_13bit(12 downto 0)   => result_adder02,
182
  adder13_output              => result_adder09
183
  );
184
 
185
adder10 : adder_13bit
186
  port map (
187
  addend_13bit(12 downto 0)   => result_adder03,
188
  augend_13bit(12 downto 0)   => result_adder04,
189
  adder13_output              => result_adder10
190
  );
191
 
192
adder11 : adder_13bit
193
  port map (
194
  addend_13bit(12 downto 0)   => result_adder05,
195
  augend_13bit(12 downto 0)   => result_adder06,
196
  adder13_output              => result_adder11
197
  );
198
 
199
adder12 : adder_13bit
200
  port map (
201
  addend_13bit(12 downto 0)   => result_adder07,
202
  augend_13bit(12 downto 0)   => result_adder08,
203
  adder13_output              => result_adder12
204
  );
205
 
206
adder13 : adder_14bit
207
  port map (
208
  addend_14bit(13 downto 0)   => result_adder09,
209
  augend_14bit(13 downto 0)   => result_adder10,
210
  adder14_output              => result_adder13
211
  );
212
 
213
adder14 : adder_14bit
214
  port map (
215
  addend_14bit(13 downto 0)   => result_adder11,
216
  augend_14bit(13 downto 0)   => result_adder12,
217
  adder14_output              => result_adder14
218
  );
219
 
220
adder15 : adder_15bit
221
  port map (
222
  addend_15bit(14 downto 0)   => result_adder13,
223
  augend_15bit(14 downto 0)   => result_adder14,
224
  adder15_output              => result_adder15
225
  );
226
 
227 12 arif_endro
fir_out(11)    <= (result_adder15(15)); -- 1
228
fir_out(10)    <= (result_adder15(15)); -- 1/2
229
fir_out(09)    <= (result_adder15(15)); -- 1/4
230
fir_out(08)    <= (result_adder15(15)); -- 1/8
231
fir_out(07)    <= (result_adder15(15)); -- 1/16
232
fir_out(06)    <= (result_adder15(14));
233
fir_out(05)    <= (result_adder15(13));
234
fir_out(04)    <= (result_adder15(12));
235
fir_out(03)    <= (result_adder15(11));
236
fir_out(02)    <= (result_adder15(10));
237
fir_out(01)    <= (result_adder15(09));
238
fir_out(00)    <= (result_adder15(08));
239 2 arif_endro
 
240 12 arif_endro
   process (clock, clear)
241 2 arif_endro
 
242 12 arif_endro
   begin
243
 
244
   if    (clear = '1') then
245
 
246
        dmout     <= (others => '0');
247
 
248
   elsif (((clock = '1') and (not(clear) = '1')) and clock'event) then
249
 
250 2 arif_endro
        fir_in_02 <= fir_in_01;
251
        fir_in_03 <= fir_in_02;
252
        fir_in_04 <= fir_in_03;
253
        fir_in_05 <= fir_in_04;
254
        fir_in_06 <= fir_in_05;
255
        fir_in_07 <= fir_in_06;
256
        fir_in_08 <= fir_in_07;
257
        fir_in_09 <= fir_in_08;
258
        fir_in_10 <= fir_in_09;
259
        fir_in_11 <= fir_in_10;
260
        fir_in_12 <= fir_in_11;
261
        fir_in_13 <= fir_in_12;
262
        fir_in_14 <= fir_in_13;
263
        fir_in_15 <= fir_in_14;
264
        fir_in_16 <= fir_in_15;
265
 
266
        dmout     <= fir_out;
267
 
268
   end if;
269 12 arif_endro
 
270
   end process;
271
 
272 2 arif_endro
end structural;

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.