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 14

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

Line No. Rev Author Line
1 14 arif_endro
-- $Id: fir.vhdl,v 1.3 2005-03-04 08:06:17 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
 
45
entity fir is
46
  port(
47
  clock  : in  bit;
48
  clear  : in  bit;
49
  fir_in : in  bit_vector (11 downto 0); -- <12,4,t>
50
  dmout  : out bit_vector (11 downto 0)  -- <12,4,t>
51
  );
52
end fir;
53
 
54
architecture structural of fir is
55
  component adder_15bit
56
  port (
57
  addend_15bit   : in  bit_vector (14 downto 0);
58
  augend_15bit   : in  bit_vector (14 downto 0);
59
  adder15_output : out bit_vector (15 downto 0)
60
  );
61
  end component;
62
  component adder_14bit
63
  port (
64
  addend_14bit   : in  bit_vector (13 downto 0);
65
  augend_14bit   : in  bit_vector (13 downto 0);
66
  adder14_output : out bit_vector (14 downto 0)
67
  );
68
  end component;
69
  component adder_13bit
70
  port (
71
  addend_13bit   : in  bit_vector (12 downto 0);
72
  augend_13bit   : in  bit_vector (12 downto 0);
73
  adder13_output : out bit_vector (13 downto 0)
74
  );
75
  end component;
76
  component adder_12bit
77
  port (
78
  addend_12bit   : in  bit_vector (11 downto 0);
79
  augend_12bit   : in  bit_vector (11 downto 0);
80
  adder12_output : out bit_vector (12 downto 0)
81
  );
82
  end component;
83
 
84
  signal  fir_out        : bit_vector (11 downto 0);
85
  signal  fir_in_01      : bit_vector (11 downto 0);
86
  signal  fir_in_02      : bit_vector (11 downto 0);
87
  signal  fir_in_03      : bit_vector (11 downto 0);
88
  signal  fir_in_04      : bit_vector (11 downto 0);
89
  signal  fir_in_05      : bit_vector (11 downto 0);
90
  signal  fir_in_06      : bit_vector (11 downto 0);
91
  signal  fir_in_07      : bit_vector (11 downto 0);
92
  signal  fir_in_08      : bit_vector (11 downto 0);
93
  signal  fir_in_09      : bit_vector (11 downto 0);
94
  signal  fir_in_10      : bit_vector (11 downto 0);
95
  signal  fir_in_11      : bit_vector (11 downto 0);
96
  signal  fir_in_12      : bit_vector (11 downto 0);
97
  signal  fir_in_13      : bit_vector (11 downto 0);
98
  signal  fir_in_14      : bit_vector (11 downto 0);
99
  signal  fir_in_15      : bit_vector (11 downto 0);
100
  signal  fir_in_16      : bit_vector (11 downto 0);
101
  signal  result_adder01 : bit_vector (12 downto 0);
102
  signal  result_adder02 : bit_vector (12 downto 0);
103
  signal  result_adder03 : bit_vector (12 downto 0);
104
  signal  result_adder04 : bit_vector (12 downto 0);
105
  signal  result_adder05 : bit_vector (12 downto 0);
106
  signal  result_adder06 : bit_vector (12 downto 0);
107
  signal  result_adder07 : bit_vector (12 downto 0);
108
  signal  result_adder08 : bit_vector (12 downto 0);
109
  signal  result_adder09 : bit_vector (13 downto 0);
110
  signal  result_adder10 : bit_vector (13 downto 0);
111
  signal  result_adder11 : bit_vector (13 downto 0);
112
  signal  result_adder12 : bit_vector (13 downto 0);
113
  signal  result_adder13 : bit_vector (14 downto 0);
114
  signal  result_adder14 : bit_vector (14 downto 0);
115
  signal  result_adder15 : bit_vector (15 downto 0);
116
 
117
 
118
begin
119
  fir_in_01  <= fir_in;
120
 
121
adder01 : adder_12bit
122
  port map (
123
  addend_12bit(11 downto 0)   => fir_in_01,
124
  augend_12bit(11 downto 0)   => fir_in_02,
125
  adder12_output              => result_adder01
126
  );
127
 
128
adder02 : adder_12bit
129
  port map (
130
  addend_12bit(11 downto 0)   => fir_in_03,
131
  augend_12bit(11 downto 0)   => fir_in_04,
132
  adder12_output              => result_adder02
133
  );
134
 
135
adder03 : adder_12bit
136
  port map (
137
  addend_12bit(11 downto 0)   => fir_in_05,
138
  augend_12bit(11 downto 0)   => fir_in_06,
139
  adder12_output              => result_adder03
140
  );
141
 
142
adder04 : adder_12bit
143
  port map (
144
  addend_12bit(11 downto 0)   => fir_in_07,
145
  augend_12bit(11 downto 0)   => fir_in_08,
146
  adder12_output              => result_adder04
147
  );
