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

Subversion Repositories all_digital_fm_receiver

[/] [all_digital_fm_receiver/] [trunk/] [fir.vhd] - Blame information for rev 7

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

Line No. Rev Author Line
1 2 rahmatulla
LIBRARY ieee;
2
USE IEEE.std_logic_1164.all;
3
USE IEEE.numeric_std.ALL;
4
 
5
 
6
entity FIR is
7
port(
8
        clock           : in std_logic;
9
        reset           : in std_logic;
10
        data_in : in signed(11 downto 0);
11
        data_out        : out std_logic_vector(11 downto 0)
12
);
13
end FIR;
14
 
15
architecture behavior of FIR is
16
 
17
signal d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15 : signed(15 downto 0);
18
signal sum      : signed(15 downto 0);
19
 
20
begin
21
 
22
process(clock,reset)
23
begin
24
        if (reset = '1') then
25
        d0 <= (others => '0');
26
        d1 <= (others => '0');
27
                d2 <= (others => '0');
28
                d3 <= (others => '0');
29
                d4 <= (others => '0');
30
                d5 <= (others => '0');
31
                d6 <= (others => '0');
32
                d7 <= (others => '0');
33
                d8 <= (others => '0');
34
                d9 <= (others => '0');
35
                d10 <= (others => '0');
36
                d11 <= (others => '0');
37
                d12 <= (others => '0');
38
                d13 <= (others => '0');
39
                d14 <= (others => '0');
40
                d15 <= (others => '0');
41
                sum <= (others => '0');
42
                data_out <= (others => '0');
43
        ELSIF rising_edge(clock) THEN
44
                d0 <= data_in(11)&data_in(11)&data_in(11)&data_in(11)&data_in;
45
                d1 <= d0;
46
                d2 <= d1;
47
        d3 <= d2;
48
                d4 <= d3;
49
                d5 <= d4;
50
                d6 <= d5;
51
                d7 <= d6;
52
                d8 <= d7;
53
                d9 <= d8;
54
                d10 <= d9;
55
                d11 <= d10;
56
                d12 <= d11;
57
                d13 <= d12;
58
                d14 <= d13;
59
                d15 <= d14;
60
                sum <= (d0+d1+d2+d3+d4+d5+d6+d7+d8+d9+d10+d11+d12+d13+d14+d15) srl 4;
61
                data_out <= std_logic_vector(sum(11 downto 0));
62
        end if;
63
end process;
64
end behavior;

powered by: WebSVN 2.1.0

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