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

Subversion Repositories mips_enhanced

[/] [mips_enhanced/] [trunk/] [grlib-gpl-1.0.19-b3188/] [lib/] [gleichmann/] [dac/] [dac_sigdelt_ea.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dimamali
--*******************************************************************************
2
--
3
--  D/A Converter based on 1st order Delta-Sigma Modulator
4
--
5
--  Coded by and Private Property of Prof. Dr. Martin Schubert
6
--
7
--  14. February 2005
8
--
9
--  FH Regensburg, Univ. of Applied Sciences
10
--  Seybothstrasse 2, D-93053 Regensburg
11
--  Email: martin.schubert@e-technik.fh-regensburg.de
12
--
13
--*******************************************************************************
14
 
15
library ieee;
16
use ieee.std_logic_1164.all;
17
library grlib;
18
use grlib.stdlib.all;
19
 
20
entity sigdelt is
21
    generic(c_dacin_length:positive:=8); -- length of binary input vector dac_in
22
    port(
23
      reset:in std_logic;     -- resets integrator, high-active
24
      clock:in std_logic;     -- sampling clock
25
      dac_in:in std_logic_vector(c_dacin_length-1 downto 0); -- input vector
26
      dac_out:out std_logic   -- pseudo-random output bit stream
27
    );
28
end sigdelt;
29
 
30
architecture rtl of sigdelt is
31
  signal delta:std_logic_vector(c_dacin_length+1 downto 0); -- input - feedback
32
  signal state:std_logic_vector(c_dacin_length+1 downto 0); -- integrator's state vector
33
begin
34
 --
35
  delta(c_dacin_length+1)<=state(c_dacin_length+1);
36
  delta(c_dacin_length)  <=state(c_dacin_length+1);
37
  delta(c_dacin_length-1 downto 0)<=dac_in;
38
  --
39
  -- integrator
40
  pr_integrator:process(reset,clock)
41
  begin
42
    if reset='1' then
43
      state<=(others=>'0');
44
    elsif clock'event and clock='1' then
45
      state<=state+delta;
46
    end if;
47
  end process pr_integrator;
48
  --
49
  -- generating a postponed flipflop
50
  pr_postponed:process(reset,clock)
51
  begin
52
    if reset='1' then
53
      dac_out<='0';
54
    elsif clock'event and clock='1' then
55
      dac_out<=state(c_dacin_length+1);
56
    end if;
57
  end process pr_postponed;
58
 --
59
end rtl;
60
 
61
 
62
configuration con_sigdelt of sigdelt is
63
  for rtl
64
  end for;
65
end con_sigdelt;

powered by: WebSVN 2.1.0

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