148
 
149
adder05 : adder_12bit
150
  port map (
151
  addend_12bit(11 downto 0)   => fir_in_09,
152
  augend_12bit(11 downto 0)   => fir_in_10,
153
  adder12_output              => result_adder05
154
  );
155
 
156
adder06 : adder_12bit
157
  port map (
158
  addend_12bit(11 downto 0)   => fir_in_11,
159
  augend_12bit(11 downto 0)   => fir_in_12,
160
  adder12_output              => result_adder06
161
  );
162
 
163
adder07 : adder_12bit
164
  port map (
165
  addend_12bit(11 downto 0)   => fir_in_13,
166
  augend_12bit(11 downto 0)   => fir_in_14,
167
  adder12_output              => result_adder07
168
  );
169
 
170
adder08 : adder_12bit
171
  port map (
172
  addend_12bit(11 downto 0)   => fir_in_15,
173
  augend_12bit(11 downto 0)   => fir_in_16,
174
  adder12_output              => result_adder08
175
  );
176
 
177
adder09 : adder_13bit
178
  port map (
179
  addend_13bit(12 downto 0)   => result_adder01,
180
  augend_13bit(12 downto 0)   => result_adder02,
181
  adder13_output              => result_adder09
182
  );
183
 
184
adder10 : adder_13bit
185
  port map (
186
  addend_13bit(12 downto 0)   => result_adder03,
187
  augend_13bit(12 downto 0)   => result_adder04,
188
  adder13_output              => result_adder10
189
  );
190
 
191
adder11 : adder_13bit
192
  port map (
193
  addend_13bit(12 downto 0)   => result_adder05,
194
  augend_13bit(12 downto 0)   => result_adder06,
195
  adder13_output              => result_adder11
196
  );
197
 
198
adder12 : adder_13bit
199
  port map (
200
  addend_13bit(12 downto 0)   => result_adder07,
201
  augend_13bit(12 downto 0)   => result_adder08,
202
  adder13_output              => result_adder12
203
  );
204
 
205
adder13 : adder_14bit
206
  port map (
207
  addend_14bit(13 downto 0)   => result_adder09,
208
  augend_14bit(13 downto 0)   => result_adder10,
209
  adder14_output              => result_adder13
210
  );
211
 
212
adder14 : adder_14bit
213
  port map (
214
  addend_14bit(13 downto 0)   => result_adder11,
215
  augend_14bit(13 downto 0)   => result_adder12,
216
  adder14_output              => result_adder14
217
  );
218
 
219
adder15 : adder_15bit
220
  port map (
221
  addend_15bit(14 downto 0)   => result_adder13,
222
  augend_15bit(14 downto 0)   => result_adder14,
223
  adder15_output              => result_adder15
224
  );
225
 
226 12 arif_endro
fir_out(11)    <= (result_adder15(15)); -- 1
227
fir_out(10)    <= (result_adder15(15)); -- 1/2
228
fir_out(09)    <= (result_adder15(15)); -- 1/4
229
fir_out(08)    <= (result_adder15(15)); -- 1/8
230
fir_out(07)    <= (result_adder15(15)); -- 1/16
231
fir_out(06)    <= (result_adder15(14));
232
fir_out(05)    <= (result_adder15(13));
233
fir_out(04)    <= (result_adder15(12));
234
fir_out(03)    <= (result_adder15(11));
235
fir_out(02)    <= (result_adder15(10));
236
fir_out(01)    <= (result_adder15(09));
237
fir_out(00)    <= (result_adder15(08));
238 2 arif_endro
 
239 12 arif_endro
   process (clock, clear)
240 2 arif_endro
 
241 12 arif_endro
   begin
242
 
243
   if    (clear = '1') then
244
 
245
        dmout     <= (others => '0');
246
 
247
   elsif (((clock = '1') and (not(clear) = '1')) and clock'event) then
248
 
249 2 arif_endro
        fir_in_02 <= fir_in_01;
250
        fir_in_03 <= fir_in_02;
251
        fir_in_04 <= fir_in_03;
252
        fir_in_05 <= fir_in_04;
253
        fir_in_06 <= fir_in_05;
254
        fir_in_07 <= fir_in_06;
255
        fir_in_08 <= fir_in_07;
256
        fir_in_09 <= fir_in_08;
257
        fir_in_10 <= fir_in_09;
258
        fir_in_11 <= fir_in_10;
259
        fir_in_12 <= fir_in_11;
260
        fir_in_13 <= fir_in_12;
261
        fir_in_14 <= fir_in_13;
262
        fir_in_15 <= fir_in_14;
263
        fir_in_16 <= fir_in_15;
264
 
265
        dmout     <= fir_out;
266
 
267
   end if;
268 12 arif_endro
 
269
   end process;
270
 
271 2 arif_endro
end structural;

powered by: WebSVN 2.1.0

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