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

Subversion Repositories simple_fm_receiver

[/] [simple_fm_receiver/] [trunk/] [source/] [fm.vhdl] - Blame information for rev 39

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

Line No. Rev Author Line
1 16 arif_endro
-- $Id: fm.vhdl,v 1.4 2005-03-12 04:18:37 arif_endro Exp $
2 2 arif_endro
-------------------------------------------------------------------------------
3
-- Title       : FM core component
4
-- Project     : FM Receiver 
5
-------------------------------------------------------------------------------
6
-- File        : fm.vhdl
7
-- Author      : "Arif E. Nugroho" <arif_endro@yahoo.com>
8
-- Created     : 2004/12/06
9 16 arif_endro
-- Last update : 2005/03/11 
10 13 arif_endro
-- Simulators  : 
11 2 arif_endro
-- Synthesizers: 
12
-- Target      : 
13
-------------------------------------------------------------------------------
14
-- Description : FM core component to connect all other component
15
-------------------------------------------------------------------------------
16 39 arif_endro
-- Copyright (C) 2004 Arif Endro Nugroho
17 2 arif_endro
-------------------------------------------------------------------------------
18 13 arif_endro
-- 
19
--      THIS SOURCE FILE MAY BE USED AND DISTRIBUTED WITHOUT RESTRICTION
20
-- PROVIDED THAT THIS COPYRIGHT STATEMENT IS NOT REMOVED FROM THE FILE AND THAT
21
-- ANY DERIVATIVE WORK CONTAINS THE ORIGINAL COPYRIGHT NOTICE AND THE
22
-- ASSOCIATED DISCLAIMER.
23
-- 
24
-------------------------------------------------------------------------------
25
-- 
26
--      THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
27
-- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28
-- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
29
-- EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31
-- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
32
-- OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33
-- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34
-- OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
35
-- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
-- 
37
-------------------------------------------------------------------------------
38 2 arif_endro
 
39
library IEEE;
40
use IEEE.STD_LOGIC_1164.ALL;
41
 
42
entity fm is
43
 port (
44
  CLK                     : in  bit;
45
  RESET                   : in  bit;
46
  FMIN                    : in  bit_vector (07 downto 0);
47
  DMOUT                   : out bit_vector (11 downto 0)
48
  );
49
end fm;
50
 
51
architecture structural of fm is
52
 component nco
53
  port (
54
       clock              : in  bit;
55
       clear              : in  bit;
56
       input_nco          : in  bit_vector (17 downto 0);
57
       offset             : in  bit_vector (17 downto 0);
58
       output_nco         : out bit_vector (07 downto 0)
59
       );
60
 end component;
61
 component loop_filter
62
  port (
63
       input_loop         : in  bit_vector (07 downto 0);
64
       clock              : in  bit;
65
       output_loop        : out bit_vector (11 downto 0);
66
       clear              : in  bit
67
       );
68
 end component;
69
 component phase_detector
70
  port (
71
       clock              : in  bit;
72
       signal_input       : in  bit_vector (07 downto 0);
73
       signal_nco         : in  bit_vector (07 downto 0);
74
       phase_output       : out bit_vector (07 downto 0)
75
       );
76
 end component;
77
 component fir
78
  port (
79
       clock              : in  bit;
80
       clear              : in  bit;
81
       fir_in             : in  bit_vector (11 downto 0);
82
       dmout              : out bit_vector (11 downto 0)
83
       );
84
 end component;
85
-- internal signal
86
signal loop_out           : bit_vector (11 downto 0);
87
signal input_nco          : bit_vector (17 downto 0);
88
signal offset             : bit_vector (17 downto 0);
89
signal output_nco         : bit_vector (07 downto 0);
90
signal phase_output       : bit_vector (07 downto 0);
91
 
92
begin
93
-- offset values 1/16 equ B"000100000000000000" <18,0,u>
94
offset (17) <= '0' ;
95
offset (16) <= '0' ;
96
offset (15) <= '0' ;
97
offset (14) <= '1' ;
98
offset (13) <= '0' ;
99
offset (12) <= '0' ;
100
offset (11) <= '0' ;
101
offset (10) <= '0' ;
102
offset (9)  <= '0' ;
103
offset (8)  <= '0' ;
104
offset (7)  <= '0' ;
105
offset (6)  <= '0' ;
106
offset (5)  <= '0' ;
107
offset (4)  <= '0' ;
108
offset (3)  <= '0' ;
109
offset (2)  <= '0' ;
110
offset (1)  <= '0' ;
111
offset (0)  <= '0' ;
112
 
113 16 arif_endro
-- The constant that have big effect on the PLL loop.
114
-- This constant have big effect on system response, high values. (e.g 1/16),
115
-- will make the system have fast response time (e.g. quickly change state).
116
-- Otherwise if low values applied to this (e.g 1/32) will make the system
117
-- little slow response time but have smooth look's. Change it's as you like
118
-- to see the effect's. ^_^
119 2 arif_endro
 
120
input_nco (17) <= loop_out(11); -- 1
121
input_nco (16) <= loop_out(11); -- 1/2
122
input_nco (15) <= loop_out(11); -- 1/4
123
input_nco (14) <= loop_out(11); -- 1/8
124
input_nco (13) <= loop_out(11); -- 1/16
125 16 arif_endro
input_nco (12) <= loop_out(11); -- 1/32
126
input_nco (11) <= loop_out(10); -- 1/64
127
input_nco (10) <= loop_out(09); -- 1/128
128
input_nco (09) <= loop_out(08); -- 1/256
129
input_nco (08) <= loop_out(07); -- 1/512
130
input_nco (07) <= loop_out(06); -- 1/1024
131
input_nco (06) <= loop_out(05);
132
input_nco (05) <= loop_out(04);
133
input_nco (04) <= loop_out(03);
134
input_nco (03) <= loop_out(02);
135
input_nco (02) <= loop_out(01);
136
input_nco (01) <= loop_out(00);
137 2 arif_endro
input_nco (00) <= loop_out(11);
138
 
139
-- end divider 
140
mynco : nco
141
    port map (
142
    clock                      => CLK,
143
    clear                      => RESET,
144
    input_nco                  => input_nco,
145
    offset                     => offset,
146
    output_nco ( 7 downto 0)   => output_nco
147
    );
148
myfir : fir
149
    port map (
150
    clock                      => CLK,
151
    clear                      => RESET,
152
    fir_in                     => loop_out,
153
    dmout (11 downto 0)        => DMOUT
154
    );
155
myphase : phase_detector
156
    port map (
157
    clock                      => CLK,
158
    signal_input               => FMIN,
159
    signal_nco                 => output_nco,
160
    phase_output ( 7 downto 0) => phase_output
161
    );
162
myloop : loop_filter
163
    port map (
164
    input_loop                 => phase_output,
165
    clock                      => CLK,
166
    output_loop (11 downto 0)  => loop_out,
167
    clear                      => RESET
168
    );
169
end structural;

powered by: WebSVN 2.1.0

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