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

Subversion Repositories adaptive_lms_equalizer

[/] [adaptive_lms_equalizer/] [trunk/] [code/] [d_to_a_1bit.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 digish
--  Copyright (C) 2004-2005 Digish Pandya <digish.pandya@gmail.com>
2
 
3
--  This program is free software; you can redistribute it and/or modify
4
--  it under the terms of the GNU General Public License as published by
5
--  the Free Software Foundation; either version 2 of the License, or
6
--  (at your option) any later version.
7
--
8
--  This program is distributed in the hope that it will be useful,
9
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
10
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
--  GNU General Public License for more details.
12
--
13
--  You should have received a copy of the GNU General Public License
14
--  along with this program; if not, write to the Free Software
15
--  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
16
 
17
-- simple one bit analog output
18
-- is outputting frequency in responce to count no
19
-- so it repressent amount of error with frequency
20
 
21
library IEEE;
22
use IEEE.STD_LOGIC_1164.all;
23
use IEEE.STD_LOGIC_UNSIGNED.ALL;
24
 
25
entity d_a is
26
  port (
27
   clk : in std_logic;
28
   data_in : in std_logic_vector (15 downto 0);
29
   an_out : out std_logic;
30
   reset: in std_logic
31
  );
32
end d_a;
33
 
34
architecture d_a_arch of d_a is
35
  signal  d_a_Accumulator : std_logic_vector(8 downto 0);
36
begin
37
  process(clk)
38
  begin
39
    if (clk'event and clk = '1') then
40
                if (reset = '0') then
41
                        d_a_Accumulator <= "000000000";
42
                else
43
                        d_a_Accumulator  <=  ("0" & d_a_Accumulator(7 downto 0)) + ("0" & data_in(7 downto 0));
44
                end if;
45
    end if;
46
  end process;
47
 
48
  an_out <= d_a_Accumulator(8);
49
end d_a_arch;
50
 

powered by: WebSVN 2.1.0

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