📄 multlib.vhd
字号:
component INVBLOCKport( GIN,PHI:in std_logic; GOUT:out std_logic);end component;component BLOCK2 port( PIN1,PIN2,GIN1,GIN2,PHI:in std_logic; POUT,GOUT:out std_logic);end component;component BLOCK2A port( PIN2,GIN1,GIN2,PHI:in std_logic; GOUT:out std_logic);end component;begin -- Architecture DBLC_1U1: for I in 0 to 1 generate U11: INVBLOCK port map(GIN(I),PHI,GOUT(I));end generate U1;U2: for I in 2 to 3 generate U21: BLOCK2A port map(PIN(I-2),GIN(I-2),GIN(I),PHI,GOUT(I));end generate U2;U3: for I in 4 to 64 generate U31: BLOCK2 port map(PIN(I-4),PIN(I-2),GIN(I-2),GIN(I),PHI,POUT(I-4),GOUT(I));end generate U3;end DBLC_1;-- The DBLC-tree: Level 2library ieee;use ieee.std_logic_1164.all;architecture DBLC_2 of DBLC_2_64 iscomponent INVBLOCKport( GIN,PHI:in std_logic; GOUT:out std_logic);end component;component BLOCK1port( PIN1,PIN2,GIN1,GIN2,PHI:in std_logic; POUT,GOUT:out std_logic);end component;component BLOCK1A port( PIN2,GIN1,GIN2,PHI:in std_logic; GOUT:out std_logic);end component;begin -- Architecture DBLC_2U1: for I in 0 to 3 generate U11: INVBLOCK port map(GIN(I),PHI,GOUT(I));end generate U1;U2: for I in 4 to 7 generate U21: BLOCK1A port map(PIN(I-4),GIN(I-4),GIN(I),PHI,GOUT(I));end generate U2;U3: for I in 8 to 64 generate U31: BLOCK1 port map(PIN(I-8),PIN(I-4),GIN(I-4),GIN(I),PHI,POUT(I-8),GOUT(I));end generate U3;end DBLC_2;-- The DBLC-tree: Level 3library ieee;use ieee.std_logic_1164.all;architecture DBLC_3 of DBLC_3_64 iscomponent INVBLOCKport( GIN,PHI:in std_logic; GOUT:out std_logic);end component;component BLOCK2 port( PIN1,PIN2,GIN1,GIN2,PHI:in std_logic; POUT,GOUT:out std_logic);end component;component BLOCK2A port( PIN2,GIN1,GIN2,PHI:in std_logic; GOUT:out std_logic);end component;begin -- Architecture DBLC_3U1: for I in 0 to 7 generate U11: INVBLOCK port map(GIN(I),PHI,GOUT(I));end generate U1;U2: for I in 8 to 15 generate U21: BLOCK2A port map(PIN(I-8),GIN(I-8),GIN(I),PHI,GOUT(I));end generate U2;U3: for I in 16 to 64 generate U31: BLOCK2 port map(PIN(I-16),PIN(I-8),GIN(I-8),GIN(I),PHI,POUT(I-16),GOUT(I));end generate U3;end DBLC_3;-- The DBLC-tree: Level 4library ieee;use ieee.std_logic_1164.all;architecture DBLC_4 of DBLC_4_64 iscomponent INVBLOCKport( GIN,PHI:in std_logic; GOUT:out std_logic);end component;component BLOCK1port( PIN1,PIN2,GIN1,GIN2,PHI:in std_logic; POUT,GOUT:out std_logic);end component;component BLOCK1A port( PIN2,GIN1,GIN2,PHI:in std_logic; GOUT:out std_logic);end component;begin -- Architecture DBLC_4U1: for I in 0 to 15 generate U11: INVBLOCK port map(GIN(I),PHI,GOUT(I));end generate U1;U2: for I in 16 to 31 generate U21: BLOCK1A port map(PIN(I-16),GIN(I-16),GIN(I),PHI,GOUT(I));end generate U2;U3: for I in 32 to 64 generate U31: BLOCK1 port map(PIN(I-32),PIN(I-16),GIN(I-16),GIN(I),PHI,POUT(I-32),GOUT(I));end generate U3;end DBLC_4;-- The DBLC-tree: Level 5library ieee;use ieee.std_logic_1164.all;architecture DBLC_5 of DBLC_5_64 iscomponent INVBLOCKport( GIN,PHI:in std_logic; GOUT:out std_logic);end component;component BLOCK2 port( PIN1,PIN2,GIN1,GIN2,PHI:in std_logic; POUT,GOUT:out std_logic);end component;component BLOCK2A port( PIN2,GIN1,GIN2,PHI:in std_logic; GOUT:out std_logic);end component;begin -- Architecture DBLC_5U1: for I in 0 to 31 generate U11: INVBLOCK port map(GIN(I),PHI,GOUT(I));end generate U1;U2: for I in 32 to 63 generate U21: BLOCK2A port map(PIN(I-32),GIN(I-32),GIN(I),PHI,GOUT(I));end generate U2;U3: for I in 64 to 64 generate U31: BLOCK2 port map(PIN(I-64),PIN(I-32),GIN(I-32),GIN(I),PHI,POUT(I-64),GOUT(I));end generate U3;end DBLC_5;library ieee;use ieee.std_logic_1164.all;architecture XORSTAGE of XORSTAGE_64 iscomponent XXOR1port( A,B,GIN,PHI:in std_logic; SUM:out std_logic);end component;component BLOCK1A port( PIN2,GIN1,GIN2,PHI:in std_logic; GOUT:out std_logic);end component;begin -- XORSTAGEU2:for I in 0 to 63 generate U22: XXOR1 port map(A(I),B(I),CARRY(I),PHI,SUM(I));end generate U2;U1: BLOCK1A port map(PBIT,CARRY(0),CARRY(64),PHI,COUT);end XORSTAGE;-- The DBLC-tree: All levels encapsulatedlibrary ieee;use ieee.std_logic_1164.all;architecture DBLCTREE of DBLCTREE_64 iscomponent DBLC_0_64port( PIN: in std_logic_vector(0 to 63); GIN: in std_logic_vector(0 to 64); PHI: in std_logic; POUT: out std_logic_vector(0 to 62); GOUT: out std_logic_vector(0 to 64));end component;component DBLC_1_64port( PIN: in std_logic_vector(0 to 62); GIN: in std_logic_vector(0 to 64); PHI: in std_logic; POUT: out std_logic_vector(0 to 60); GOUT: out std_logic_vector(0 to 64));end component;component DBLC_2_64port( PIN: in std_logic_vector(0 to 60); GIN: in std_logic_vector(0 to 64); PHI: in std_logic; POUT: out std_logic_vector(0 to 56); GOUT: out std_logic_vector(0 to 64));end component;component DBLC_3_64port( PIN: in std_logic_vector(0 to 56); GIN: in std_logic_vector(0 to 64); PHI: in std_logic; POUT: out std_logic_vector(0 to 48); GOUT: out std_logic_vector(0 to 64));end component;component DBLC_4_64port( PIN: in std_logic_vector(0 to 48); GIN: in std_logic_vector(0 to 64); PHI: in std_logic; POUT: out std_logic_vector(0 to 32); GOUT: out std_logic_vector(0 to 64));end component;component DBLC_5_64port( PIN: in std_logic_vector(0 to 32); GIN: in std_logic_vector(0 to 64); PHI: in std_logic; POUT: out std_logic_vector(0 to 0); GOUT: out std_logic_vector(0 to 64));end component;signal INTPROP_0: std_logic_vector(0 to 62);signal INTGEN_0: std_logic_vector(0 to 64);signal INTPROP_1: std_logic_vector(0 to 60);signal INTGEN_1: std_logic_vector(0 to 64);signal INTPROP_2: std_logic_vector(0 to 56);signal INTGEN_2: std_logic_vector(0 to 64);signal INTPROP_3: std_logic_vector(0 to 48);signal INTGEN_3: std_logic_vector(0 to 64);signal INTPROP_4: std_logic_vector(0 to 32);signal INTGEN_4: std_logic_vector(0 to 64);begin -- Architecture DBLCTREEU_0: DBLC_0_64 port map(PIN=>PIN,GIN=>GIN,PHI=>PHI,POUT=>INTPROP_0,GOUT=>INTGEN_0);U_1: DBLC_1_64 port map(PIN=>INTPROP_0,GIN=>INTGEN_0,PHI=>PHI,POUT=>INTPROP_1,GOUT=>INTGEN_1);U_2: DBLC_2_64 port map(PIN=>INTPROP_1,GIN=>INTGEN_1,PHI=>PHI,POUT=>INTPROP_2,GOUT=>INTGEN_2);U_3: DBLC_3_64 port map(PIN=>INTPROP_2,GIN=>INTGEN_2,PHI=>PHI,POUT=>INTPROP_3,GOUT=>INTGEN_3);U_4: DBLC_4_64 port map(PIN=>INTPROP_3,GIN=>INTGEN_3,PHI=>PHI,POUT=>INTPROP_4,GOUT=>INTGEN_4);U_5: DBLC_5_64 port map(PIN=>INTPROP_4,GIN=>INTGEN_4,PHI=>PHI,POUT=>POUT,GOUT=>GOUT);end DBLCTREE;library ieee;use ieee.std_logic_1164.all;architecture DBLCADDER of DBLCADDER_64_64 iscomponent PRESTAGE_64port( A: in std_logic_vector(0 to 63); B: in std_logic_vector(0 to 63); CIN: in std_logic; PHI: in std_logic; POUT: out std_logic_vector(0 to 63); GOUT: out std_logic_vector(0 to 64));end component;component DBLCTREE_64port( PIN:in std_logic_vector(0 to 63); GIN:in std_logic_vector(0 to 64); PHI:in std_logic; GOUT:out std_logic_vector(0 to 64); POUT:out std_logic_vector(0 to 0));end component;component XORSTAGE_64port( A: in std_logic_vector(0 to 63); B: in std_logic_vector(0 to 63); PBIT: in std_logic; PHI: in std_logic; CARRY: in std_logic_vector(0 to 64); SUM: out std_logic_vector(0 to 63); COUT: out std_logic);end component;signal INTPROP: std_logic_vector(0 to 63);signal INTGEN: std_logic_vector(0 to 64);signal PBIT:std_logic_vector(0 to 0);signal CARRY: std_logic_vector(0 to 64);begin -- Architecture DBLCADDERU1: PRESTAGE_64 port map(OPA,OPB,CIN,PHI,INTPROP,INTGEN);U2: DBLCTREE_64 port map(INTPROP,INTGEN,PHI,CARRY,PBIT);U3: XORSTAGE_64 port map(OPA(0 to 63),OPB(0 to 63),PBIT(0),PHI,CARRY(0 to 64),SUM,COUT);end DBLCADDER;-------------------------------------------------------------- END: Architectures used with the DBLC adder------------------------------------------------------------library ieee;use ieee.std_logic_1164.all;entity XXOR2 isport( A,B,GIN,PHI:in std_logic; SUM:out std_logic);end XXOR2;library ieee;use ieee.std_logic_1164.all;architecture XXOR_true of XXOR2 isbegin SUM <= (A xor B) xor GIN;end XXOR_true;---- Modgen adder created Fri Aug 16 14:47:23 2002--library ieee;use ieee.std_logic_1164.all;entity DBLCADDER_32_32 isport( OPA:in std_logic_vector(0 to 31); OPB:in std_logic_vector(0 to 31); CIN:in std_logic; PHI:in std_logic; SUM:out std_logic_vector(0 to 31); COUT:out std_logic);end DBLCADDER_32_32;library ieee;use ieee.std_logic_1164.all;entity DBLC_0_32 isport( PIN: in std_logic_vector(0 to 31); GIN: in std_logic_vector(0 to 32); PHI: in std_logic; POUT: out std_logic_vector(0 to 30); GOUT: out std_logic_vector(0 to 32));end DBLC_0_32;library ieee;use ieee.std_logic_1164.all;entity DBLC_1_32 isport( PIN: in std_logic_vector(0 to 30); GIN: in std_logic_vector(0 to 32); PHI: in std_logic; POUT: out std_logic_vector(0 to 28); GOUT: out std_logic_vector(0 to 32));end DBLC_1_32;library ieee;use ieee.std_logic_1164.all;entity DBLC_2_32 isport( PIN: in std_logic_vector(0 to 28); GIN: in std_logic_vector(0 to 32); PHI: in std_logic; POUT: out std_logic_vector(0 to 24); GOUT: out std_logic_vector(0 to 32));end DBLC_2_32;library ieee;use ieee.std_logic_1164.all;entity DBLC_3_32 isport( PIN: in std_logic_vector(0 to 24); GIN: in std_logic_vector(0 to 32); PHI: in std_logic; POUT: out std_logic_vector(0 to 16); GOUT: out std_logic_vector(0 to 32));end DBLC_3_32;library ieee;use ieee.std_logic_1164.all;entity DBLC_4_32 isport( PIN: in std_logic_vector(0 to 16); GIN: in std_logic_vector(0 to 32); PHI: in std_logic; POUT: out std_logic_vector(0 to 0); GOUT: out std_logic_vector(0 to 32));end DBLC_4_32;library ieee;use ieee.std_logic_1164.all;architecture DBLC_0 of DBLC_0_32 iscomponent INVBLOCKport( GIN,PHI:in std_logic; GOUT:out std_logic);end component;component BLOCK1port( PIN1,PIN2,GIN1,GIN2,PHI:in std_logic; POUT,GOUT:out std_logic);end component;component BLOCK1A port( PIN2,GIN1,GIN2,PHI:in std_logic; GOUT:out std_logic);end component;begin -- Architecture DBLC_0U1: for I in 0 to 0 generate U11: INVBLOCK port map(GIN(I),PHI,GOUT(I));end generate U1;U2: for I in 1 to 1 generate U21: BLOCK1A port map(PIN(I-1),GIN(I-1),GIN(I),PHI,GOUT(I));end generate U2;U3: for I in 2 to 32 generate U31: BLOCK1 port map(PIN(I-2),PIN(I-1),GIN(I-1),GIN(I),PHI,POUT(I-2),GOUT(I));end generate U3;end DBLC_0;-- The DBLC-tree: Level 1library ieee;use ieee.std_logic_1164.all;architecture DBLC_1 of DBLC_1_32 iscomponent INVBLOCKport( GIN,PHI:in std_logic; GOUT:out std_logic);end component;component BLOCK2 port( PIN1,PIN2,GIN1,GIN2,PHI:in std_logic; POUT,GOUT:out std_logic);end component;component BLOCK2A port( PIN2,GIN1,GIN2,PHI:in std_logic; GOUT:out std_logic);end component;begin -- Architecture DBLC_1U1: for I in 0 to 1 generate U11: INVBLOCK port map(GIN(I),PHI,GOUT(I));end generate U1;U2: for I in 2 to 3 generate U21: BLOCK2A port map(PIN(I-2),GIN(I-2),GIN(I),PHI,GOUT(I));end generate U2;U3: for I in 4 to 32 generate U31: BLOCK2 port map(PIN(I-4),PIN(I-2),GIN(I-2),GIN(I),PHI,POUT(I-4),GOUT(I));end generate U3;end DBLC_1;-- The DBLC-tree: Level 2library ieee;use ieee.std_logic_1164.all;architecture DBLC_2 of DBLC_2_32 iscomponent INVBLOCKport( GIN,PHI:in std_logic; GOUT:out std_logic);end component;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -