📄 dct8_final.txt
字号:
--signal comptemp : unsigned(1 downto 0);
signal ap : unsigned(11 downto 0) := "010110101000";
signal bp : unsigned(11 downto 0) := "011101100100";
signal cp : unsigned(11 downto 0) := "001100010000";
signal dp : unsigned(11 downto 0) := "011111011001";
signal ep : unsigned(11 downto 0) := "011010100111";
signal fp : unsigned(11 downto 0) := "010001110010";
signal gp : unsigned(11 downto 0) := "000110010000";
signal am : unsigned(11 downto 0) := "101001011000";
signal bm : unsigned(11 downto 0) := "100010011100";
signal cm : unsigned(11 downto 0) := "110011110000";
signal dm : unsigned(11 downto 0) := "100000100111";
signal em : unsigned(11 downto 0) := "100101011001"; -- NOT used
signal fm : unsigned(11 downto 0) := "101110001110";
signal gm : unsigned(11 downto 0) := "111001110000";
BEGIN
coeff(0) <= gp; -- G
coeff(1) <= fm; -- -F
coeff(2) <= ep; -- E
coeff(3) <= dm; -- -D
-- Complementary values
coeff(4) <= gm; -- -G
coeff(5) <= fp; -- F
coeff(6) <= em; -- -E
coeff(7) <= dp; -- D
--comptemp <= CONV_UNSIGNED(compl,2);
--addr <= CONV_INTEGER(comptemp&addr2);
addr <= CONV_INTEGER(compl&addr2);
--with enable_rom select
-- coeff_out <= "000000000000" when '0',
-- coeff(addr) when '1',
-- "000000000000" when others;
with enable_rom select
coeff_out <= coeff(addr) when '1',
"000000000000" when others;
END beh;
--
--
LIBRARY ieee ;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY MACX00 IS
PORT(
addr2 : IN unsigned (1 DOWNTO 0) ;
clk : IN std_ulogic ;
clk_1 : IN std_ulogic ;
clk_2 : IN std_ulogic ;
compl : IN std_ulogic ;
enable : IN std_ulogic ;
enable_1 : IN std_ulogic ;
enable_2 : IN std_ulogic ;
enable_rom : IN std_ulogic ;
aout_3 : OUT unsigned (13 DOWNTO 0)
);
-- Declarations
END MACX00 ;
--
--
LIBRARY ieee ;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_arith.ALL;
LIBRARY work;
ARCHITECTURE struct OF MACX00 IS
-- Architecture declarations
-- Internal signal declarations
SIGNAL Sout : unsigned(11 DOWNTO 0);
SIGNAL aout : unsigned(11 DOWNTO 0);
SIGNAL aout_1 : unsigned(12 DOWNTO 0);
SIGNAL aout_2 : unsigned(13 DOWNTO 0);
SIGNAL bin : unsigned(13 DOWNTO 0);
SIGNAL coeff_out : unsigned(11 downto 0);
SIGNAL output : unsigned(12 DOWNTO 0);
SIGNAL output_1 : unsigned(13 DOWNTO 0);
-- Component Declarations
COMPONENT ROM1C
PORT (
addr2 : IN unsigned (1 DOWNTO 0);
compl : IN std_ulogic ;
enable_rom : IN std_ulogic ;
coeff_out : OUT unsigned (11 downto 0)
);
END COMPONENT;
COMPONENT add12signed
PORT (
a : IN unsigned (11 DOWNTO 0);
b : IN unsigned (11 DOWNTO 0);
output : OUT unsigned (12 DOWNTO 0)
);
END COMPONENT;
COMPONENT add14signed
PORT (
ain : IN unsigned (13 DOWNTO 0);
bin : IN unsigned (13 DOWNTO 0);
output : OUT unsigned (13 DOWNTO 0)
);
END COMPONENT;
COMPONENT div2
PORT (
Sin : IN unsigned (12 downto 0);
Sout : OUT unsigned (11 downto 0)
);
END COMPONENT;
COMPONENT reg12b
PORT (
ain : IN unsigned (11 DOWNTO 0);
clk : IN std_ulogic ;
enable : IN std_ulogic ;
aout : OUT unsigned (11 DOWNTO 0)
);
END COMPONENT;
COMPONENT reg13b
PORT (
ain : IN unsigned (12 DOWNTO 0);
clk : IN std_ulogic ;
enable : IN std_ulogic ;
aout : OUT unsigned (12 DOWNTO 0)
);
END COMPONENT;
COMPONENT reg14b
PORT (
ain : IN unsigned (13 DOWNTO 0);
clk : IN std_ulogic ;
enable : IN std_ulogic ;
aout : OUT unsigned (13 DOWNTO 0)
);
END COMPONENT;
-- Optional embedded configurations
--synopsys translate_off
FOR ALL : ROM1C USE ENTITY work.ROM1C;
FOR ALL : add12signed USE ENTITY work.add12signed;
FOR ALL : add14signed USE ENTITY work.add14signed;
FOR ALL : div2 USE ENTITY work.div2;
FOR ALL : reg12b USE ENTITY work.reg12b;
FOR ALL : reg13b USE ENTITY work.reg13b;
FOR ALL : reg14b USE ENTITY work.reg14b;
--synopsys translate_on
BEGIN
-- Architecture concurrent statements
-- HDL Embedded Text Block 1 eb1
bin <= aout_1(12)&aout_1;
-- Instance port mappings.
I0 : ROM1C
PORT MAP (
addr2 => addr2,
compl => compl,
enable_rom => enable_rom,
coeff_out => coeff_out
);
I2 : add12signed
PORT MAP (
a => Sout,
b => aout,
output => output
);
I5 : add14signed
PORT MAP (
ain => aout_2,
bin => bin,
output => output_1
);
I4 : div2
PORT MAP (
Sin => aout_1,
Sout => Sout
);
I1 : reg12b
PORT MAP (
ain => coeff_out,
clk => clk,
enable => enable,
aout => aout
);
I3 : reg13b
PORT MAP (
ain => output,
clk => clk,
enable => enable,
aout => aout_1
);
I6 : reg14b
PORT MAP (
ain => output_1,
clk => clk_1,
enable => enable_1,
aout => aout_2
);
I7 : reg14b
PORT MAP (
ain => aout_2,
clk => clk_2,
enable => enable_2,
aout => aout_3
);
END struct;
--
--
LIBRARY ieee ;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY MACX01 IS
PORT(
addr2 : IN unsigned (1 DOWNTO 0) ;
clk : IN std_ulogic ;
clk_1 : IN std_ulogic ;
clk_2 : IN std_ulogic ;
compl : IN std_ulogic ;
enable : IN std_ulogic ;
enable_1 : IN std_ulogic ;
enable_2 : IN std_ulogic ;
enable_rom : IN std_ulogic ;
aout_3 : OUT unsigned (13 DOWNTO 0)
);
-- Declarations
END MACX01 ;
--
--
LIBRARY ieee ;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_arith.ALL;
LIBRARY work;
ARCHITECTURE struct OF MACX01 IS
-- Architecture declarations
-- Internal signal declarations
SIGNAL Sout : unsigned(11 DOWNTO 0);
SIGNAL aout : unsigned(11 DOWNTO 0);
SIGNAL aout_1 : unsigned(12 DOWNTO 0);
SIGNAL aout_2 : unsigned(13 DOWNTO 0);
SIGNAL bin : unsigned(13 DOWNTO 0);
SIGNAL coeff_out : unsigned(11 downto 0);
SIGNAL output : unsigned(12 DOWNTO 0);
SIGNAL output_1 : unsigned(13 DOWNTO 0);
-- Component Declarations
COMPONENT ROMC_01
PORT (
addr2 : IN unsigned (1 downto 0);
compl : IN std_ulogic ;
enable_rom : IN std_ulogic ;
coeff_out : OUT unsigned (11 DOWNTO 0)
);
END COMPONENT;
COMPONENT add12signed
PORT (
a : IN unsigned (11 DOWNTO 0);
b : IN unsigned (11 DOWNTO 0);
output : OUT unsigned (12 DOWNTO 0)
);
END COMPONENT;
COMPONENT add14signed
PORT (
ain : IN unsigned (13 DOWNTO 0);
bin : IN unsigned (13 DOWNTO 0);
output : OUT unsigned (13 DOWNTO 0)
);
END COMPONENT;
COMPONENT div2
PORT (
Sin : IN unsigned (12 downto 0);
Sout : OUT unsigned (11 downto 0)
);
END COMPONENT;
COMPONENT reg12b
PORT (
ain : IN unsigned (11 DOWNTO 0);
clk : IN std_ulogic ;
enable : IN std_ulogic ;
aout : OUT unsigned (11 DOWNTO 0)
);
END COMPONENT;
COMPONENT reg13b
PORT (
ain : IN unsigned (12 DOWNTO 0);
clk : IN std_ulogic ;
enable : IN std_ulogic ;
aout : OUT unsigned (12 DOWNTO 0)
);
END COMPONENT;
COMPONENT reg14b
PORT (
ain : IN unsigned (13 DOWNTO 0);
clk : IN std_ulogic ;
enable : IN std_ulogic ;
aout : OUT unsigned (13 DOWNTO 0)
);
END COMPONENT;
-- Optional embedded configurations
--synopsys translate_off
FOR ALL : ROMC_01 USE ENTITY work.ROMC_01;
FOR ALL : add12signed USE ENTITY work.add12signed;
FOR ALL : add14signed USE ENTITY work.add14signed;
FOR ALL : div2 USE ENTITY work.div2;
FOR ALL : reg12b USE ENTITY work.reg12b;
FOR ALL : reg13b USE ENTITY work.reg13b;
FOR ALL : reg14b USE ENTITY work.reg14b;
--synopsys translate_on
BEGIN
-- Architecture concurrent statements
-- HDL Embedded Text Block 2 eb2
bin <= aout_1(12)&aout_1;
-- Instance port mappings.
I0 : ROMC_01
PORT MAP (
addr2 => addr2,
compl => compl,
enable_rom => enable_rom,
coeff_out => coeff_out
);
I3 : add12signed
PORT MAP (
a => Sout,
b => aout,
output => output
);
I6 : add14signed
PORT MAP (
ain => aout_2,
bin => bin,
output => output_1
);
I5 : div2
PORT MAP (
Sin => aout_1,
Sout => Sout
);
I2 : reg12b
PORT MAP (
ain => coeff_out,
clk => clk,
enable => enable,
aout => aout
);
I4 : reg13b
PORT MAP (
ain => output,
clk => clk,
enable => enable,
aout => aout_1
);
I7 : reg14b
PORT MAP (
ain => output_1,
clk => clk_1,
enable => enable_1,
aout => aout_2
);
I8 : reg14b
PORT MAP (
ain => aout_2,
clk => clk_2,
enable => enable_2,
aout => aout_3
);
END struct;
--
--
LIBRARY ieee ;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
ENTITY MACX02 IS
PORT(
addr2 : IN unsigned (1 DOWNTO 0) ;
clk : IN std_ulogic ;
clk_1 : IN std_ulogic ;
clk_2 : IN std_ulogic ;
compl : IN std_ulogic ;
enable : IN std_ulogic ;
enable_1 : IN std_ulogic ;
enable_2 : IN std_ulogic ;
enable_rom : IN std_ulogic ;
aout_3 : OUT unsigned (13 DOWNTO 0)
);
-- Declarations
END MACX02 ;
--
--
LIBRARY ieee ;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_arith.ALL;
LIBRARY work;
ARCHITECTURE struct OF MACX02 IS
-- Architecture declarations
-- Internal signal declarations
SIGNAL Sout : unsigned(11 DOWNTO 0);
SIGNAL aout : unsigned(11 DOWNTO 0);
SIGNAL aout_1 : unsigned(12 DOWNTO 0);
SIGNAL aout_2 : unsigned(13 DOWNTO 0);
SIGNAL bin : unsigned(13 DOWNTO 0);
SIGNAL coeff_out : unsigned(11 downto 0);
SIGNAL output : unsigned(12 DOWNTO 0);
SIGNAL output_1 : unsigned(13 DOWNTO 0);
-- Component Declarations
COMPONENT ROMC_02
PORT (
addr2 : IN unsigned (1 DOWNTO 0);
compl : IN std_ulogic ;
enable_rom : IN std_ulogic ;
coeff_out : OUT unsigned (11 DOWNTO 0)
);
END COMPONENT;
COMPONENT add12signed
PORT (
a : IN unsigned (11 DOWNTO 0);
b : IN unsigned (11 DOWNTO 0);
output : OUT unsigned (12 DOWNTO 0)
);
END COMPONENT;
COMPONENT add14signed
PORT (
ain : IN unsigned (13 DOWNTO 0);
bin : IN unsigned (13 DOWNTO 0);
output : OUT unsigned (13 DOWNTO 0)
);
END COMPONENT;
COMPONENT div2
PORT (
Sin : IN unsigned (12 downto 0);
Sout : OUT unsigned (11 downto 0)
);
END COMPONENT;
COMPONENT reg12b
PORT (
ain : IN unsigned (11 DOWNTO 0);
clk : IN std_ulogic ;
enable : IN std_ulogic ;
aout : OUT unsigned (11 DOWNTO 0)
);
END COMPONENT;
COMPONENT reg13b
PORT (
ain : IN unsigned (12 DOWNTO 0);
clk : IN std_ulogic ;
enable : IN std_ulogic ;
aout : OUT unsigned (12 DOWNTO 0)
);
END COMPONENT;
COMPONENT reg14b
PORT (
ain : IN unsigned (13 DOWNTO 0);
clk : IN std_ulogic ;
enable : IN std_ulogic ;
aout : OUT unsigned (13 DOWNTO 0)
);
END COMPONENT;
-- Optional embedded configurations
--synopsys translate_off
FOR ALL : ROMC_02 USE ENTITY work.ROMC_02;
FOR ALL : add12signed USE ENTITY work.add12signed;
FOR ALL : add14signed USE ENTITY work.add14signed;
FOR ALL : div2 USE ENTITY work.div2;
FOR ALL : reg12b USE ENTITY work.reg12b;
FOR ALL : reg13b USE ENTITY work.reg13b;
FOR ALL : reg14b USE ENTITY work.reg14b;
--synopsys translate_on
BEGIN
-- Architecture concurrent statements
-- HDL Embedded Text Block 2 eb2
bin <= aout_1(12)&aout_1;
-- Instance port mappings.
I0 : ROMC_02
PORT MAP (
addr2 => addr2,
compl => compl,
enable_rom => enable_rom,
coeff_out => coeff_out
);
I3 : add12signed
PORT MAP (
a => Sout,
b => aout,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -