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

Subversion Repositories ofdm

[/] [ofdm/] [branches/] [avendor/] [rofactor.vhd] - Blame information for rev 13

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 tmsiqueira
---------------------------------------------------------------------------------------------------
2
--
3
-- Title       : rofactor
4
-- Design      : cfft
5
-- Author      : ZHAO Ming
6
-- email           : sradio@opencores.org
7
--
8
---------------------------------------------------------------------------------------------------
9
--
10
-- File        : rofactor.vhd
11
-- Generated   : Thu Oct  3 00:12:16 2002
12
--
13
---------------------------------------------------------------------------------------------------
14
--
15
-- Description : Generate FFT rotation factor 
16
--
17
---------------------------------------------------------------------------------------------------
18
--
19
-- Revisions       :    0
20
-- Revision Number :    1
21
-- Version         :    1.1.0
22
-- Date            :    Oct 17 2002
23
-- Modifier        :    ZHAO Ming 
24
-- Desccription    :    Data width configurable 
25
--
26
---------------------------------------------------------------------------------------------------
27
--
28
-- Revisions       :    0
29
-- Revision Number :    2
30
-- Version         :    1.2.0
31
-- Date            :    Oct 18 2002
32
-- Modifier        :    ZHAO Ming 
33
-- Desccription    :    Data width configurable 
34
--
35
---------------------------------------------------------------------------------------------------
36
 
37
 
38
library IEEE;
39
use IEEE.STD_LOGIC_1164.all;
40
use ieee.std_logic_arith.all;
41
--use ieee.std_logic_unsigned.all;
42
--use ieee.std_logic_signed.all;
43
 
44
entity rofactor is
45
        generic (
46
                POINT : Natural := 64;
47
                STAGE : Natural := 3
48
        );
49
         port(
50
                 clk : in STD_LOGIC;
51
                 rst : in STD_LOGIC;
52
                 start : in STD_LOGIC;
53
                 invert : in std_logic;
54
--               step : in STD_LOGIC_VECTOR(2 downto 0);
55
                 angle : out STD_LOGIC_VECTOR(2*STAGE-1 downto 0)
56
             );
57
end rofactor;
58
 
59
 
60
architecture rofactor of rofactor is
61
signal counter : std_logic_vector( STAGE*2-1 downto 0 ):=( others=>'0' );
62
signal inc,iinc,phase : std_logic_vector( STAGE*2-1 downto 0 ):=( others=>'0' );
63
signal mask : std_logic_vector( STAGE*2-1 downto 0 ):=( others=>'0' );
64
signal comp : std_logic_vector( STAGE*2-1 downto 0 ):=( others=>'0' );
65
 
66
 
67
begin
68
angle<=phase;
69
 
70
count:process( clk,rst )
71
begin
72
        if rst='1' then
73
                counter<=( others=>'0' );
74
                inc<=( others=>'0' );
75
                mask<=( others=>'0' );
76
        elsif clk'event and clk='1' then
77
                if start='1' then
78
                        counter<=( others=>'0' );
79
                        mask<=( others=>'0' );
80
--                      state<="000";
81
                        if invert='1' then
82
                                inc<=CONV_STD_LOGIC_VECTOR(1,STAGE*2);
83
                        else
84
                                inc<=CONV_STD_LOGIC_VECTOR(-1,STAGE*2);
85
                        end if;
86
                else
87
                        counter<=unsigned(counter)+1;
88
                        if signed(counter)=-1 then
89
                                inc<=inc(STAGE*2-3 downto 0 )&"00";
90
                                mask<="11"&mask( STAGE*2-1 downto 2 );
91
--                              if state/="100" then
92
--                                      state<=state+1;         
93
--                              end if;
94
                        end if;
95
                end if;
96
        end if;
97
end process count;
98
 
99
output : process( clk, rst )
100
begin
101
        if rst='1' then
102
                phase<=( others=>'0' );
103
                iinc<=( others=>'0' );
104
        elsif clk'event and clk='1' then
105
                if start='1' then
106
                        iinc<=( others=>'0' );
107
                        phase<=( others=>'0' );
108
                else
109
                        if unsigned(counter( 1 downto 0 ))=3 then
110
                                phase<=( others=>'0' );
111
                        else
112
                                phase<=unsigned(phase)+unsigned(iinc);
113
                        end if;
114
--         if signed(counter or mask)=-1 then   -- modified by Tonny Matos Siqueira
115
         if signed(comp)=-1 then
116
                                iinc<=(others => '0');
117
                        elsif unsigned(counter( 1 downto 0 ))=3 then
118
                                iinc<=unsigned(iinc)+unsigned(inc);
119
                        end if;
120
                end if;
121
        end if;
122
end process output;
123
 
124
comp <= counter or mask;
125
 
126
end rofactor;

powered by: WebSVN 2.1.0

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