⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tx_halfband_compmul.vhd

📁 基于XILINX ISE下的数字上变频设计
💻 VHD
字号:
----------------------------------------------------
--	Copyright (C), 2005-2006, CETC27 & WMC.EE.TSINGHUA
--	File name:      compxmul
--	Test Bench File:	compxmul_tb
--	Author:	Zhao Pengkai			Date: 2005-7-20
--	Description:    Complex Data Multiplexer    ReRes+i*ImRes=(I1+i*Q1)*(I2+i*Q2)/2

--	Process&Component List:  // 主要Process与Component列表,每条记录应包括Process与Component名及功能简要说明--    1. mul  乘法器--    2. mul_add  乘法+加法器--    3. mul_sub  乘法+减法器
--	Input:          Clk  时钟--  				 In_En  输入使能--                   I1  Q1   数据1
--                   I2  Q2   数据2

--	Output:         ReRes  输出实部--                   ImRes  输出虚部
--	History:		// 修改历史记录列表,每条修改记录应包括修改日期、修改--                  // 者及修改内容简述  
--	Date         By            Description
--				   Create					
----------------------------------------------------

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

--Library XilinxCoreLib;

--  Uncomment the following lines to use the declarations that are
--  provided for instantiating Xilinx primitive components.


entity Tx_Halfband_Compmul is
port ( 
      Clk    :        in std_logic;
	  In_En  :        in std_logic;
	  Out_En :        out std_logic;
	  I1     :        in std_logic_vector(15 downto 0);
	  Q1     :        in std_logic_vector(15 downto 0);
	  I2     :        in std_logic_vector(13 downto 0);
	  Q2     :        in std_logic_vector(13 downto 0);
	  ReRes  :        out std_logic_vector(15 downto 0);  
	  ImRes  :        out std_logic_vector(15 downto 0));
end Tx_Halfband_Compmul;

architecture Behavioral of Tx_Halfband_Compmul is

signal cin_add, cin_sub 	: std_logic_vector(47 downto 0);
signal ReRes_Tp,ImRes_Tp : std_logic_vector(47 downto 0);

component comp_mul
   port ( A_IN      : in    std_logic_vector (15 downto 0); 
          B_IN      : in    std_logic_vector (13 downto 0); 
          CEM_IN    : in    std_logic; 
          CLK_IN    : in    std_logic; 
          C_IN      : in    std_logic_vector (47 downto 0); 
          PCOUT_OUT : out   std_logic_vector (47 downto 0); 
          P_OUT     : out   std_logic_vector (47 downto 0));
end component;


component comp_mul_add
   port ( A_IN    : in    std_logic_vector (15 downto 0); 
          B_IN    : in    std_logic_vector (13 downto 0); 
          CEM_IN  : in    std_logic; 
          CLK_IN  : in    std_logic; 
          PCIN_IN : in    std_logic_vector (47 downto 0); 
          P_OUT   : out   std_logic_vector (47 downto 0));
end component;

component comp_mul_sub
   port ( A_IN    : in    std_logic_vector (15 downto 0); 
          B_IN    : in    std_logic_vector (13 downto 0); 
          CEM_IN  : in    std_logic; 
          CLK_IN  : in    std_logic; 
          PCIN_IN : in    std_logic_vector (47 downto 0); 
          P_OUT   : out   std_logic_vector (47 downto 0));
end component;

begin

ReRes <= ReRes_Tp(27 downto 12);
ImRes <= ImRes_Tp(27 downto 12);
--ReRes <= ReRes_Tp(28 downto 13);
--ImRes <= ImRes_Tp(28 downto 13);


   mul_I1I2:    comp_mul
   PORT MAP ( 
   		A_IN=>I1, 
          B_IN=>I2, 
          CEM_IN => In_En,
          CLK_IN=>Clk, 
		  C_IN => (others=>'0'),
          PCOUT_OUT=>cin_sub
		);
 
   mul_I1Q2:    comp_mul
   PORT MAP (
   		A_IN=>I1, 
          B_IN=>Q2, 
          CEM_IN => In_En,
          CLK_IN=>Clk, 
		  C_IN => (others=>'0'),
          PCOUT_OUT=>cin_add
		);

    mulsub:   comp_mul_sub
   PORT MAP ( A_IN=> Q1, 
          B_IN=> Q2,
          CEM_IN => In_En,
          CLK_IN=> Clk, 
          PCIN_IN=> cin_sub, 
          P_OUT=>ReRes_Tp);

	muladd:   comp_mul_add
   PORT MAP ( A_IN=>Q1, 
          B_IN=>I2,
          CEM_IN => In_En,
          CLK_IN=>Clk, 
          PCIN_IN=>cin_add, 
          P_OUT=>ImRes_Tp);


process ( Clk )
begin
	if (Clk'event and Clk='1') then
		Out_En<=In_En;
	end if;
end process;		

end Behavioral;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -