📄 chien9.vhd
字号:
--------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 21:33:14 04/09/08
-- Design Name:
-- Module Name: chien9 - Behavioral
-- Project Name:
-- Target Device:
-- Tool versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
--------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity chien9 is
port
(
clk:in std_logic;
reset:in std_logic;
en_all:in std_logic;
en_sel:in std_logic;
err_pol:in std_logic_vector(12 downto 0);
product1:out std_logic_vector(12 downto 0);
product2:out std_logic_vector(12 downto 0);
product3:out std_logic_vector(12 downto 0);
product4:out std_logic_vector(12 downto 0);
product5:out std_logic_vector(12 downto 0);
product6:out std_logic_vector(12 downto 0);
product7:out std_logic_vector(12 downto 0);
product8:out std_logic_vector(12 downto 0)
);
end chien9;
architecture Behavioral of chien9 is
component mul9
port(
mul9_in:in std_logic_vector(12 downto 0);
mul9_out:out std_logic_vector(12 downto 0)
);
end component;
component mul18
port(
mul18_in:in std_logic_vector(12 downto 0);
mul18_out:out std_logic_vector(12 downto 0)
);
end component;
component mul27
port(
mul27_in:in std_logic_vector(12 downto 0);
mul27_out:out std_logic_vector(12 downto 0)
);
end component;
component mul36
port(
mul36_in:in std_logic_vector(12 downto 0);
mul36_out:out std_logic_vector(12 downto 0)
);
end component;
component mul45
port(
mul45_in:in std_logic_vector(12 downto 0);
mul45_out:out std_logic_vector(12 downto 0)
);
end component;
component mul54
port(
mul54_in:in std_logic_vector(12 downto 0);
mul54_out:out std_logic_vector(12 downto 0)
);
end component;
component mul63
port(
mul63_in:in std_logic_vector(12 downto 0);
mul63_out:out std_logic_vector(12 downto 0)
);
end component;
component mul72
port(
mul72_in:in std_logic_vector(12 downto 0);
mul72_out:out std_logic_vector(12 downto 0)
);
end component;
component mul4145
port(
mul4145_in:in std_logic_vector(12 downto 0);
mul4145_out:out std_logic_vector(12 downto 0)
);
end component;
signal d:std_logic_vector(12 downto 0);
signal product1_tmp:std_logic_vector(12 downto 0);
signal product2_tmp:std_logic_vector(12 downto 0);
signal product3_tmp:std_logic_vector(12 downto 0);
signal product4_tmp:std_logic_vector(12 downto 0);
signal product5_tmp:std_logic_vector(12 downto 0);
signal product6_tmp:std_logic_vector(12 downto 0);
signal product7_tmp:std_logic_vector(12 downto 0);
signal product8_tmp:std_logic_vector(12 downto 0);
signal sel_tmp:std_logic_vector(12 downto 0);
signal err_pol_m:std_logic_vector(12 downto 0);
--signal cnt:integer range 1000 downto 0;
--signal en_sel: std_logic;
begin
d_pro:
process(clk,reset)
begin
if(reset='1')then
d<=(others=>'0');
elsif(clk'event and clk='1')then
if(en_all='1')then
d<=product8_tmp;
end if;
end if;
end process;
mul4145_pro:
mul4145
port map
(
mul4145_in=>err_pol,
mul4145_out=>err_pol_m
);
sel_pro:
process(clk)
begin
if(en_all='1')then
if(en_sel='0')then
sel_tmp<=d;
else
sel_tmp<=err_pol_m;
end if;
end if;
end process;
mul9_pro:
mul9
port map
(
mul9_in=>sel_tmp,
mul9_out=>product1_tmp
);
mul18_pro:
mul18
port map
(
mul18_in=>sel_tmp,
mul18_out=>product2_tmp
);
mul27_pro:
mul27
port map
(
mul27_in=>sel_tmp,
mul27_out=>product3_tmp
);
mul36_pro:
mul36
port map
(
mul36_in=>sel_tmp,
mul36_out=>product4_tmp
);
mul45_pro:
mul45
port map
(
mul45_in=>sel_tmp,
mul45_out=>product5_tmp
);
mul54_pro:
mul54
port map
(
mul54_in=>sel_tmp,
mul54_out=>product6_tmp
);
mul63_pro:
mul63
port map
(
mul63_in=>sel_tmp,
mul63_out=>product7_tmp
);
mul72_pro:
mul72
port map
(
mul72_in=>sel_tmp,
mul72_out=>product8_tmp
);
product1<=product1_tmp;
product2<=product2_tmp;
product3<=product3_tmp;
product4<=product4_tmp;
product5<=product5_tmp;
product6<=product6_tmp;
product7<=product7_tmp;
product8<=product8_tmp;
--cnt_pro:
-- process(clk,reset)
-- begin
-- if(reset='1')then
-- cnt<=0;
-- elsif(clk'event and clk='1')then
-- if(en_all='1')then
-- if cnt=511 then -- *
-- cnt<=0; --*
-- else
-- cnt<=cnt+1;
-- end if;
-- end if;
-- end if;
-- end process;
--
--
--sel_proc:
-- process(clk)
-- begin
-- if(clk'event and clk='1')then
-- if cnt=0 then ---*---
-- en_sel<='1';
-- else
-- en_sel<='0';
-- end if;
-- end if;
-- end process;
end Behavioral;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -