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

Subversion Repositories simple_fm_receiver

[/] [simple_fm_receiver/] [tags/] [VSFR_1/] [source/] [nco.vhdl] - Blame information for rev 32

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 arif_endro
-- $Id: nco.vhdl,v 1.1.1.1 2005-01-04 02:05:58 arif_endro Exp $
2
-------------------------------------------------------------------------------
3
-- Title       : NCO (Numerical Controlled Oscillator)
4
-- Project     : FM Receiver 
5
-------------------------------------------------------------------------------
6
-- File        : nco.vhdl
7
-- Author      : "Arif E. Nugroho" <arif_endro@yahoo.com>
8
-- Created     : 2004/10/27
9
-- Last update : 2005/01/01
10
-- Simulators  : Modelsim 6.0
11
-- Synthesizers: 
12
-- Target      : 
13
-------------------------------------------------------------------------------
14
-- Description : Works like VCO in analog PLL
15
-------------------------------------------------------------------------------
16
-- Copyright (c) 2004 Arif E. Nugroho
17
-- 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
 
21
library IEEE;
22
use IEEE.STD_LOGIC_1164.all;
23
use IEEE.STD_LOGIC_arith.all;
24
 
25
entity nco is
26
      port (
27
           clock       : in  bit;
28
           clear       : in  bit;
29
           input_nco   : in  bit_vector (17 downto 0);
30
           offset      : in  bit_vector (17 downto 0);
31
           output_nco  : out bit_vector (07 downto 0)
32
           );
33
end nco;
34
 
35
architecture structural of nco is
36
   component addacc
37
     port (
38
           clock       : in  bit;
39
           acc         : in  bit_vector (17 downto 0);
40
           result      : out bit_vector (17 downto 0);
41
           offset      : in  bit_vector (17 downto 0)
42
           );
43
   end component;
44
 
45
   component rom
46
     port (
47
           address     : in  bit_vector (09 downto 0);
48
           data        : out bit_vector (07 downto 0)
49
           );
50
   end component;
51
 
52
   signal adder_output : bit_vector (17 downto 0);
53
   signal address_in   : bit_vector (09 downto 0);
54
   signal output_rom   : bit_vector (07 downto 0);
55
 
56
begin
57
   address_in (9) <= adder_output(17);
58
   address_in (8) <= adder_output(16);
59
   address_in (7) <= adder_output(15);
60
   address_in (6) <= adder_output(14);
61
   address_in (5) <= adder_output(13);
62
   address_in (4) <= adder_output(12);
63
   address_in (3) <= adder_output(11);
64
   address_in (2) <= adder_output(10);
65
   address_in (1) <= adder_output(09);
66
   address_in (0) <= adder_output(08);
67
 
68
   output_nco (07) <= (output_rom (07) and not(clear));
69
   output_nco (06) <= (output_rom (06) and not(clear));
70
   output_nco (05) <= (output_rom (05) and not(clear));
71
   output_nco (04) <= (output_rom (04) and not(clear));
72
   output_nco (03) <= (output_rom (03) and not(clear));
73
   output_nco (02) <= (output_rom (02) and not(clear));
74
   output_nco (01) <= (output_rom (01) and not(clear));
75
   output_nco (00) <= (output_rom (00) and not(clear));
76
 
77
 myaddacc  : addacc
78
     port map (
79
              clock                 => clock,
80
              acc                   => input_nco,
81
              result (17 downto 0)  => adder_output,
82
              offset                => offset
83
              );
84
 myrom     : rom
85
     port map (
86
              address (09 downto 0) => address_in,
87
              data    (07 downto 0) => output_rom
88
              );
89
 
90
end structural;

powered by: WebSVN 2.1.0

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