Vhdl 如何修复[near&quo;then";:(vcom-1576)expecting==或&"x27&&"x27;或&"x27&&&"x27;或&"x27&&"x27&&"错误?
编译此代码后,我收到了3个相同的错误- **错误:C:/Modeltech\u pe\u edu\u 10.4a/examples/DECODER.vhd(24):接近“then”:(vcom-1576)应为==或“+”或“-”或“&” 我曾尝试在末尾添加“end if;”,但它给出了上述错误和以下错误- **错误:C:/Modeltech\u pe\u edu\u 10.4a/examples/DECODER.vhd(35):VHDL编译器正在退出Vhdl 如何修复[near&quo;then";:(vcom-1576)expecting==或&"x27&&"x27;或&"x27&&&"x27;或&"x27&&"x27&&"错误?,vhdl,Vhdl,编译此代码后,我收到了3个相同的错误- **错误:C:/Modeltech\u pe\u edu\u 10.4a/examples/DECODER.vhd(24):接近“then”:(vcom-1576)应为==或“+”或“-”或“&” 我曾尝试在末尾添加“end if;”,但它给出了上述错误和以下错误- **错误:C:/Modeltech\u pe\u edu\u 10.4a/examples/DECODER.vhd(35):VHDL编译器正在退出 library IEEE; use IEE
library IEEE;
use IEEE.std_logic_1164.all;
entity DECODER is
port
(
I0: in std_logic;
I1: in std_logic;
D0: out std_logic;
D1: out std_logic;
D2: out std_logic;
D3: out std_logic
);
end DECODER;
architecture bhv of DECODER is
begin
process(I0,I1) is
begin
if (I0='0' AND I1='0') then
D0<= (NOT I0) AND (NOT I1);
elseif (I0='0' AND I1='1') then
D1<= (NOT I0) AND I1;
elseif (I0='1' AND I1='0') then
D2<= I0 AND (NOT I1);
elseif (I0='1' AND I1='1') then
D3<= I0 AND I1;
end process;
end bhv;
IEEE库;
使用IEEE.std_logic_1164.all;
实体解码器是
港口
(
I0:标准逻辑中;
I1:标准逻辑中;
D0:输出标准逻辑;
D1:输出标准逻辑;
D2:输出标准逻辑;
D3:输出标准逻辑
);
终端解码器;
解码器的bhv结构是
开始
进程(I0,I1)是
开始
如果(I0='0'和I1='0'),则
D0有两个语法错误
将elseif
更改为elsif
在结束过程
之前添加finalend if
从功能上讲,对代码来说是奇怪的;如果合成,它将推断锁存,因为分配的输出取决于输入值,并且在的每个分支进行分配的条件与分配的值相同,因此分配的值'1'
,因此过程相当于:
process (I0, I1) is
begin
if (I0 = '0' and I1 = '0') then
D0 <= '1';
elsif (I0 = '0' and I1 = '1') then
D1 <= '1';
elsif (I0 = '1' and I1 = '0') then
D2 <= '1';
elsif (I0 = '1' and I1 = '1') then
D3 <= '1';
end if;
end process;
进程(I0,I1)是
开始
如果(I0='0'和I1='0'),则
D0有两个语法错误
将elseif
更改为elsif
在结束过程
之前添加finalend if
从功能上讲,对代码来说是奇怪的;如果合成,它将推断锁存,因为分配的输出取决于输入值,并且在的每个分支进行分配的条件与分配的值相同,因此分配的值'1'
,因此过程相当于:
process (I0, I1) is
begin
if (I0 = '0' and I1 = '0') then
D0 <= '1';
elsif (I0 = '0' and I1 = '1') then
D1 <= '1';
elsif (I0 = '1' and I1 = '0') then
D2 <= '1';
elsif (I0 = '1' and I1 = '1') then
D3 <= '1';
end if;
end process;
进程(I0,I1)是
开始
如果(I0='0'和I1='0'),则
D0可能的重复项可能的重复项