entity address_decoder is
PORT(address : in STD_LOGIC_VECTOR ( 0 to 3 );
decoded_address : out integer range 0 to 15);
end address_decoder;
architecture dataflow of address_decoder is
begin
PROCESS(address)
begin
if address = "0000" then decoded_address <= '0';
elsif address = "0001" then decoded_address <= '1';
elsif address = "0010" then decoded_address <= '2';
elsif address = "0011" then decoded_address <= '3';
elsif address = "0100" then decoded_address <= '4';
这是即将到来的错误
错误:HDLParsers:800 decoded_address 类型与“0”类型不兼容。错误:HDLParsers:800 decoded_address 类型与“1”类型不兼容。错误:HDLParsers:800 decoded_address 类型与“2”类型不兼容。错误:HDLParsers:800 decoded_address 类型与“3”类型不兼容。错误:HDLParsers:800 decoded_address 类型与“4”类型不兼容。
是不是因为address和decoded_address是两种不同的数据类型?关于如何摆脱这个错误的任何想法?