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

Subversion Repositories cfft

[/] [cfft/] [trunk/] [src/] [mulfactor.vhd] - Blame information for rev 14

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 sradio
---------------------------------------------------------------------------------------------------
2
--
3
-- Title       : mulfactor
4
-- Design      : cfft
5
-- Author      : ZHAO Ming
6
-- email           : sradio@opencores.org
7
--
8
---------------------------------------------------------------------------------------------------
9
--
10
-- File        : mulfactor.vhd
11
-- Generated   : Thu Oct  3 00:37:40 2002
12
--
13
---------------------------------------------------------------------------------------------------
14
--
15
-- Description : 360 degee complex rotation 
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.1
31
-- Date            :    Oct 18 2002
32
-- Modifier        :    ZHAO Ming 
33
-- Desccription    :    Point 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_SIGNED.all;
42
 
43
entity mulfactor is
44
        generic (
45
                WIDTH : Natural;
46
                STAGE : Natural
47
        );
48
         port(
49
                 clk : in STD_LOGIC;
50
                 rst : in STD_LOGIC;
51
                 angle : in signed(2*STAGE-1 downto 0);
52
                 I : in signed(WIDTH+1 downto 0);
53
                 Q : in signed(WIDTH+1 downto 0);
54
                 Iout : out signed(WIDTH+3 downto 0);
55
                 Qout : out signed(WIDTH+3 downto 0)
56
             );
57
end mulfactor;
58
 
59
 
60
architecture mulfactor of mulfactor is
61
signal phase : signed( 2*STAGE-3 downto 0 );
62
signal Xi,Yi : signed( WIDTH+1 downto 0 );
63
component sc_corproc
64
        generic(
65
                WIDTH : Natural;
66
                STAGE : Natural
67
        );
68
        port(
69
                clk     : in std_logic;
70
                ena     : in std_logic;
71
                Xin     : in signed(WIDTH+1 downto 0);
72
                Yin     : in signed(WIDTH+1 downto 0);
73
                Ain : in signed(2*STAGE-3 downto 0 );
74
 
75
                sin     : out signed(WIDTH+3 downto 0);
76
                cos     : out signed(WIDTH+3 downto 0));
77
end component;
78
 
79
begin
80
 
81
        u1: sc_corproc
82
        generic map(
83
                WIDTH=>WIDTH,
84
                STAGE=>STAGE
85
        )
86
        port map (
87
                clk=>clk,
88
                ena=>'1',
89
                Xin=>Xi,
90
                Yin=>Yi,
91
                Ain=>phase,
92
 
93
                sin=>Qout,
94
                cos=>Iout
95
        );
96
 
97
process( clk, rst )
98
variable temp : std_logic_vector( 1 downto 0 );
99
begin
100
        if rst='1' then
101
                phase<=( others=>'0' );
102
                Xi<=( others=>'0' );
103
                Yi<=( others=>'0' );
104
        elsif clk'event and clk='1' then
105
                phase<=angle( 2*STAGE-3 downto 0 );
106
                temp:=std_logic_vector(angle( 2*STAGE-1 downto 2*STAGE-2 ));
107
                case  temp is
108
                        when "00" =>
109
                        Xi<=I;
110
                        Yi<=Q;
111
                        when "01" =>
112
                        Xi<=0-Q;
113
                        Yi<=I;
114
                        when "10" =>
115
                        Xi<=0-I;
116
                        Yi<=0-Q;
117
                        when "11" =>
118
                        Xi<=Q;
119
                        Yi<=0-I;
120
                        when others=>
121
                        null;
122
                end case;
123
        end if;
124
end process;
125
 
126
end mulfactor;

powered by: WebSVN 2.1.0

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