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

Subversion Repositories pipelined_fft_256

[/] [pipelined_fft_256/] [trunk/] [SRC/] [mpuc707.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 unicore
/////////////////////////////////////////////////////////////////////
2
////                                                             ////
3
////  FFT/IFFT 256 points transform                              ////
4
////                                                             ////
5
////  Authors: Anatoliy Sergienko, Volodya Lepeha                ////
6
////  Company: Unicore Systems http://unicore.co.ua              ////
7
////                                                             ////
8
////  Downloaded from: http://www.opencores.org                  ////
9
////                                                             ////
10
/////////////////////////////////////////////////////////////////////
11
////                                                             ////
12
//// Copyright (C) 2006-2010 Unicore Systems LTD                 ////
13
//// www.unicore.co.ua                                           ////
14
//// o.uzenkov@unicore.co.ua                                     ////
15
////                                                             ////
16
//// This source file may be used and distributed without        ////
17
//// restriction provided that this copyright statement is not   ////
18
//// removed from the file and that any derivative work contains ////
19
//// the original copyright notice and the associated disclaimer.////
20
////                                                             ////
21
//// THIS SOFTWARE IS PROVIDED "AS IS"                           ////
22
//// AND ANY EXPRESSED OR IMPLIED WARRANTIES,                    ////
23
//// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED                  ////
24
//// WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT              ////
25
//// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.        ////
26
//// IN NO EVENT SHALL THE UNICORE SYSTEMS OR ITS                ////
27
//// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,            ////
28
//// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL            ////
29
//// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT         ////
30
//// OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,               ////
31
//// DATA, OR PROFITS; OR BUSINESS INTERRUPTION)                 ////
32
//// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,              ////
33
//// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT              ////
34
//// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING                 ////
35
//// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,                 ////
36
//// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.          ////
37
////                                                             ////
38
/////////////////////////////////////////////////////////////////////
39
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           
40
// DESCRIPTION  :        Complex Multiplier by 0.7071
41
// FUNCTION:               Constant multiplier
42
// FILES:                        MPU707.v
43
//  PROPERTIES: 1) Is based on shifts right and add
44
//                                                      2) for short input bit width 0.7071 is approximated as 10110101                            then rounding        is not used
45
//                                                      3) for long input bit width 0.7071 is approximated as 10110101000000101        
46
//                                                  4) hardware is 4 or 5 adders 
47
//                                                  5) MPYJ switches multiply by j                               
48
//                                                      6) A complex data is multiplied for 2 cycles
49
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50
`include "FFT256_CONFIG.inc"
51
 
52
module MPUC707 ( CLK,EI ,ED, MPYJ,DR,DI ,DOR ,DOI,  );
53
        `FFT256paramnb
54
 
55
        input CLK ;
56
        wire CLK ;
57
        input EI ;                                      //slowdown
58
        wire EI ;
59
        input ED;                                       //data strobe
60
        input MPYJ ;                            //the result is multiplied by -j
61
        wire MPYJ ;
62
        input [nb-1:0] DR ;
63
        wire signed [nb-1:0] DR ;
64
        input [nb-1:0] DI ;
65
        wire signed [nb-1:0] DI ;
66
 
67
        output [nb-1:0] DOR ;
68
        reg [nb-1:0] DOR ;
69
        output [nb-1:0] DOI ;
70
        reg [nb-1:0] DOI ;
71
 
72
        reg signed [nb+1 :0] dx5;
73
        reg signed      [nb : 0] dt;
74
        reg signed      [nb-1 : 0] dii;
75
        wire signed [nb+2 : 0]  dx5p;
76
        wire  signed  [nb+3 : 0] dot;
77
        reg edd,edd2, edd3;                     //delayed data enable impulse        
78
        reg mpyjd,mpyjd2,mpyjd3;
79
        reg [nb-1:0] doo ;
80
        reg [nb-1:0] droo ;
81
 
82
        always @(posedge CLK)
83
                begin
84
                        if (EI) begin
85
                                        edd<=ED;
86
                                        edd2<=edd;
87
                                        edd3<=edd2;
88
                                        mpyjd<=MPYJ;
89
                                        mpyjd2<=mpyjd;
90
                                        mpyjd3<=mpyjd2;
91
                                        if (ED)  begin
92
                                                        dx5<=DR+(DR <<2);        //multiply by 5 
93
                                                        dt<=DR;
94
                                                        dii<=DI;
95
                                                end
96
                                        else     begin
97
                                                        dx5<=dii+(dii <<2);      //multiply by 5
98
                                                        dt<=dii;
99
                                                end
100
                                        doo<=(dot >>>4) ;
101
                                        droo<=doo;
102
                                        if (edd3)
103
                                                if (mpyjd3) begin
104
                                                                DOR<=doo;
105
                                                        DOI<= - droo; end
106
                                                else begin
107
                                                                DOR<=droo;
108
                                                        DOI<=  doo; end
109
                                end
110
                end
111
 
112
        assign  dx5p=(dx5<<1)+(dx5>>>2);                // multiply by 101101                   
113
 
114
        `ifdef FFT256bitwidth_coef_high
115
        assign   dot=   dx5p+(dt>>>4)+(dx5>>>13);          // multiply by 10110101000000101           
116
        `else
117
        assign    dot=          dx5p+(dt>>>4)   ;  // multiply by 10110101         
118
        `endif
119
 
120
 
121
 
122
endmodule

powered by: WebSVN 2.1.0

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