LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; entity adder is port( in1 : bit_vector; in2 : bit_vector; cnt1 : bit; pout : out bit_vector); end entity adder; architecture func of adder is begin process(cnt1) begin if(cnt1='1') then pout<=in1 + in2; end if; end process; end architecture func; 关于这个程序,发表一点愚见: 1.端口声明中只有输出说明了,其他三个没有定义输入/输出状态 2.bit_vector,没有声明宽度 先看到这些 |