vhdl文件为什么会编译不成功,总说一个结构体没有定义?
LIBRARYieee;USEieee.std_logic_1164.all;ENTITYand2ISPORT(i1,i2:instd_logic;o1:outstd_l...
LIBRARY ieee;USE ieee.std_logic_1164.all;
ENTITY and2 IS PORT (i1,i2:in std_logic; o1:out std_logic);END and2;
ARCHITECTURE dataflow OF and2 ISBEGIN o1<=i1 and i2;END dataflow;
LIBRARY ieee;USE ieee.std_logic_1164.all;
ENTITY xor3 IS PORT (i1,i2:in std_logic; o1:out std_logic);END xor3;
ARCHITECTURE dataflow OF xor3 ISBEGIN o1<=i1 xor i2;END dataflow;
LIBRARY ieee;USE ieee.std_logic_1164.all;
ENTITY half_adder IS PORT(a,b:in std_logic; sum,carry_out:out std_logic);END half_adder;ARCHITECTURE structure OF half_adder IS
BEGIN u1:ENTITY xor3 PORT MAP(i1=>a,i2=>b,o1=>sum); u1:ENTITY and2 PORT MAP(i1=>a,i2=>b,o1=>carry_out);END structure;
我不明白为什么这样将主程序与子程序写在一起,还是一直失败呢在实验好多次之后? 展开
ENTITY and2 IS PORT (i1,i2:in std_logic; o1:out std_logic);END and2;
ARCHITECTURE dataflow OF and2 ISBEGIN o1<=i1 and i2;END dataflow;
LIBRARY ieee;USE ieee.std_logic_1164.all;
ENTITY xor3 IS PORT (i1,i2:in std_logic; o1:out std_logic);END xor3;
ARCHITECTURE dataflow OF xor3 ISBEGIN o1<=i1 xor i2;END dataflow;
LIBRARY ieee;USE ieee.std_logic_1164.all;
ENTITY half_adder IS PORT(a,b:in std_logic; sum,carry_out:out std_logic);END half_adder;ARCHITECTURE structure OF half_adder IS
BEGIN u1:ENTITY xor3 PORT MAP(i1=>a,i2=>b,o1=>sum); u1:ENTITY and2 PORT MAP(i1=>a,i2=>b,o1=>carry_out);END structure;
我不明白为什么这样将主程序与子程序写在一起,还是一直失败呢在实验好多次之后? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询