|
下面的结构体描述加了配置指定,因而元件模板的名字可以与设计实体的名字不同: architecture Struc of Full_Adder is signal Temp_Sum: BIT; signal Temp_Carry_1, Temp_Carry_2: BIT; component Hadd port(a1, a2: in BIT; S, C: out BIT); end component; component OR2 port(in1, in2: in BIT; out1: out BIT); end component; for HADD1, HADD2: Hadd use entity Half_Adder(A1); begin HADD1: Hadd port map (A, B, Temp_Sum, Temp_Carry_1); HADD2: Hadd port map (Temp_Sum, Carry_In, Sum, Temp_Carry_1); U3: OR2 port map (Temp_Carry_1, Temp_Carry_2, Carry_Out); end Struc;
|