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

Subversion Repositories versatile_fft

[/] [versatile_fft/] [trunk/] [multiple_units/] [src/] [icpx_mul_d3.vhd] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 wzab
-------------------------------------------------------------------------------
2
-- Title      : Multiplier used to multiply the input sample by the value of
3
--              a window function
4
-- Project    : 
5
-------------------------------------------------------------------------------
6
-- File       : icpx_mul.vhd
7
-- Author     : Wojciech Zabolotny
8
-- Company    : 
9
-- License    : BSD
10
-- Created    : 2014-01-19
11
-- Last update: 2014-05-02
12
-- Platform   : 
13
-- Standard   : VHDL'93
14
-------------------------------------------------------------------------------
15
-- Description: Multiplier with latency of 3 clk
16
-------------------------------------------------------------------------------
17
-- Copyright (c) 2014 
18
-------------------------------------------------------------------------------
19
-- Revisions  :
20
-- Date        Version  Author  Description
21
-- 2014-01-19  1.0      wzab    Created
22
-------------------------------------------------------------------------------
23
library ieee;
24
use ieee.std_logic_1164.all;
25
use ieee.numeric_std.all;
26
use ieee.math_complex.all;
27
library work;
28
use work.fft_len.all;
29
use work.icpx.all;
30
-------------------------------------------------------------------------------
31
 
32
 
33
entity icpx_mul is
34
  generic (
35
    MULT_LATENCY : integer := 1);
36
  port (
37
    -- Input data
38
    din0  : in  icpx_number;
39
    din1  : in  icpx_number;
40
    -- Output data: real and imaginary parts
41
    dout : out icpx_number;
42
    -- clock
43
    rst_n : in std_logic;
44
    clk : in std_logic
45
    );
46
 
47
end icpx_mul;
48
 
49
architecture beh1 of icpx_mul is
50
  signal sout1r, sout1r_a, sout1r_b, sout1i, sout1i_a, sout1i_b : signed(2*ICPX_WIDTH-1 downto 0);
51
  signal s_din0, s_din1, s_out : icpx_number;
52
begin  -- beh1
53
 
54
  -- Multiple the values
55
 
56
 
57
  -- Now we drop the lower bits
58
  -- Delay the result to allow more efficient, pipelined implementation
59
  -- (Register balancing in the synthesis tools should do the rest...)
60
  process (clk, rst_n) is
61
  begin  -- process
62
    if rst_n = '0' then
63
      sout1r <= (others => '0');
64
      sout1r_a <= (others => '0');
65
      sout1r_b <= (others => '0');
66
      sout1i <= (others => '0');
67
      sout1i_a <= (others => '0');
68
      sout1i_b <= (others => '0');
69
      s_din0 <= icpx_zero;
70
      s_din1 <= icpx_zero;
71
    elsif clk'event and clk = '1' then  -- rising clock edge
72
      -- delayed by 1 clk
73
      s_din0 <= din0;
74
      s_din1 <= din1;
75
      -- delayed by 2 clk
76
      sout1r_a <= s_din0.re * s_din1.re;
77
      sout1r_b <= s_din0.im * s_din1.im;
78
      sout1i_a <= s_din0.re * s_din1.im;
79
      sout1i_b <= s_din0.im * s_din1.re;
80
      -- delayed by 3 clk
81
      sout1r <= (sout1r_a - sout1r_b);
82
      sout1i <= (sout1i_a + sout1i_b);
83
    end if;
84
  end process;
85
  s_out.re <= resize(sout1r(2*ICPX_WIDTH-2 downto ICPX_WIDTH-2),ICPX_WIDTH);
86
  s_out.im <= resize(sout1i(2*ICPX_WIDTH-2 downto ICPX_WIDTH-2),ICPX_WIDTH);
87
  dout <= s_out;
88
end beh1;
89
 

powered by: WebSVN 2.1.0

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