我刚刚用VHDL练习了一个基本程序,不断出现三个错误,似乎没有找到解决方案。这三个错误是:
10028无法解析网络"的多个常量驱动程序;O〃;疑问4.vhd(16(10029问题中的常量驱动程序4.vhd(15(12153无法详细说明顶级用户层次
我使用的代码:
library IEEE;
use IEEE.std_logic_1164.all
entity question4 is
port(
E : in std_logic;
I : in std_logic_vector(3 downto 0);
O : out std_logic);
end question4;
architecture st1 of question4 is
begin
O <= '0' when E = '0';
O <= I(0) or I(1) or ((not I(2)) and (not I(3))) when E = '1';
end st1;
正确的语法如下:
library IEEE;
use IEEE.std_logic_1164.all
entity question4 is
port(
E : in std_logic;
I : in std_logic_vector(3 downto 0);
O : out std_logic);
end question4;
architecture st1 of question4 is
begin
O <= I(0) or I(1) or ((not I(2)) and (not I(3))) when E = '1' else '0';
end st1;